
Security
Build a seccomp Allowlist by Recording a Program's Syscalls With strace
Record a program's system calls with strace, turn the list into a libseccomp allowlist, and test it with a logging default before you switch to kill.
6 min read
Tag
4 posts

Record a program's system calls with strace, turn the list into a libseccomp allowlist, and test it with a logging default before you switch to kill.

Build a default-deny seccomp allow-list in C with libseccomp, add an argument rule that limits write to one file descriptor, and inspect the generated BPF.

How seccomp-bpf lets a process install a classic BPF filter that allows, blocks or kills on each system call, with the return actions and a working C example.

Build a Linux process sandbox layer by layer: drop root and capabilities, add namespaces, seccomp, Landlock, cgroups and systemd limits, then test what escapes.