DEV Community

Yuhe He
Yuhe He

Posted on

Secret Scanning Production Notes: Triage, Liveness, and Reports That Get Paid

Secret-scanning a target's public footprint sounds simple: grep public code for key patterns, alert on new hits. The first production week will teach you that 90% of the work is after the grep - in triage, dedup, and the reporting discipline that keeps you out of trouble.

The operational details that separate a working monitor from an alert firehose:

1. Pattern quality beats pattern quantity. AKIA[0-9A-Z]{16} catches AWS access key IDs - but the ID alone is inert without the secret. Scanners that alert on IDs produce mostly noise (test fixtures, docs, blog posts). Pair every key format with its companion secret format (AWS secret access key = 40-char base64-ish, GitHub ghp_ = 36 chars, Telegram bot token = \d+:A[A-Za-z0-9_-]{34}) and alert strongest when both appear in one file. Precision goes up several-fold for free.

2. Exclude the known-cannibal repos. Popular seeded repos (framework boilerplates, tutorial code, the same five "spring-boot-microservices-demo" forks) contain the same fake keys in their .env.example files. Every scanner on earth hits them. Maintain a dead-man list of (repo, secret-hash) pairs that are permanently public noise; suppress them by key, not by repo, so real leaks in those repos still fire.

3. Verify liveness the legal way. A key in public code is a finding; a live key is an incident. For API keys with a free/cheap read-only status endpoint (many cloud providers have one), a single authenticated GET confirms liveness. Do not use a leaked key to do anything beyond the provider's own validation endpoint, and never beyond scope. The audit trail of a "verification" API call is your report's evidence line.

4. The git archaeology step. For each hit, record: repo creation date, commit author date, author email, whether the file is in HEAD or only in history (deleted in HEAD = remediated, and git log -p gives you the remediation date for free). "Leaked 14 months ago, deleted 13 months ago, key still live" is a stronger report than "found a key."

5. Report structure that gets bounties paid. Program scope first (one line: which asset, which program policy covers it), then: finding summary, exact location (repo, file, commit SHA), liveness evidence, remediation already done (deleted commit), remediation still needed (rotate the key), and a proposed severity with the program's own severity rubric. The rotation insight matters: a deleted-from-HEAD key is not safe - the git history serves it forever until rotated. State that; it's the part security teams most often miss and the part that makes your report respected.

6. Tempo discipline. A monitor that runs daily and reports weekly (batched, deduped) gets taken seriously; one that fires 30 reports a day gets muted. Batch by target, dedup by secret hash across the batch, report only net-new.

The full pattern catalog (with companion-secret pairings and liveness endpoints), the dead-man list, and the report template ship in the Telegram & Web OSINT Bundle ($5). Free sample brief shows the output format.

Runs free on GitHub Actions - no server, no paid APIs.

Top comments (0)