Skip to content

docs(sandbox): seccomp BPF filtering design for the bwrap backend - #288

Merged
quickbeard merged 1 commit into
mainfrom
docs/bwrap-seccomp-plan
Aug 24, 2026
Merged

quickbeard merged 1 commit into
mainfrom
docs/bwrap-seccomp-plan

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Summary

Design doc proposing a seccomp BPF filter for the bubblewrap sandbox backend, closing the gap that namespaces alone leave open: the guest shares the host kernel and today can reach its entire syscall surface, so a single kernel LPE inside the jail is a full host escape.

Key decisions in the doc:

  • Strict allowlist (srt-style) as the target posture — default-deny with an enumerated syscall set, socket restricted to AF_UNIX, and SCMP_ACT_KILL_PROCESS on the escalation primitives (nested-userns unshare, keyctl, bpf, module loading, ptrace, userfaultfd, ...).
  • Precompiled per-arch BPF blobs built in CI with libseccomp and shipped through the existing image manifest — no native dependency or guest-side shim; bwrap installs the filter itself via --add-seccomp-fd, with the fd passed through the spawn stdio array.
  • Audit-first rollout: bwrap has no audit flag, so SECCOMP_RET_LOG vs enforce is baked into separate blobs; the default flips to enforce only after the audit log is quiet across the image toolchain.

The doc includes a full change map with file/line anchors (args.ts, provider.ts, config schema + the desktop normalizer, build-image.ts/manifest, tests), and leaves three open questions for the team: degradation policy on old bwrap, global vs per-sandbox config for v1, and whether to hard-block ptrace.

Docs only — no behavior change.

🤖 Generated with Claude Code

Proposes adding a strict-allowlist seccomp filter to the bubblewrap
sandbox: precompiled per-arch BPF blobs built in CI with libseccomp,
handed to bwrap via --add-seccomp-fd through the spawn stdio array.
Covers the change map (args.ts, provider.ts, config schema/normalizer,
manifest/CI, tests), an audit-first rollout since bwrap has no audit
flag, and open questions on degradation policy and config granularity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quickbeard
quickbeard force-pushed the docs/bwrap-seccomp-plan branch from 27227be to 429cc19 Compare August 24, 2026 02:48
@quickbeard
quickbeard merged commit c18c399 into main Aug 24, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the docs/bwrap-seccomp-plan branch August 24, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant