Repository navigation
Conversation
OpenGrep prefixes the ID of every rule it loads from a --config path with the path's directories, so the --exclude-rule flags built from bare rule IDs never matched and every bundled rule ran regardless of <language>_enabled_rules. The scanner now passes OpenGrep a temporary copy of the rules file holding only the enabled rules. Enabled IDs that match no rule are logged as a warning, and an allowlist that matches nothing runs every rule for the language. The <language>_enabled_rules defaults are now empty in action.yml and connectors.yaml, so every bundled rule runs by default, as scans already did. The Action defaults had drifted from the CLI defaults and named seven rule IDs that no longer exist. A test now rejects default lists that name unknown rule IDs. Also: - Skip erlang.yml and objective-c.yml in every all-languages expansion; OpenGrep supports neither language. - Remove the temporary custom-rule and filtered-rule directories when the scan ends. - Add an end-to-end test that runs the real OpenGrep binary. Fixes #135
|
bugbot run |
PR SummaryMedium Risk Overview Defaults and config semantics change on upgrade. GitHub Action inputs and CLI defaults for Related SAST fixes: all-languages scans skip Reviewed by Cursor Bugbot for commit 6b804c0. Configure here. |
OpenGrep computes a finding's fingerprint from its rule ID, and by default it prefixes that ID with the directories of the rule file's --config path. Filtered and custom rule files live in a new temporary directory on every run, so unchanged findings got a new fingerprint each scan, which breaks deduplication in the JSON and Microsoft Sentinel outputs. Pass --no-rewrite-rule-ids so the fingerprint depends only on the rule and the code. Also test that temporary rule directories are removed when OpenGrep is missing, when the scan raises, and when building custom rules fails.
enabled_rules allowlists take effect
Socket keys an injected SAST alert on its full props, including the OpenGrep fingerprint, and stores triage against that key. The fingerprint comes from a rule ID that OpenGrep prefixes with the rules file's directories, not its file name. Passing --no-rewrite-rule-ids would have given every SAST alert a new key once, dropping its triage. Drop that flag and write each filtered copy next to the file it was made from, under a hidden .yaml name that the *.yml rule globs skip. Kept findings report the same fingerprint as an unfiltered scan. When the rules directory is not writable, the copy falls back to a temporary directory and the log warns that fingerprints will differ. C and C++ share c_cpp.yml, and C# and .NET share dotnet.yml. When both languages in a pair are enabled and either has an empty list, the shared file now runs every rule instead of applying the other language's list.
Resolve docs/github-action.md against the 3.5.0 version bump, and move this branch's changelog entries from the released 3.5.0 section to Unreleased.
|
bugbot run |
Stage rule configs with their original OpenGrep IDs so filtering also works with read-only rules directories. Scope C and C++ allowlists by analyzer and combine explicit lists for the C# and .NET aliases. Coerce string flags, test empty defaults, and document the fallback for lists with only unknown rule IDs.
enabled_rules allowlists take effect|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 6b804c0. Configure here.
Summary
<language>_enabled_rulesnow limits which rules OpenGrep runs. OpenGrep namespaces local rule IDs by their configuration path, so the previous bare-ID exclusions did not match. Empty defaults in the Action and CLI keep the full ruleset available for every enabled language. Existing explicit lists take effect on upgrade."false"are interpreted as booleans.Verification
Fixes #135
Fixes CE-496