Originally created by: fu351
The built-in secret detector (SecretLeakageRule, src/doberman/engine/rules/secrets.py; patterns in _CREDENTIAL_PATTERNS, ~lines 52–75) already recognizes AWS (AKIA… / ASIA…), Google API keys (AIza…), GitHub, GitLab, Slack, Stripe, OpenAI/Anthropic, SendGrid, npm, JWTs, PEM private-key headers, and DB URIs with embedded creds. Two of the biggest clouds are missing:
AccountKey=… / connection strings, SAS tokens.{"type": "service_account", …, "private_key": "-----BEGIN PRIVATE KEY-----…"} shape.An agent handing one of those to an external destination should trip the same defense the others do.
Add conservative, well-anchored patterns for Azure and GCP SA keys to _CREDENTIAL_PATTERNS (and/or the structured detectors alongside it), wired to the same reason codes the existing patterns use (secret_exfiltration for clear external exfil, sensitive_secret_access for local reads).
We never claim secret detection is airtight — it's defense-in-depth. So:
tests/unit)AccountName=) must not trip.Use fixtures — no real secrets, no network.
Self-contained, pattern-shaped work in one file — and you'll learn how Doberman balances detection against false positives and the redaction invariant.
Ticket changed by: fu351