Skip to content

Commit f14c63e

Browse files
committed
docs: update seccomp documentation with OCI example
Replace outdated TODO comment with accurate information about runc's seccomp support. Add OCI seccomp example. Signed-off-by: Osama Abdelkader <[email protected]>
1 parent 7d81b21 commit f14c63e

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

libcontainer/SPEC.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,49 @@ profile <profile_name> flags=(attach_disconnected,mediate_deleted) {
367367
}
368368
```
369369

370-
*TODO: seccomp work is being done to find a good default config*
370+
Seccomp filtering is supported, users can provide their own seccomp profile
371+
372+
Seccomp can be used to filter the syscalls a container can use. The filter used is quite expressive. For example, a filter can allow only a syscall when used with a specific parameter is allowed, change the errno returned or even forward it to a user-space agent to act on it.
373+
374+
Example OCI seccomp profile:
375+
376+
```json
377+
{
378+
"defaultAction": "SCMP_ACT_ERRNO",
379+
"architectures": [
380+
"SCMP_ARCH_X86_64",
381+
"SCMP_ARCH_X86",
382+
"SCMP_ARCH_X32"
383+
],
384+
"syscalls": [
385+
{
386+
"names": [
387+
"accept",
388+
"accept4",
389+
"access",
390+
"bind",
391+
"brk",
392+
"chdir",
393+
"chmod",
394+
"chown",
395+
"close",
396+
"connect",
397+
"execve",
398+
"exit",
399+
"exit_group",
400+
"fork",
401+
"getpid",
402+
"getppid",
403+
"listen",
404+
"open",
405+
"read",
406+
"write"
407+
],
408+
"action": "SCMP_ACT_ALLOW"
409+
}
410+
]
411+
}
412+
```
371413

372414
### Runtime and Init Process
373415

0 commit comments

Comments
 (0)