fix(brain-repo): harden secrets_scanner — provider coverage + false-positive filters#120
Open
mt-alarcon wants to merge 1 commit into
Open
Conversation
…ositive filters
The Brain Repo secrets scanner silently deleted legitimate backup files on
false positives (aggressive patterns matched var names, base64 image data,
${VAR} refs, ALL_CAPS binding names, placeholders like SUA_SENHA).
This hardens the scanner in both directions:
- Adds 13+ provider patterns (GitLab, Supabase, HuggingFace, Replicate, Groq,
npm, PyPI, Linear, Figma, Telegram bot, Notion ntn_, Meta EAA with
access_token/bearer context guard, Google OAuth GOCSPX-)
- Case-sensitive lookbehind/lookahead on AWS/JWT/Fernet/GENERIC_SECRET to kill
false positives without losing real true-positives
- Central _is_false_positive filter rejecting ${VAR} refs and placeholders
Regression-tested both ways (FP corpus -> 0, real TP intact). Test fixtures are
synthetic. 111 tests.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Sorry @mt-alarcon, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
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.
Problem
The Brain Repo secrets scanner silently deleted legitimate backup files on false positives. Aggressive patterns matched variable names (
password), base64 image data,${VAR}references, ALL_CAPS binding names (META_CAPI_TOKEN_X), and placeholders (SUA_SENHA). In our instance this deleted dozens of real files from the backup before we caught it.Fix
Hardens the scanner in both directions (fewer false positives, no lost true-positives):
ntn_, MetaEAA(with access_token/bearer context guard + length floor), Google OAuthGOCSPX-._is_false_positivefilter rejecting${VAR}refs and common placeholders.Testing
🤖 Generated with Claude Code