test(shellsafe): cover fail-closed classification matrix - #7760
Open
innocarpe wants to merge 1 commit into
Open
Conversation
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
Add fail-closed classification matrix tests for the security-boundary command classifier in
internal/shellsafe/(125 cases, tests only — zero production changes):ClassifyReadOnlyCommand/resolved*family (42 fail-closed + 10 narrow-dynamic-shape): negated (!), background (&), disown, coprocess, redirects, assignments, multi-statement/command substitution, separators/pipelines/subshells/heredocs — all rejectednestedReadOnlyArgsSafeallowlist table (39): find -exec/-delete, sed -i, sort -o, git diff --output, go env -w, git tag forms (white-box, documented why the table is unreachable via the public seam today)NormalizeBashSafeRedirectsForMatch(34): fd dup/close, null sinks (/dev/null,$null,nul,&>>), heredoc rejection, malformed inputIssues
None — coverage gap, no issue report.
Verification
go test ./internal/shellsafe/— pass (125 new cases)go vet/gofmt -l— cleanDocumentation impact
Documentation-impact: none - test-only addition.
Cache impact
Cache-impact: none - test-only; not a cache-sensitive path.
Cache-guard: N/A
System-prompt-review: N/A