Skip to content

Windows: recompute deny set per exec and pin .git ancestor chain - #486

Open
ant-kurt wants to merge 1 commit into
mainfrom
fix/windows-per-exec-deny
Open

Windows: recompute deny set per exec and pin .git ancestor chain#486
ant-kurt wants to merge 1 commit into
mainfrom
fix/windows-per-exec-deny

Conversation

@ant-kurt

Copy link
Copy Markdown
Collaborator

Summary

Windows deny ACLs were stamped once at session initialize and recorded in the state database. A mandatory path that appeared later was never covered, a .git\config ACE stripped by git's own rewrite (MoveFileEx drops the DACL) stayed stripped until the next session, and stale records could leave stray ACEs behind. The mandatory and configured deny set is now computed at wrap time for every command and passed through srt-win exec --deny-read/--deny-write, held under the exec PID and released when it ends; session initialize applies grants only.

The sandbox could also rename .git (or any directory above it) aside and recreate the path unprotected. srt-win now places an object-only DELETE|WRITE_DAC deny on every real directory between a deny target and its covering modify-grant root (SbAce::DenyPin); children keep their own DELETE, so index.lock → index and other writes inside .git are unaffected. Depth counting matches the Linux scan (mandatoryDenySearchDepth, default 3, node_modules skipped).

Test plan

  • test/sandbox/windows-per-exec-deny.test.ts: per-exec set composition (session ∪ per-exec ∪ credential ∪ mandatory, read-deny precedence, allowGitConfig), depth counting parity with rg --max-depth, node_modules skip.
  • state_db unit test grant_root_of_picks_deepest_modify_grant.

Mandatory and configured denies are computed at wrap time and passed
through srt-win exec --deny-*, held under the exec PID and released
when it ends. Session initialize only applies grants. srt-win pins
each real ancestor between a deny target and its modify-grant root
with an object-only DELETE|WRITE_DAC deny.
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