Lion Cipher Lab

Build a syscall sandbox from scratch with seccomp-BPF

Why it matters

Every meaningful thing a program does — read a file, open a socket, start a process, allocate memory — is a syscall: a request across the boundary from userspace into the kernel. That boundary is also the attack surface. A huge share of privilege-escalation and container-escape exploits work by reaching a buggy or dangerous syscall the program never actually needed. seccomp (SECure COMPuting) is the kernel's answer: a process installs a filter, and the kernel consults it on EVERY syscall, deciding to allow it, fake an error, trap it, log it, or kill the process. Shrinking the set of syscalls…

What you'll learn

Steps in this lab

  1. What a syscall is, and what seccomp does about it
  2. Set up a scratch box and tools
  3. The easy path: a default-deny allowlist with libseccomp
  4. Prove it dynamically: run it, watch SIGSYS, read the audit line
  5. The raw path: hand-build the seccomp-BPF filter
  6. The named failure modes (this is the advanced part)
  7. The judgment: when to reach for seccomp — and when NOT to hand-roll it

Open the full interactive lab →