Skip to content

Fix global allowlist being silently ignored in match_regex()#56

Merged
spark1security merged 3 commits into
mainfrom
issue-55
May 23, 2026
Merged

Fix global allowlist being silently ignored in match_regex()#56
spark1security merged 3 commits into
mainfrom
issue-55

Conversation

@spark1security
Copy link
Copy Markdown
Owner

Closes #55

Summary

  • Bug fix: match_regex() in scanner.py only checked per-rule allowlists entries; the top-level allowlist section in regex.yaml was never read, so global regex and stopword exclusions had no effect.
  • Fix: match_regex() now reads regex_config["allowlist"] at the start of each call. Global regexes are checked against the full scanned text (same logic as per-rule allowlists); global stopwords are checked as case-insensitive substrings of the matched secret string.
  • Docs: Added a "Reducing False Positives" section to both USER_MANUAL.md and SDK_GUIDE.md explaining all three allowlist keys (regexes, stopwords, paths), with examples.
  • Version bump: 1.2.4 → 1.2.5

Test plan

  • Add a pattern to allowlist.regexes (e.g. (?i)^changeme$) and confirm a scan against that text produces no finding
  • Add a word to allowlist.stopwords and confirm a scan whose match contains that word is suppressed
  • Confirm a scan against text that does not match any allowlist entry still produces a finding
  • Verify --regex-file with a custom allowlist works end-to-end on at least one platform

@spark1security spark1security requested a review from blupants May 23, 2026 20:01
@spark1security spark1security self-assigned this May 23, 2026
Copy link
Copy Markdown
Collaborator

@blupants blupants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, also implement support to allowlist.paths for local, github and gitlab mode

@spark1security spark1security requested a review from blupants May 23, 2026 20:41
Copy link
Copy Markdown
Collaborator

@blupants blupants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@spark1security spark1security merged commit 667668f into main May 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global allowlist in regex.yaml is never applied (false positive filtering broken)

2 participants