Part 5 recap · Coverage
Coverage: the short version
Catch each copy where it lands. Then make every copy useless.
Take the full lesson Part 6 recap: Logs and public assets
Where the copies were caught
Issued by the payment service two years ago, then 6 copies:
- Sam’s laptop, stopped before the commit
- Priya’s pull request
- An old commit in Git history
- #checkout-dev in Slack
- A Jenkins build log
- A Confluence runbook
The day, step by step
- Meet the plan · 8:30 AM Meet the plan.
- Deploy the scanners · 9:00 AM Two scanners: one hosted, one in the data center.
- Pre-commit hook · 9:40 AM The pre-commit hook stops the key on the laptop.
- CI check · 10:30 AM The CI check fails Priya’s pull request.
- Git history · 11:30 AM A full scan finds a key deleted two years ago.
- Slack · 1:15 PM A pasted key in Slack is flagged.
- Builds, docs, and tickets · 2:00 PM Two more copies, outside the code.
- Detect · 2:30 PM Six catches, one alert.
- Verify · 2:32 PM Is it still live?
- Analyze and notify · 2:45 PM The right owner gets the alert.
- Rotate · 3:30 PM Swap in a new key.
- Confirm · 3:45 PM Confirmed: the old key is dead.
How it ended
Swap in a new key. The six caught copies, and any copy nobody caught, stop working at once.
Confirmed: the old key is dead. Each layer caught a copy. Rotation made all of them useless, including the ones no layer saw.
Try it with TruffleHog open source
Install TruffleHog first; its README lists the options. Run these only on folders, images and buckets you’re allowed to scan.
-
Laptop. Runs on each commit through Git hooks, the pre-commit framework, or Husky.
trufflehog git file://. --since-commit HEAD --fail -
Pull request. Runs in GitHub Actions, GitLab CI, Jenkins, CircleCI, and other pipelines, and fails the build.
trufflehog git file://. --since-commit main --branch HEAD --results=verified,unknown --fail -
History. Scans a repository or an organization’s full history when someone runs it, including some deleted and hidden GitHub commits.
trufflehog github --org=acme-example
Keep going
- Try TruffleHog open source Scan a repository or a folder on your laptop.
- See TruffleHog Enterprise Continuous scanning, routing to owners, and re-checks.
- Talk to the team Ask how this would work in your environment.