Skip to content

refactor: simplify macOS Seatbelt sandbox from whitelists to blanket allows#70

Merged
yishuiliunian merged 1 commit intomainfrom
refactor/seatbelt-sandbox-simplify
Apr 3, 2026
Merged

refactor: simplify macOS Seatbelt sandbox from whitelists to blanket allows#70
yishuiliunian merged 1 commit intomainfrom
refactor/seatbelt-sandbox-simplify

Conversation

@yishuiliunian
Copy link
Copy Markdown
Contributor

Summary

  • Replace per-item whitelists for sysctl-read, mach-lookup, iokit-open, and file-map-executable with blanket (allow ...) rules
  • These whitelists added no security value since process-exec/process-fork are already unrestricted, but repeatedly broke legitimate tools (Bazel TSan dylib, JVM crashes, Nix toolchains, etc.)
  • Keep real security boundaries tight: file-write* workspace containment, sensitive-file deny patterns, env-var sanitization, sysctl-write lock

Changes

  • crates/loopal-sandbox/src/platform/seatbelt_base.sbpl — major simplification (-62 lines of whitelists)
  • crates/loopal-sandbox/src/platform/macos.rs — update doc comment
  • crates/loopal-sandbox/tests/suite/platform_macos_test.rs — replace whitelist assertions with blanket-allow assertions

Test plan

  • bazel test //crates/loopal-sandbox:loopal-sandbox_test passes
  • bazel build //... --config=clippy passes (0 warnings)
  • bazel test //... passes (48/48 tests)
  • CI passes

…allows

The sandbox repeatedly broke legitimate tools (Bazel TSan dylib, JVM,
Nix toolchains) because sysctl-read, mach-lookup, iokit-open, and
file-map-executable used per-item whitelists that could never cover
every tool. Since process-exec/process-fork are already unrestricted,
these whitelists add no security value — an attacker can exec() any
static binary to bypass them.

Replace with blanket (allow ...) for all four categories while keeping
the real security boundaries tight: file-write* workspace containment,
sensitive-file deny patterns, env-var sanitization, sysctl-write lock.
@yishuiliunian yishuiliunian merged commit a9715cd into main Apr 3, 2026
3 checks passed
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