Add shell approval disposition matrix - #1750
Merged
Merged
Conversation
Comment on lines
+314
to
+319
| foreach (var redirect in clause.Redirects) | ||
| { | ||
| var directory = ResolveRedirectDirectory(redirect); | ||
| if (directory is not null) | ||
| directories.Add(directory); | ||
| } |
Comment on lines
+62
to
+65
| var rootDirectory = Path.Combine( | ||
| Path.GetTempPath(), | ||
| "netclaw-approval-matrix", | ||
| Guid.NewGuid().ToString("N")); |
| Path.GetTempPath(), | ||
| "netclaw-approval-matrix", | ||
| Guid.NewGuid().ToString("N")); | ||
| var projectDirectory = Path.Combine(rootDirectory, "project"); |
| "netclaw-approval-matrix", | ||
| Guid.NewGuid().ToString("N")); | ||
| var projectDirectory = Path.Combine(rootDirectory, "project"); | ||
| var sessionDirectory = Path.Combine(rootDirectory, "session"); |
| Guid.NewGuid().ToString("N")); | ||
| var projectDirectory = Path.Combine(rootDirectory, "project"); | ||
| var sessionDirectory = Path.Combine(rootDirectory, "session"); | ||
| var externalDirectory = Path.Combine(rootDirectory, "external"); |
| Directory.CreateDirectory(sessionDirectory); | ||
| Directory.CreateDirectory(externalDirectory); | ||
|
|
||
| var store = new ToolApprovalStore(Path.Combine(rootDirectory, "tool-approvals.json")); |
| => isMessy switch | ||
| { | ||
| true => "Yes", | ||
| false => "No", |
| { | ||
| true => "Yes", | ||
| false => "No", | ||
| null => "Not applicable" |
Aaronontheweb
commented
Aug 4, 2026
| if (!OperatingSystem.IsWindows()) | ||
| { | ||
| foreach (var unit in ExtractApprovalUnitsViaBashParser(command)) | ||
| foreach (var unit in ExtractApprovalUnitsViaBashParser(command, workingDirectory)) |
Collaborator
Author
There was a problem hiding this comment.
LGTM - better to pass this in explicitly
| /// Creates the audience profiles that a new installation stores for the selected posture. | ||
| /// Personal installations require approval for shell commands unless another authorization gate permits the command. | ||
| /// </summary> | ||
| public static ToolAudienceProfiles CreateProfilesForPosture(DeploymentPosture posture) |
Collaborator
Author
There was a problem hiding this comment.
LGTM - shell is denied in other security postures by default.
| /// </summary> | ||
| public bool ShortCircuitsApproval(string candidateVerb, string? cwd, ToolInvocationContext context) | ||
| => AllShortCircuit([candidateVerb], cwd, context); | ||
| => AllShortCircuit([new ApprovalCandidate(candidateVerb, Directory: null)], cwd, context); |
Collaborator
Author
There was a problem hiding this comment.
It's possible to have verbs without a specific CWD
Collaborator
Author
There was a problem hiding this comment.
LGTM - has good coverage of built in defaults / likely user-defined pairings
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
Corpus
Current parser gaps
The snapshot records current results that PR #1733 should change.
echo $(git push)runs through the side-effect exemptiongit status & git pushruns through the safe-verb grantbash -lc "git push"usesbashas its approval candidateThese rows make each future result change explicit in the snapshot review.
Shared install policy
ToolAudienceProfileDefaults.CreateProfilesForPosturenow owns the installed audience profiles.The setup wizard, the security editor, and the matrix use this factory.
No OpenSpec or product specification file changed.
Security fixes
Validation
dotnet slopwatch analyzepwsh ./scripts/Add-FileHeaders.ps1 -Verifygit diff --check