Skip to content

Commit 656677b

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 656677b

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

libcontainer/SPEC.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,31 @@ 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** can be used to apply filters to the system calls used in
371+
a container. The set of filter expressions allows you to match against syscall
372+
numbers (automatically resolved from syscall names) and apply various
373+
comparison operators to syscall arguments.
374+
375+
*seccomp*: https://en.wikipedia.org/wiki/Seccomp
376+
377+
When a filter rule matches, the associated action will occur (this could
378+
involve killing the process or thread, returning an errno value without
379+
executing the syscall, forwarding the request to a user-space agent to handle,
380+
emitting a log entry, or permitting the syscall to execute).
381+
382+
The primary
383+
use-case is to provide an explicit allow-list of syscalls for a container, to
384+
reduce the kernel API attack surface exposed the container.
385+
Historically, seccomp has protected containers against various kernel 0-day
386+
vulnerabilities, so a strong seccomp filter is highly recommended.
387+
388+
libcontainer
389+
does not currently provide a default filter, but higher-level runtimes tend to
390+
define their own filters for use with runc. Here is an example OCI seccomp
391+
profile (see *the runtime specification* *oci-runtime-seccomp* for more
392+
information on how to write your own filters):
393+
394+
https://github.com/opencontainers/runtime-spec/blob/v1.2.1/config-linux.md#seccomp
371395

372396
### Runtime and Init Process
373397

0 commit comments

Comments
 (0)