Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
TruffleHog finds exposed credentials across code, cloud storage, and collaboration tools, and then calls the provider to check whether each one still works — turning a long list into a short one.

What Is TruffleHog?
TruffleHog searches for secrets that have escaped into places they should not be: git history, filesystems, container images, S3 and Google Cloud Storage buckets, Jira, Confluence, Postman collections, Slack, and continuous integration logs. Its distinguishing feature is what happens after a match. For hundreds of credential types it calls the provider’s own API to establish whether the credential is still valid.
That single capability changes the economics of secret scanning. A conventional scanner returns two thousand pattern matches of unknown status. TruffleHog returns the eleven that work.
Each detector knows how to test its credential type: an AWS key against a harmless identity call, a GitHub token against the user endpoint, a Stripe key against an account lookup. The result is verified, unverified, or an error if the check could not complete.
trufflehog git file://. --only-verified --json
trufflehog github --org=acme --only-verified --include-members
trufflehog docker --image=acme/api:1.4.2 --only-verified
Run with --only-verified and the output is an incident list rather than a backlog. Everything on it is an active credential that an attacker who finds the same code can use immediately.
Two caveats are worth stating. Verification generates authentication attempts against third-party services, which may appear in audit logs and, in volume, may trip rate limits — tell your own security team before the first organisation-wide scan, or they will investigate it. And a credential marked unverified is not necessarily safe: it may be for a provider without a detector, an internal system, or an account temporarily disabled.
Repositories are the obvious target and not the only one. Credentials leak into container image layers, build logs, exported Postman collections, Jira tickets describing an integration, wiki pages written during an incident, and object storage buckets holding backups. TruffleHog has sources for most of these, and scanning the non-obvious ones usually produces the more alarming findings.
Scale matters here. Truffle Security published research in December 2024 reporting that a scan of a single Common Crawl archive of the public web surfaced roughly 12,000 live API keys and passwords — a reminder that “it is only in an internal repository” is a weaker statement than it sounds once code moves between systems.
Order matters, and the instinct to clean up the git history first is wrong.
git filter-repo or BFG, accepting that forks, clones, and cached refs may retain it.They are complements more than competitors. Gitleaks is lighter, faster across very large histories, and simple to extend with regular expressions for your own internal token formats, which makes it the better fit for a pre-commit hook and for every pull request. TruffleHog’s verification is what you want for scheduled sweeps across the whole organisation and for triaging an exposure quickly during an incident.
Neither removes the need for the control that actually prevents the problem: credentials should not exist in code at all. A secrets manager, short-lived credentials issued by workload identity, and platform push protection address the cause. Scanning finds what those controls have already missed, which is why it belongs in the routine rather than as a one-off exercise.
At Privia Security, we search for exposed credentials across public code, infrastructure, and third-party platforms as part of our penetration test services.
For each supported credential type, TruffleHog makes a harmless authenticated call to the provider’s API to see whether the credential still works. A verified result means an active key that anyone finding the same code could use right now. This collapses triage from thousands of uncertain pattern matches to a handful of confirmed incidents, which is the main reason teams adopt the tool.
The checks are read-only identity calls and do not modify anything, but they do generate authentication events in the provider’s audit logs and can hit rate limits during a large scan. Warn your own detection team before the first organisation-wide run, or the sudden burst of authentication attempts from an unfamiliar source will be investigated as an attack.
Use both for different jobs. Gitleaks is fast, easily extended with custom regular expressions, and well suited to pre-commit hooks and per-pull-request scanning where speed matters. TruffleHog verifies whether findings are live, which makes it the better choice for scheduled sweeps across an organisation and for rapid triage when you need to know what is actually exploitable.
Revoke it at the provider. Nothing else reduces risk, and every other step can follow. Then issue a replacement through a secrets manager, review the provider’s logs for use between exposure and revocation, assess whether personal data was reachable and therefore whether the ICO must be notified within 72 hours, and only then deal with removing it from the repository history.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.