
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.
Tag
7 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.

Use strace 6.8 on Linux to list every file a program opens, find its real config path from the ENOENT search order, and spot unexpected reads and writes.

Trace a whole process tree with strace -f on Linux: read the pid prefix, split output per process with -ff -o, and follow threads that do the real work.

Cut strace 6.8 output to the system calls that matter using -e trace= with call names, class sets like %file and %network, negation, regexes and status=failed.

Use ltrace 0.7.3 on Linux to print the shared library calls a program makes, such as malloc and strcpy, with arguments and return values, and filter with -e.

Attach strace -p to a process that is already running on Linux, fix the Yama ptrace_scope permission error, watch a stuck call, then detach without killing it.

Learn to trace programs on Linux with strace 6.8 and ltrace 0.7.3: read every line, filter, time, follow children, find config bugs and know the limits.