Problem
Detection today is pure pattern-matching against known vendor prefixes (sk-, xox-, etc.). A random 40-character hex or base64 blob with no recognizable prefix — e.g. a raw API key from a vendor not in the ruleset, or a generic bearer token — sails through completely undetected. Competing tools (gitleaks, trufflehog) mix pattern-matching with Shannon-entropy scoring specifically to close this gap.
Fix
Add an entropy-based detection layer:
- Compute Shannon entropy over base64/hex-shaped token candidates in the scanned text
- Only flag high-entropy tokens that also have supporting context (nearby keyword like
key, token, secret, password, or sit on the right side of an assignment) — entropy alone is too false-positive-prone (flags UUIDs, hashes, git SHAs, etc.)
- Follow the same pattern as gitleaks: pattern-or-keyword-proximity and entropy threshold, never entropy alone
Acceptance criteria
Problem
Detection today is pure pattern-matching against known vendor prefixes (
sk-,xox-, etc.). A random 40-character hex or base64 blob with no recognizable prefix — e.g. a raw API key from a vendor not in the ruleset, or a generic bearer token — sails through completely undetected. Competing tools (gitleaks, trufflehog) mix pattern-matching with Shannon-entropy scoring specifically to close this gap.Fix
Add an entropy-based detection layer:
key,token,secret,password, or sit on the right side of an assignment) — entropy alone is too false-positive-prone (flags UUIDs, hashes, git SHAs, etc.)Acceptance criteria
token:/api_key=is detected