Using Trufflehog - SethBodine/audit-tools GitHub Wiki

Using Trufflehog

Trufflehog is a secrets scanner that searches for leaked credentials, API keys, tokens, and other sensitive strings. It scans Git repositories, filesystems, S3 buckets, container images, CI/CD systems, and more. It uses both pattern matching and entropy analysis to detect secrets, and includes verified detection against live APIs where possible.

  • Scans Git repos, filesystems, S3, GCS, container images, and CI systems
  • Detects 800+ credential types including AWS, GCP, Azure, GitHub, Slack, and more
  • Verifies secrets against live APIs to reduce false positives
  • Outputs to table and JSON

Prepare the Environment

No setup required. Run from the shell.

Gather Data

Local Filesystem

trufflehog filesystem <path>
trufflehog filesystem . --json > /output/trufflehog-results.json

Git Repository (local)

trufflehog git file:///<path-to-repo>
trufflehog git file:///. --since-commit HEAD~10   # last 10 commits only

Git Repository (remote)

trufflehog git https://github.com/<org>/<repo>

GitHub Organisation (all repos)

trufflehog github --org <org-name> --token <github-token>

Container Image

trufflehog docker --image <image-name>:<tag>

S3 Bucket

trufflehog s3 --bucket <bucket-name>

Only Report Verified Secrets

trufflehog filesystem . --only-verified

Known Issues

TBC

Additional Information

⚠️ **GitHub.com Fallback** ⚠️