fix(profile): desktop (was sandbox) is shell-equivalent; add observe; document profiles - #46
Merged
Merged
Conversation
…rop browser_evaluate Refs #45. GUI control is a shell: osascript (do shell script), key and mouse all reach the desktop user's shell, so hiding exec* removed a convenience, not a privilege. Rename the profile to desktop (sandbox still accepted on the wire and in stored grants, on macOS and Linux), declare it isShellEquivalent, and add ProfileBoundaryTests: any profile that claims to be narrower must allow no shell-capable tool. Remove browser_evaluate from the allowed browser tools (arbitrary JS; contradicted the README). README, reverse-attach ADR and Linux docs state the limit and recommend lending a dedicated computer.
observe is the first profile that is a boundary: an allowlist of sys_info and screenshot, so any new tool (local or upstream) is denied until listed; isShellEquivalent = false, enforced by ProfileBoundaryTests. Same on the Linux node (local_tool_allowed / OBSERVE_TOOLS; hidden tools are unknown on call too). docs/tool-profiles.md records the profiles, their complete tool lists on macOS and Linux (from live tools/list on macmini and black), and what each loses against the previous one.
Contributor
Author
|
Added in the second commit:
Connect/Remote do not offer Observe yet (oablab/oab-pty-mac#76): they must keep sending |
… are accepted BREAKING: `sandbox` is no longer an alias of `desktop`. It promised a boundary that does not exist, and a client still sending it has not been updated to tell its user the truth. POST /attach with profile=sandbox is a 400 (macOS and Linux), and a grant persisted under it is dropped at resume. Clients must send desktop/observe (oablab/oab-pty-mac#76) and ship together with computers running this build.
Contributor
Author
|
Per maintainer decision:
Rollout consequence. Connect 1.8.0 and Remote 0.5.0 (in App Review) send |
Merged
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.
First step of #45.
What changes
ToolProfile.sandbox→desktop. The wire and persisted valuesandboxis still accepted and meansdesktop, so current Connect/Remote builds and grants stored on disk keep working (Swiftinit(rawValue:); Linuxnormalize_profile). Grants now report"desktop".desktopdeclaresisShellEquivalent. The doc comments, the grant instructions, README, the reverse-attach ADR (decision 4 amended) and the Linux docs now say it plainly:osascript/key/mousereach the desktop user's shell, so removingexec*is not a privilege reduction. The docs recommend lending a dedicated computer when full control is granted, and note that the browser tools use this computer's logged-in profile and network.browser_evaluateremoved from the allowed browser tools (Swift + Linux). It is arbitrary JavaScript in the page, and the README already claimed it was excluded.ProfileBoundaryTests: it scans the shipped tool sources, so new tools are covered automatically. Any profile withisShellEquivalent == falsemust allow noexec*/osascript/key/mouse. It fails today for any attempt to calldesktopnarrower, and it is the gate for the plannedobserve/browsertiers.browser_evaluate: tool lists are otherwise identical.Verified
swift test118/118, including the 5 new boundary tests.-D warningsclean; 15/15 unit tests, including oldsandboxgrants resuming asdesktopand unknown profiles dropped, never widened; smoke 47/47, including "old profile name sandbox is accepted as desktop".Downgrade note: a grant persisted by this build carries
"desktop". An older daemon would drop it at resume, which is safe (the grant ends; nothing is widened).Client copy follow-up: oablab/oab-pty-mac#76.