Skip to content

test(shellsafe): cover fail-closed classification matrix - #7760

Open
innocarpe wants to merge 1 commit into
esengine:main-v2from
innocarpe:contrib/r11-shellsafe-tests
Open

test(shellsafe): cover fail-closed classification matrix#7760
innocarpe wants to merge 1 commit into
esengine:main-v2from
innocarpe:contrib/r11-shellsafe-tests

Conversation

@innocarpe

Copy link
Copy Markdown
Contributor

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 rejected
  • nestedReadOnlyArgsSafe allowlist 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 input

Issues

None — coverage gap, no issue report.

Verification

  • go test ./internal/shellsafe/ — pass (125 new cases)
  • go vet / gofmt -l — clean

Documentation 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

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant