TruffleHog scans repositories, filesystems, chats, and cloud storage for machine credentials. It classifies findings and can test whether secrets still work.
Overview
TruffleHog searches many data sources for credentials such as API keys, database passwords, and private keys. Supported inputs named in the documentation include Git and GitHub, GitLab, Docker images, local files, object stores, CI systems, Postman workspaces, and more.
Detected strings are classified into hundreds of secret types so operators can see which service each key belongs to. Where supported, verification calls the provider APIs to mark secrets as active, inactive, or inconclusive because of network errors.
Deeper analysis can enumerate permissions and accessible resources for common credential classes. Output formats include JSON and SARIF for CI uploads, and a GitHub Action plus pre-commit hook integrate scans into developer workflows.
Operators can define custom regex detectors and multi-source jobs through a configuration file. Local Git scans clone to a temporary path by default to reduce risk from malicious repository settings, with flags to customize that behavior on trusted copies.
Key features
- Scans Git, GitHub, and GitLab sources
- Classifies hundreds of secret types
- Live API verification of credentials
- Docker image and S3 bucket scanning
- Filesystem and stdin input modes
- JSON and SARIF report formats
- GitHub Action and pre-commit hook
- Custom regex detectors via config
Use cases
- Hunting leaked keys in a monorepo
- CI gates on verified credential findings
- Auditing object storage buckets
- Reviewing pull request diffs for secrets
- Enumerating permissions on exposed API keys