feat: add restricted token sandbox for Windows#206
Merged
Conversation
e01832d to
1d15c33
Compare
Remove dangerous privileges (SeDebugPrivilege, SeBackupPrivilege, etc.) and apply Job Object to block child process creation after initialization.
…ict mode Replace magic number 1300 with ERROR_NOT_ALL_ASSIGNED constant. Document nested Job Object behavior on Windows 8+. Strict mode now requires FullyEnforced (both privileges removed and job applied).
The sandbox module was declared in windows/mod.rs but not re-exported from the platform module, causing build failures on Windows.
domcyrus
added a commit
that referenced
this pull request
Apr 9, 2026
- Windows restricted token sandbox (#206) - macOS Seatbelt sandboxing, later tightened (#196, #203) - Linux sandbox hardening: drop capabilities and clear ambient set (#208) - UI: process privilege shown in security section (#197) - Filter: exact port matching and regex support (#195) - VLAN support in PKTAP/SLL parsers and L3 extraction (#202, #199) - IGMP protocol parsing (#209) - Process name for wildcard /proc/net entries (#218) - CPU efficiency improvements in sort/snapshot/rate/timeout paths (#213, #220, #212, #222) — thanks @deepakpjose - FreeBSD platform cleanup (#205) - Fix default interface selection (#194), root detection on Unix (#192) - Dependency updates
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
SeDebugPrivilege,SeTakeOwnershipPrivilege,SeBackupPrivilege,SeRestorePrivilege, etc.) from the process token after initialization usingSE_PRIVILEGE_REMOVED(permanent, cannot be re-enabled)JOB_OBJECT_LIMIT_ACTIVE_PROCESS = 1to block child process creation (reverse shells, exec-based exfiltration)--no-sandbox/--sandbox-strictCLI flagsLimitations
Windows sandboxing is weaker than Linux/macOS/FreeBSD — no filesystem or network restriction available at the process level. This is a best-effort defense-in-depth measure.
Test plan
--no-sandboxdisables cleanly--sandbox-strictexits if enforcement fails