Skip to content

Commit 43b3b58

Browse files
committed
docs: update seccomp documentation with OCI format example
Replace outdated TODO comment with accurate information about runc's seccomp support. Add OCI seccomp format example and explain conversion to libcontainer format. This provides users with a practical starting point for creating custom seccomp configurations using the correct OCI format. Signed-off-by: Osama Abdelkader <[email protected]>
1 parent 7d81b21 commit 43b3b58

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

libcontainer/SPEC.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,55 @@ 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+
**Example OCI seccomp profile:**
373+
An example OCI seccomp profile based on Podman's default configuration is available at:
374+
https://github.com/containers/common/blob/main/pkg/seccomp/seccomp.json
375+
376+
Note: This is an OCI seccomp profile. Runc converts OCI seccomp profiles to libcontainer format
377+
using the `SetupSeccomp` function in `libcontainer/specconv/spec_linux.go`.
378+
379+
**Example OCI seccomp format:**
380+
```json
381+
{
382+
"defaultAction": "SCMP_ACT_ERRNO",
383+
"architectures": [
384+
"SCMP_ARCH_X86_64",
385+
"SCMP_ARCH_X86",
386+
"SCMP_ARCH_X32"
387+
],
388+
"syscalls": [
389+
{
390+
"names": [
391+
"accept",
392+
"accept4",
393+
"access",
394+
"bind",
395+
"brk",
396+
"chdir",
397+
"chmod",
398+
"chown",
399+
"close",
400+
"connect",
401+
"execve",
402+
"exit",
403+
"exit_group",
404+
"fork",
405+
"getpid",
406+
"getppid",
407+
"listen",
408+
"open",
409+
"read",
410+
"write"
411+
],
412+
"action": "SCMP_ACT_ALLOW"
413+
}
414+
]
415+
}
416+
```
417+
418+
This profile can be used as a starting point for creating custom seccomp configurations.
371419

372420
### Runtime and Init Process
373421

0 commit comments

Comments
 (0)