Archivesecurity
Seccomp: Shrinking the Syscall Surface
Most workloads need a few dozen syscalls. Filters can make the rest fail fast.
- Published
- Reading time
- 1 min read
Seccomp-bpf filters syscalls per thread. A denied call returns an error (or kills the process), which removes entire exploit primitives: mount, ptrace, bpf, unshare, raw sockets.
How it is used
- Container runtimes apply a default profile (Docker's is permissive but blocks the worst calls).
- Runtimes for untrusted code (gVisor, browsers) use tight allowlists.
no_new_privsshould accompany the filter so setuid binaries cannot regain privileges.
Practical guidance
- Trace the workload's syscalls, then build an allowlist with argument filtering where possible.
- Expect breakage on upgrades: new library versions may add syscalls.
- Log denials during rollout, then enforce.
- Combine with seccomp's
SCMP_ACT_ERRNOrather than kill for easier debugging.
Limits
Seccomp filters syscalls, not their arguments in all cases, and does not stop logic bugs inside allowed calls. It reduces blast radius; it is not a sandbox by itself.
Takeaway: a syscall allowlist is one of the cheapest hardening steps for containerized workloads. Trace, allowlist, then enforce.