Repository navigation
fix(box): state the full FSEvents reach in the file-watching warning - #484
Conversation
… file-watching warning The file-watching startup warning named denied-name and metadata disclosure but not three further reaches the same FSEvents grant carries: a host-wide count of filesystem activity (readable across other users and boxes), each volume's history-database identifier, and the root-only routine that deletes a volume's recorded event history. Widen file_watching_disclosure to name all three, and update the config reference, the decision record, and the containment design doc to match. The warning keeps its single owner, so the startup and process-start lines stay in sync. Verified on macOS by measurement. In a box with file-watching = true and no content grant on the target volume, a root workload purged the volume's recorded history (history replay dropped to empty and every on-disk log file was removed), while a non-root workload was refused by the service. Seatbelt carries no per-message filter for a mach service, so the connection is all-or-nothing and the service's own root check is the only gate on the purge.
|
Assessment: Request Changes It is correct to make the warning wider. But the root history purge is a write outside every grant, not a disclosure. The PR records it as an accepted cost without a maintainer decision, and the new line still says that write restrictions apply. Review Categories
Checked and held: The warning text keeps one owner ( The measurement work behind this, especially the non-root refusal check, is clear and useful. |
…strictions Address review on the file-watching warning: - The warning named the root history deletion, then said write restrictions still apply. State the deletion as the one exception to those restrictions. - Revert the decisions.md edit. Accepting this reach is a maintainer decision. - Carry the same wording to every page that states the cost: config.md, security.md, architecture.md, and containment.md. - Rename the "metadata limitation" links, since the section now covers a deletion too.
|
Thanks for the review. a41812e addresses all three points:
One correction to my first description: Seatbelt can filter messages to a mach service, as WebKit's |
|
Assessment: Approve (for a41812e) a41812e resolves both blocking findings from the earlier review. The warning now states the root deletion as the exception to write restrictions. What I checked
The measurement table and the analysis of the |
|
/strands review In your approval of a41812e you said four places that state the file-watching cost are not updated, and pointed to a file-level comment on docs/user/config.md. That comment was not posted. Please name the four places, with file and line. |
|
You're right. My file-level comment on Suggestion (non-blocking): These four places still state only the name and metadata disclosure. They omit the host-wide event count, the volume history identifier, and the root deletion.
There is also one internal doc comment with the same gap, if you want to update it too: Suggestion: Add the clause the other pages now use to each one: "…, the host-wide event count, and each volume's history identifier; a root process can also delete any volume's event history." For item 1, also change "Direct filesystem and other service rules do not change" so that it does not read as "no write reach is added". My approval stands. None of these blocks the merge. |
The review named four more places that stated only name and metadata disclosure, plus one internal doc comment. Add the host-wide event count, the volume history identifier, and the root deletion to each: - crates/containment/README.md, which sets the caller's disclosure duty. Also say that the deletion is the one change to filesystem rules. - crates/containment/src/config.rs, on allow_file_watching. The private field's doc now points to that method instead of repeating the cost. - crates/box/README.md - docs/user/config.md, after the filesystem list table - crates/box/src/record/config/process.rs
|
Assessment: Approve (for a7c2fa5) a7c2fa5 covers all four places from my last comment, plus What I checked
|
kevin-orellana
left a comment
There was a problem hiding this comment.
Reviewed a7c2fa5. No blocking findings in the warning and documentation changes. Acceptance of root file-watching behavior remains a separate maintainer decision.
Summary
The
file-watching = truewarning names denied-name and event-metadata disclosure. The same FSEvents grant reaches three more things:This fixes the warning and the user docs to state all three. The deletion is stated as the one exception to "file-content and write restrictions still apply", so the line no longer contradicts itself for root.
Whether Box should accept this reach for root, or refuse
file-watchingat euid 0, is a maintainer decision. This PR does not touchdocs/design/decisions.md. That choice will come separately through/kd.Changes
crates/box/src/run/contain/boundary.rs: widenfile_watching_disclosure. It is the one owner of the line, so the startup and process-start output stay in sync.docs/user/config.md: the file-watching section and its example output.docs/user/security.md,docs/design/architecture.md,docs/design/containment.md: the same cost, in each page's own form.docs/user/config.md,docs/user/mcp.md,docs/user/getting-started.md: rename the "metadata limitation" links, since the section now covers a deletion too.crates/containment/README.md,crates/box/README.md, and the doc comments onallow_file_watchingandProcessSpec::file_watching: the same cost.New warning:
Evidence
Measured on macOS 26.7.3, arm64, with a throwaway APFS image. The box held only a
metadata(stat) grant on the image's volume.file-watchingbootstrap_look_up.fseventsdlog filestruetruefseventsddefines seven routines, messages 66000 to 66006. Only 66005,FSEventsPurgeEventsForDeviceUpToEventId, changes host state.Seatbelt can filter messages to a mach service by message number. WebKit's
com.apple.WebProcess.sbdoes this forcom.apple.system.notification_center. Butsandbox_applyrefuses anyapply-message-filterwithout the private entitlementcom.apple.private.security.message-filter. Box can't hold that entitlement, so it can't grant watching and refuse only the purge.Testing
cargo test -p strands-box --all-features --lib file_watching_follows_only_the_selected_process: pass.cargo test -p strands-box --all-features --test file_watching(4 tests, real box with live FSEvents): pass.cargo test -p strands-box --test site_manifest --locked --all-features: pass.cargo fmt -p strands-box -- --check: clean.