feat(jailer): sandbox refactor with granular path access#277
Merged
DorianZheng merged 1 commit intomainfrom Feb 16, 2026
Merged
feat(jailer): sandbox refactor with granular path access#277DorianZheng merged 1 commit intomainfrom
DorianZheng merged 1 commit intomainfrom
Conversation
…g move - Introduce Jail trait and Jailer<S: Sandbox> generic with Seatbelt/Bwrap impls - Add build_path_access() for granular per-file/per-dir sandbox rules - Move console.log into logs/ (covered by existing RW subpath) - Add reflink-aware copy_if_newer() and reflink_rootfs_base() - Use layout-based paths in guest_connect.rs with reattach fallback - Add per-box shim logging via tracing_appender - Move seatbelt .sbpl policies to resources/seatbelt/
488d945 to
7285ca9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Jailtrait andJailer<S: Sandbox>generic struct withSeatbelt(macOS) andBwrap(Linux) implementations, replacing platform-specificmod.rsfilesbuild_path_access()that computes per-file/per-dirPathAccessrules with RO/RW markers, documented with a directory tree annotationlogs/: Eliminated a standalone sandbox file grant — now covered by the existinglogs/RW subpath rulecopy_if_newer()tries CoW clone first (APFS/btrfs/xfs), falls back to regular copy;reflink_rootfs_base()for zero-cost rootfs cloningguest_connect.rsusesBoxFilesystemLayoutmethods with fallback construction for cross-process reattach scenariostracing_appenderdaily logs written to{box_dir}/logs/.sbplfiles moved fromsrc/jailer/platform/macos/toresources/seatbelt/Test plan
BOXLITE_DEPS_STUB=1 cargo clippy -p boxlite --tests -- -D warnings— cleancargo fmt --check -p boxlite— cleancargo fmt --check -p boxlite-cli— cleanshare_across_processes.py) — verified after fixing layout fallback