feat(rule): enforce compound POSIX commands - #46
Open
ronheichman wants to merge 6 commits into
Open
ronheichman wants to merge 6 commits into
ronheichman wants to merge 6 commits into
Conversation
ronheichman
marked this pull request as ready for review
August 28, 2026 20:13
Remove expanded interpreter input analysis, preserve detection-only script handling, and cover pipeline grouping and native hook regressions. Built with Codex.
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
Detection runs first against the complete event. Candidate evaluation can only suppress enforcement when no independently safe command satisfies the same rule; it cannot create a finding or turn a non-match into a deny. POSIX branch and loop commands count as requested code without attempting to predict runtime control flow. Function bodies remain detection-only because shell state can replace or remove a definition before it is called.
Candidate programs and projections are built only for enabled enforcement rules that reference
shell_commands, keeping monitor-only startup and evaluation close to the existing cost.There are no schema, wire-format, or dependency changes.
Why
An enforce-enabled rule can detect
cat .envinsideecho ready; cat .env, but the existing event-wide safety check prevents a deny. Independent candidate eligibility closes that gap without changing detection semantics or trusting inferred function state.Verification
go test ./...go test -race ./...go vet ./...golangci-lint v2.12.2 rungolangci-lint v2.12.2 fmt --diffgovulncheck v1.6.0 ./...go generate ./ruleswith no generated diffgo mod tidywith no module diffFuzzAnalyzeShellCommandsfor 30 seconds