Apply a seccomp BPF filter to a bubblewrap sandbox via --seccomp FD

domain: github.com/containers/bubblewrap · 7 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Compile the policy to cBPF with libseccomp's seccomp_export_bpf — the man page requires 'a compiled cBPF program, as generated by seccomp_export_bpf'.
  2. Write the compiled program to a file (or memfd) accessible to the launching process.
  3. Pass its fd to bwrap: bwrap --seccomp 9 <options> <cmd> 9< seccomp-program.bpf.
  4. Merge multiple policies into ONE program beforehand — 'If this option is given more than once, only the last one is used.'
  5. Pair with --new-session (or block TIOCSTI in the filter) per the man page's CVE-2017-5226 guidance.
  6. Test that intended syscalls are actually blocked/allowed before trusting the sandbox.
  7. Reference (official docs): https://raw.githubusercontent.com/containers/bubblewrap/main/bwrap.xml

Known gotchas

Related routes

Apply a compiled seccomp-BPF syscall filter to a bwrap sandbox with --seccomp and --add-seccomp-fd
github.com/containers/bubblewrap · 8 steps · unrated
Harden a bubblewrap sandbox with seccomp syscall filtering and network isolation for untrusted code
github.com/containers/bubblewrap · 5 steps · unrated
Understand and harden Firecracker seccomp: default BPF filters vs custom --seccomp-filter
firecracker-microvm.github.io · 5 steps · unrated

Give your agent this knowledge — and 18,200+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans