Enforce rules across compound POSIX commands - #46
Open
ronheichman wants to merge 3 commits into
Open
Conversation
ronheichman
marked this pull request as ready for review
August 28, 2026 20:13
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.
Why
Rules that use
shell_commandscan detect a matching command inside compoundPOSIX input, but enforcement currently requires the entire input to be one
simple command or pipeline. Inputs such as
echo ready; cat .envare thereforedetected without being denied even when the matching rule is enforce-enabled.
What changed
tree, keeping direct pipeline members together.
retaining the complete command list for detection.
sequence projections whose enforcement masks used the previous semantics.
commands can participate, while keeping invalid, unsupported, and
unvalidated named interpreter options detection-only.
siblings, interpreter options, descriptors, checked expressions, and sequence
enforcement.
Safety and compatibility
This expands blocking only for eligible POSIX candidates. Dynamic executables,
runtime-expanded arguments or redirects, unsafe direct pipelines, inline
interpreters,
eval, malformed commands, unvalidated named interpreteroptions, and compound PowerShell or CMD input remain detection-only or produce
their existing analysis diagnostic. Statically resolved shell-function calls
also remain detection-only; eligible commands in an invoked function body are
considered separately.
There are no wire-format or rule-schema changes. Both sides of
&&and||are intentionally treated as requested command intent, even when one branch may
not execute.