Seccomp Profiles
What you'll learn: How to use seccomp (secure computing mode) to limit the system calls containers can make, dramatically reducing their attack surface.
What Is Seccomp?
Seccomp is a Linux kernel security feature that restricts which system calls (syscalls) a process can execute. Think of system calls as the "API" between applications and the kernel—they're how programs request privileged operations like opening files, creating network connections, or loading code. By blocking unnecessary syscalls, seccomp acts like a bouncer at a nightclub: most requests are denied by default, and only approved operations get through.
For containers, this is powerful. Even if an attacker achieves code execution inside your container or successfully escapes it, seccomp can prevent them from invoking dangerous syscalls needed for privilege escalation, kernel exploits, or persistent access.
How Seccomp Profiles Work
Seccomp profiles define allowlists (what's permitted) or denylists (what's blocked). Most container runtimes use allowlist mode, where only safe syscalls are permitted—typically 300-400 out of Linux's 400+ syscalls.
Common blocked syscalls include:
reboot,swapon(system control)ptrace(debugging other processes)kexec_load(loading new kernels)bpf(loading kernel programs)
Container runtimes like Docker apply a default seccomp profile automatically, but you can customize profiles to be even more restrictive based on your application's actual needs.
Real-World Impact
When attackers exploit container vulnerabilities, they often rely on specific syscalls for exploitation. Seccomp blocks these at the kernel level—even if the container escape technique is novel, the lack of required syscalls can neutralize it.
Key Takeaway: Seccomp profiles restrict containers to only necessary system calls, creating a kernel-enforced security boundary that blocks exploitation techniques even when container isolation fails—making it essential defense-in-depth for container security.