Linux Seccomp

Last update: 2023-04-07 12:28:12 +0800 +0800
Available translations: 日本語 / 中文(简体) / 中文(繁體)

Seccomp (secure computing) restricts the system calls a process may make. In strict mode, a process is limited to a small set of calls, historically read, write, _exit, and sigreturn on existing file descriptors. It is intentionally too narrow for most modern applications.

Filter mode attaches a classic BPF program that examines syscall numbers and selected arguments. The filter can allow, deny with an errno, kill the process, log, trace, or delegate a decision to a userspace notifier. Filters are monotonic: once installed, they cannot be relaxed. no_new_privs is normally required before an unprivileged process installs a filter, preventing the filter from being bypassed through a later privilege gain. Container runtimes use seccomp as one layer of defense, alongside namespaces, capabilities, and mandatory-access-control policy.

Comments

Read or comment on GitHub (sign-in required to comment)