{"id":13416677,"url":"https://github.com/trufflesecurity/trufflehog","last_synced_at":"2026-04-02T02:08:44.011Z","repository":{"id":37073748,"uuid":"77726177","full_name":"trufflesecurity/trufflehog","owner":"trufflesecurity","description":"Find, verify, and analyze leaked credentials","archived":false,"fork":false,"pushed_at":"2026-02-16T22:45:38.000Z","size":46355,"stargazers_count":24584,"open_issues_count":366,"forks_count":2225,"subscribers_count":198,"default_branch":"main","last_synced_at":"2026-02-17T08:30:15.702Z","etag":null,"topics":["credentials","devsecops","dynamic-analysis","precommit","scanning","secret","secret-management","secrets","security","security-tools","trufflehog","verification"],"latest_commit_sha":null,"homepage":"https://trufflesecurity.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trufflesecurity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-12-31T05:08:12.000Z","updated_at":"2026-02-17T03:24:08.000Z","dependencies_parsed_at":"2023-01-04T15:05:38.870Z","dependency_job_id":"7da0c9da-fe55-478e-8970-479ef2197fa2","html_url":"https://github.com/trufflesecurity/trufflehog","commit_stats":{"total_commits":2704,"total_committers":106,"mean_commits":25.50943396226415,"dds":0.8298816568047337,"last_synced_commit":"f209b04d5d24b3a0f10a61bd7d43930b3a917e84"},"previous_names":["dxa4481/trufflehog"],"tags_count":335,"template":false,"template_full_name":null,"purl":"pkg:github/trufflesecurity/trufflehog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trufflesecurity%2Ftrufflehog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trufflesecurity%2Ftrufflehog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trufflesecurity%2Ftrufflehog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trufflesecurity%2Ftrufflehog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trufflesecurity","download_url":"https://codeload.github.com/trufflesecurity/trufflehog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trufflesecurity%2Ftrufflehog/sbom","scorecard":{"id":361769,"data":{"date":"2025-08-11","repo":{"name":"github.com/trufflesecurity/trufflehog","commit":"72e4106a9cfbb2ec25aed0d1f5b08792d8af14b6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":7.2,"checks":[{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Security-Policy","score":9,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Info: jobLevel 'actions' permission set to 'read': .github/workflows/detector-tests.yml:13","Info: jobLevel 'contents' permission set to 'read': .github/workflows/detector-tests.yml:14","Info: jobLevel 'actions' permission set to 'read': .github/workflows/test.yml:16","Info: jobLevel 'contents' permission set to 'read': .github/workflows/test.yml:17","Info: jobLevel 'actions' permission set to 'read': .github/workflows/test.yml:59","Info: jobLevel 'contents' permission set to 'read': .github/workflows/test.yml:60","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/detector-tests.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/lint.yml:10","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/lint.yml:11","Warn: no topLevel permission defined: .github/workflows/performance.yml:1","Warn: topLevel 'packages' permission set to 'write': .github/workflows/release.yml:10","Warn: topLevel 'contents' permission set to 'write': .github/workflows/release.yml:9","Warn: no topLevel permission defined: .github/workflows/secrets.yml:1","Warn: no topLevel permission defined: .github/workflows/smoke.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Affero General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: pkg/decoders/utf16_test.dll:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Branch-Protection","score":6,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Warn: required approving review count is 1 on branch 'main'","Warn: codeowners review is not required on branch 'main'","Warn: no status checks found to merge onto branch 'main'","Info: PRs are required in order to make changes on branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":8,"reason":"5 out of the last 5 releases have a total of 5 signed artifacts.","details":["Info: signed release artifact: trufflehog_3.90.5_checksums.txt.sig: https://github.com/trufflesecurity/trufflehog/releases/tag/v3.90.5","Info: signed release artifact: trufflehog_3.90.4_checksums.txt.sig: https://github.com/trufflesecurity/trufflehog/releases/tag/v3.90.4","Info: signed release artifact: trufflehog_3.90.3_checksums.txt.sig: https://github.com/trufflesecurity/trufflehog/releases/tag/v3.90.3","Info: signed release artifact: trufflehog_3.90.2_checksums.txt.sig: https://github.com/trufflesecurity/trufflehog/releases/tag/v3.90.2","Info: signed release artifact: trufflehog_3.90.1_checksums.txt.sig: https://github.com/trufflesecurity/trufflehog/releases/tag/v3.90.1","Warn: release artifact v3.90.5 does not have provenance: https://api.github.com/repos/trufflesecurity/trufflehog/releases/240091603","Warn: release artifact v3.90.4 does not have provenance: https://api.github.com/repos/trufflesecurity/trufflehog/releases/239729206","Warn: release artifact v3.90.3 does not have provenance: https://api.github.com/repos/trufflesecurity/trufflehog/releases/237345310","Warn: release artifact v3.90.2 does not have provenance: https://api.github.com/repos/trufflesecurity/trufflehog/releases/234804089","Warn: release artifact v3.90.1 does not have provenance: https://api.github.com/repos/trufflesecurity/trufflehog/releases/233535589"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:14"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/detector-tests.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/detector-tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/detector-tests.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/detector-tests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/detector-tests.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/detector-tests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/detector-tests.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/detector-tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/lint.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/performance.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/performance.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/performance.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/performance.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/performance.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/performance.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/secrets.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/secrets.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/smoke.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/smoke.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/smoke.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/smoke.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/trufflesecurity/trufflehog/test.yml/main?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1","Warn: containerImage not pinned by hash: Dockerfile:11: pin your Docker image by updating alpine:3.22 to alpine:3.22@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Warn: containerImage not pinned by hash: Dockerfile.goreleaser:1: pin your Docker image by updating alpine:3.22 to alpine:3.22@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Warn: containerImage not pinned by hash: hack/Dockerfile.protos:3: pin your Docker image by updating golang:1.24-bullseye to golang:1.24-bullseye@sha256:2cdc80dc25edcb96ada1654f73092f2928045d037581fa4aa7c40d18af7dd85a","Warn: pipCommand not pinned by hash: hack/Dockerfile.protos:21","Warn: goCommand not pinned by hash: hack/Dockerfile.protos:29","Warn: goCommand not pinned by hash: .github/workflows/test.yml:33","Info:   0 out of  23 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of  11 third-party GitHubAction dependencies pinned","Info:   1 out of   3 goCommand dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned","Info:   0 out of   4 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (30) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T11:00:57.654Z","repository_id":37073748,"created_at":"2025-08-18T11:00:57.655Z","updated_at":"2025-08-18T11:00:57.655Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29621903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["credentials","devsecops","dynamic-analysis","precommit","scanning","secret","secret-management","secrets","security","security-tools","trufflehog","verification"],"created_at":"2024-07-30T22:00:19.454Z","updated_at":"2026-04-02T02:08:43.992Z","avatar_url":"https://github.com/trufflesecurity.png","language":"Go","funding_links":[],"categories":["Popular","Go","git","DevSecOps","security-tools","By Industry","Code Security","Applications","Application Security","扫描器、资产收集、子域名","Catalog","📋 Table of Contents","Secrets Management","Credits","文章","Tools","Repos","Weapons","🔑 Secrets and Data Leakage","安全扫描","security","Repositories","Security","Backend \u0026 Infrastructure","漏洞扫描","Companion Tools","Secrets Scanning","Security \u0026 Compliance","🔒 Security \u0026 Privacy","Security and Supply Chain","Security Scanning","Pre-commit \u0026 Secrets Detection","Secret Management","0x02 工具 :hammer_and_wrench:"],"sub_categories":["Security","Secrets Detection","Cyber Security (_built with Bubble Tea_)","Secrets detection","网络服务_其他","security","Open Source Secrets Detection","Secret Scanning","No-Code AI App Builders","Code scanning","Tools","Prevention Tools","Professional Security","Auth \u0026 Security","Kubernetes Audit","Streaming Operations","Secrets Management Tools","Secret Detection","Other tools","1 云服务工具"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"GoReleaser Logo\" src=\"https://storage.googleapis.com/trufflehog-static-sources/pixel_pig.png\" height=\"140\" /\u003e\n  \u003ch2 align=\"center\"\u003eTruffleHog\u003c/h2\u003e\n  \u003cp align=\"center\"\u003eFind leaked credentials.\u003c/p\u003e\n\u003c/p\u003e\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/trufflesecurity/trufflehog/v3)](https://goreportcard.com/report/github.com/trufflesecurity/trufflehog/v3)\n[![License](https://img.shields.io/badge/license-AGPL--3.0-brightgreen)](/LICENSE)\n[![Total Detectors](https://img.shields.io/github/directory-file-count/trufflesecurity/truffleHog/pkg/detectors?label=Total%20Detectors\u0026type=dir)](/pkg/detectors)\n\n\u003c/div\u003e\n\n---\n\n# :mag_right: _Now Scanning_\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/scanning_logos.svg\"\u003e\n\n**...and more**\n\nTo learn more about TruffleHog and its features and capabilities, visit our [product page](https://trufflesecurity.com/trufflehog?gclid=CjwKCAjwouexBhAuEiwAtW_Zx5IW87JNj97Ci7heFnA5ar6-DuNzT2Y5nIl9DuZ-FOUqx0Qg3vb9nxoClcEQAvD_BwE).\n\n\u003c/div\u003e\n\n# :globe_with_meridians: TruffleHog Enterprise\n\nAre you interested in continuously monitoring **Git, Jira, Slack, Confluence, Microsoft Teams, Sharepoint (and more)** for credentials? We have an enterprise product that can help! Learn more at \u003chttps://trufflesecurity.com/trufflehog-enterprise\u003e.\n\nWe take the revenue from the enterprise product to fund more awesome open source projects that the whole community can benefit from.\n\n\u003c/div\u003e\n\n# What is TruffleHog 🐽\n\nTruffleHog is the most powerful secrets **Discovery, Classification, Validation,** and **Analysis** tool. In this context, secret refers to a credential a machine uses to authenticate itself to another machine. This includes API keys, database passwords, private encryption keys, and more.\n\n## Discovery 🔍\n\nTruffleHog can look for secrets in many places including Git, chats, wikis, logs, API testing platforms, object stores, filesystems and more.\n\n## Classification 📁\n\nTruffleHog classifies over 800 secret types, mapping them back to the specific identity they belong to. Is it an AWS secret? Stripe secret? Cloudflare secret? Postgres password? SSL Private key? Sometimes it's hard to tell looking at it, so TruffleHog classifies everything it finds.\n\n## Validation ✅\n\nFor every secret TruffleHog can classify, it can also log in to confirm if that secret is live or not. This step is critical to know if there’s an active present danger or not.\n\n## Analysis 🔬\n\nFor the 20 some of the most commonly leaked out credential types, instead of sending one request to check if the secret can log in, TruffleHog can send many requests to learn everything there is to know about the secret. Who created it? What resources can it access? What permissions does it have on those resources?\n\n# :loudspeaker: Join Our Community\n\nHave questions? Feedback? Jump into Slack or Discord and hang out with us.\n\nJoin our [Slack Community](https://join.slack.com/t/trufflehog-community/shared_invite/zt-pw2qbi43-Aa86hkiimstfdKH9UCpPzQ)\n\nJoin the [Secret Scanning Discord](https://discord.gg/8Hzbrnkr7E)\n\n# :tv: Demo\n\n![GitHub scanning demo](https://storage.googleapis.com/truffle-demos/non-interactive.svg)\n\n```bash\ndocker run --rm -it -v \"$PWD:/pwd\" trufflesecurity/trufflehog:latest github --org=trufflesecurity\n```\n\n# :floppy_disk: Installation\n\nSeveral options are available for you:\n\n### MacOS users\n\n```bash\nbrew install trufflehog\n```\n\n### Docker:\n\n\u003csub\u003e\u003ci\u003e_Ensure Docker engine is running before executing the following commands:_\u003c/i\u003e\u003c/sub\u003e\n\n#### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Unix\n\n```bash\ndocker run --rm -it -v \"$PWD:/pwd\" trufflesecurity/trufflehog:latest github --repo https://github.com/trufflesecurity/test_keys\n```\n\n#### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Windows Command Prompt\n\n```bash\ndocker run --rm -it -v \"%cd:/=\\%:/pwd\" trufflesecurity/trufflehog:latest github --repo https://github.com/trufflesecurity/test_keys\n```\n\n#### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Windows PowerShell\n\n```bash\ndocker run --rm -it -v \"${PWD}:/pwd\" trufflesecurity/trufflehog github --repo https://github.com/trufflesecurity/test_keys\n```\n\n#### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;M1 and M2 Mac\n\n```bash\ndocker run --platform linux/arm64 --rm -it -v \"$PWD:/pwd\" trufflesecurity/trufflehog:latest github --repo https://github.com/trufflesecurity/test_keys\n```\n\n### Binary releases\n\n```bash\nDownload and unpack from https://github.com/trufflesecurity/trufflehog/releases\n```\n\n### Compile from source\n\n```bash\ngit clone https://github.com/trufflesecurity/trufflehog.git\ncd trufflehog; go install\n```\n\n### Using installation script\n\n```bash\ncurl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin\n```\n\n### Using installation script, verify checksum signature (requires cosign to be installed)\n\n```bash\ncurl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -v -b /usr/local/bin\n```\n\n### Using installation script to install a specific version\n\n```bash\ncurl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin \u003cReleaseTag like v3.56.0\u003e\n```\n\n# :closed_lock_with_key: Verifying the artifacts\n\nChecksums are applied to all artifacts, and the resulting checksum file is signed using cosign.\n\nYou need the following tool to verify signature:\n\n- [Cosign](https://docs.sigstore.dev/cosign/system_config/installation/)\n\nVerification steps are as follows:\n\n1. Download the artifact files you want, and the following files from the [releases](https://github.com/trufflesecurity/trufflehog/releases) page.\n\n   - trufflehog\\_{version}\\_checksums.txt\n   - trufflehog\\_{version}\\_checksums.txt.pem\n   - trufflehog\\_{version}\\_checksums.txt.sig\n\n2. Verify the signature:\n\n   ```shell\n   cosign verify-blob \u003cpath to trufflehog_{version}_checksums.txt\u003e \\\n   --certificate \u003cpath to trufflehog_{version}_checksums.txt.pem\u003e \\\n   --signature \u003cpath to trufflehog_{version}_checksums.txt.sig\u003e \\\n   --certificate-identity-regexp 'https://github\\.com/trufflesecurity/trufflehog/\\.github/workflows/.+' \\\n   --certificate-oidc-issuer \"https://token.actions.githubusercontent.com\"\n   ```\n\n3. Once the signature is confirmed as valid, you can proceed to validate that the SHA256 sums align with the downloaded artifact:\n\n   ```shell\n   sha256sum --ignore-missing -c trufflehog_{version}_checksums.txt\n   ```\n\nReplace `{version}` with the downloaded files version\n\nAlternatively, if you are using the installation script, pass `-v` option to perform signature verification.\nThis requires Cosign binary to be installed prior to running the installation script.\n\n# :rocket: Quick Start\n\n## 1: Scan a repo for only verified secrets\n\nCommand:\n\n```bash\ntrufflehog git https://github.com/trufflesecurity/test_keys --results=verified\n```\n\nExpected output:\n\n```\n🐷🔑🐷  TruffleHog. Unearth your secrets. 🐷🔑🐷\n\nFound verified result 🐷🔑\nDetector Type: AWS\nDecoder Type: PLAIN\nRaw result: AKIAYVP4CIPPERUVIFXG\nLine: 4\nCommit: fbc14303ffbf8fb1c2c1914e8dda7d0121633aca\nFile: keys\nEmail: counter \u003ccounter@counters-MacBook-Air.local\u003e\nRepository: https://github.com/trufflesecurity/test_keys\nTimestamp: 2022-06-16 10:17:40 -0700 PDT\n...\n```\n\n## 2: Scan a GitHub Org for only verified secrets\n\n```bash\ntrufflehog github --org=trufflesecurity --results=verified\n```\n\n## 3: Scan a GitHub Repo for only verified secrets and get JSON output\n\nCommand:\n\n```bash\ntrufflehog git https://github.com/trufflesecurity/test_keys --results=verified --json\n```\n\nExpected output:\n\n```\n{\"SourceMetadata\":{\"Data\":{\"Git\":{\"commit\":\"fbc14303ffbf8fb1c2c1914e8dda7d0121633aca\",\"file\":\"keys\",\"email\":\"counter \\u003ccounter@counters-MacBook-Air.local\\u003e\",\"repository\":\"https://github.com/trufflesecurity/test_keys\",\"timestamp\":\"2022-06-16 10:17:40 -0700 PDT\",\"line\":4}}},\"SourceID\":0,\"SourceType\":16,\"SourceName\":\"trufflehog - git\",\"DetectorType\":2,\"DetectorName\":\"AWS\",\"DecoderName\":\"PLAIN\",\"Verified\":true,\"Raw\":\"AKIAYVP4CIPPERUVIFXG\",\"Redacted\":\"AKIAYVP4CIPPERUVIFXG\",\"ExtraData\":{\"account\":\"595918472158\",\"arn\":\"arn:aws:iam::595918472158:user/canarytokens.com@@mirux23ppyky6hx3l6vclmhnj\",\"user_id\":\"AIDAYVP4CIPPJ5M54LRCY\"},\"StructuredData\":null}\n...\n```\n\n## 4: Scan a GitHub Repo + its Issues and Pull Requests\n\n```bash\ntrufflehog github --repo=https://github.com/trufflesecurity/test_keys --issue-comments --pr-comments\n```\n\n## 5: Scan an S3 bucket for high-confidence results (verified + unknown)\n\n```bash\ntrufflehog s3 --bucket=\u003cbucket name\u003e --results=verified,unknown\n```\n\n## 6: Scan S3 buckets using IAM Roles\n\n```bash\ntrufflehog s3 --role-arn=\u003ciam role arn\u003e\n```\n\n## 7: Scan a Github Repo using SSH authentication in Docker\n\n```bash\ndocker run --rm -v \"$HOME/.ssh:/root/.ssh:ro\" trufflesecurity/trufflehog:latest git ssh://github.com/trufflesecurity/test_keys\n```\n\n## 8: Scan individual files or directories\n\n```bash\ntrufflehog filesystem path/to/file1.txt path/to/file2.txt path/to/dir\n```\n\n## 9: Scan a local git repo\n\nClone the git repo. For example [test keys](git@github.com:trufflesecurity/test_keys.git) repo.\n```bash\ngit clone git@github.com:trufflesecurity/test_keys.git\n```\n\nRun trufflehog from the parent directory (outside the git repo).\n```bash\ntrufflehog git file://test_keys --results=verified,unknown\n```\n\nTo guard against malicious git configs in local scanning (see CVE-2025-41390), TruffleHog clones local git repositories to a temporary directory prior to scanning. This follows [Git's security best practices](https://git-scm.com/docs/git#_security). If you want to specify a custom path to clone the repository to (instead of tmp), you can use the `--clone-path` flag. If you'd like to skip the local cloning process and scan the repository directly (only do this for trusted repos), you can use the `--trust-local-git-config` flag.\n\n## 10: Scan GCS buckets for only verified secrets\n\n```bash\ntrufflehog gcs --project-id=\u003cproject-ID\u003e --cloud-environment --results=verified\n```\n\n## 11: Scan a Docker image for only verified secrets\n\nUse the `--image` flag multiple times to scan multiple images.\n\n```bash\n# to scan from a remote registry\ntrufflehog docker --image trufflesecurity/secrets --results=verified\n\n# to scan from the local docker daemon\ntrufflehog docker --image docker://new_image:tag --results=verified\n\n# to scan from an image saved as a tarball\ntrufflehog docker --image file://path_to_image.tar --results=verified\n```\n\n## 12: Scan in CI\n\nSet the `--since-commit` flag to your default branch that people merge into (ex: \"main\"). Set the `--branch` flag to your PR's branch name (ex: \"feature-1\"). Depending on the CI/CD platform you use, this value can be pulled in dynamically (ex: [CIRCLE_BRANCH in Circle CI](https://circleci.com/docs/variables/) and [TRAVIS_PULL_REQUEST_BRANCH in Travis CI](https://docs.travis-ci.com/user/environment-variables/)). If the repo is cloned and the target branch is already checked out during the CI/CD workflow, then `--branch HEAD` should be sufficient. The `--fail` flag will return an 183 error code if valid credentials are found.\n\n```bash\ntrufflehog git file://. --since-commit main --branch feature-1 --results=verified,unknown --fail\n```\n\n## 13: Scan a Postman workspace\n\nUse the `--workspace-id`, `--collection-id`, `--environment` flags multiple times to scan multiple targets.\n\n```bash\ntrufflehog postman --token=\u003cpostman api token\u003e --workspace-id=\u003cworkspace id\u003e\n```\n\n## 14: Scan a Jenkins server\n\n```bash\ntrufflehog jenkins --url https://jenkins.example.com --username admin --password admin\n```\n\n## 15: Scan an Elasticsearch server\n\n### Scan a Local Cluster\n\nThere are two ways to authenticate to a local cluster with TruffleHog: (1) username and password, (2) service token.\n\n#### Connect to a local cluster with username and password\n\n```bash\ntrufflehog elasticsearch --nodes 192.168.14.3 192.168.14.4 --username truffle --password hog\n```\n\n#### Connect to a local cluster with a service token\n\n```bash\ntrufflehog elasticsearch --nodes 192.168.14.3 192.168.14.4 --service-token ‘AAEWVaWM...Rva2VuaSDZ’\n```\n\n### Scan an Elastic Cloud Cluster\n\nTo scan a cluster on Elastic Cloud, you’ll need a Cloud ID and API key.\n\n```bash\ntrufflehog elasticsearch \\\n  --cloud-id 'search-prod:dXMtY2Vx...YjM1ODNlOWFiZGRlNjI0NA==' \\\n  --api-key 'MlVtVjBZ...ZSYlduYnF1djh3NG5FQQ=='\n```\n\n## 16. Scan a GitHub Repository for Cross Fork Object References and Deleted Commits\n\nThe following command will enumerate deleted and hidden commits on a GitHub repository and then scan them for secrets. This is an alpha release feature.\n\n```bash\ntrufflehog github-experimental --repo https://github.com/\u003cUSER\u003e/\u003cREPO\u003e.git --object-discovery\n```\n\nIn addition to the normal TruffleHog output, the `--object-discovery` flag creates two files in a new `$HOME/.trufflehog` directory: `valid_hidden.txt` and `invalid.txt`. These are used to track state during commit enumeration, as well as to provide users with a complete list of all hidden and deleted commits (`valid_hidden.txt`). If you'd like to automatically remove these files after scanning, please add the flag `--delete-cached-data`.\n\n**Note**: Enumerating all valid commits on a repository using this method takes between 20 minutes and a few hours, depending on the size of your repository. We added a progress bar to keep you updated on how long the enumeration will take. The actual secret scanning runs extremely fast.\n\nFor more information on Cross Fork Object References, please [read our blog post](https://trufflesecurity.com/blog/anyone-can-access-deleted-and-private-repo-data-github).\n\n## 17. Scan Hugging Face\n\n### Scan a Hugging Face Model, Dataset or Space\n\n```bash\ntrufflehog huggingface --model \u003cmodel_id\u003e --space \u003cspace_id\u003e --dataset \u003cdataset_id\u003e\n```\n\n### Scan all Models, Datasets and Spaces belonging to a Hugging Face Organization or User\n\n```bash\ntrufflehog huggingface --org \u003corgname\u003e --user \u003cusername\u003e\n```\n\n(Optionally) When scanning an organization or user, you can skip an entire class of resources with `--skip-models`, `--skip-datasets`, `--skip-spaces` OR a particular resource with `--ignore-models \u003cmodel_id\u003e`, `--ignore-datasets \u003cdataset_id\u003e`, `--ignore-spaces \u003cspace_id\u003e`.\n\n### Scan Discussion and PR Comments\n\n```bash\ntrufflehog huggingface --model \u003cmodel_id\u003e --include-discussions --include-prs\n```\n\n## 18. Scan stdin Input\n\n```bash\naws s3 cp s3://example/gzipped/data.gz - | gunzip -c | trufflehog stdin\n```\n\n# :question: FAQ\n\n- All I see is `🐷🔑🐷  TruffleHog. Unearth your secrets. 🐷🔑🐷` and the program exits, what gives?\n  - That means no secrets were detected\n- Why is the scan taking a long time when I scan a GitHub org\n  - Unauthenticated GitHub scans have rate limits. To improve your rate limits, include the `--token` flag with a personal access token\n- It says a private key was verified, what does that mean?\n  - A verified result means TruffleHog confirmed the credential is valid by testing it against the service's API. For private keys, we've confirmed the key can be used live for SSH or SSL authentication. Check out our Driftwood blog post to learn more [Blog post](https://trufflesecurity.com/blog/driftwood-know-if-private-keys-are-sensitive/)\n- Is there an easy way to ignore specific secrets?\n  - If the scanned source [supports line numbers](https://github.com/trufflesecurity/trufflehog/blob/d6375ba92172fd830abb4247cca15e3176448c5d/pkg/engine/engine.go#L358-L365), then you can add a `trufflehog:ignore` comment on the line containing the secret to ignore that secrets.\n\n# :newspaper: What's new in v3?\n\nTruffleHog v3 is a complete rewrite in Go with many new powerful features.\n\n- We've **added over 700 credential detectors that support active verification against their respective APIs**.\n- We've also added native **support for scanning GitHub, GitLab, Docker, filesystems, S3, GCS, Circle CI and Travis CI**.\n- **Instantly verify private keys** against millions of github users and **billions** of TLS certificates using our [Driftwood](https://trufflesecurity.com/blog/driftwood) technology.\n- Scan binaries, documents, and other file formats\n- Available as a GitHub Action and a pre-commit hook\n\n## What is credential verification?\n\nFor every potential credential that is detected, we've painstakingly implemented programmatic verification against the API that we think it belongs to. Verification eliminates false positives and provides three result statuses:\n\n- **verified**: Credential confirmed as valid and active by API testing\n- **unverified**: Credential detected but not confirmed valid (may be invalid, expired, or verification disabled)  \n- **unknown**: Verification attempted but failed due to errors, such as a network or API failure\n\nFor example, the [AWS credential detector](pkg/detectors/aws/aws.go) performs a `GetCallerIdentity` API call against the AWS API to verify if an AWS credential is active.\n\n# :memo: Usage\n\nTruffleHog has a sub-command for each source of data that you may want to scan:\n\n- git\n- github\n- gitlab\n- docker\n- s3\n- filesystem (files and directories)\n- syslog\n- circleci\n- travisci\n- gcs (Google Cloud Storage)\n- postman\n- jenkins\n- elasticsearch\n- stdin\n- multi-scan\n\nEach subcommand can have options that you can see with the `--help` flag provided to the sub command:\n\n```\n$ trufflehog git --help\nusage: TruffleHog [\u003cflags\u003e] \u003ccommand\u003e [\u003cargs\u003e ...]\n\nTruffleHog is a tool for finding credentials.\n\n\nFlags:\n  -h, --[no-]help                Show context-sensitive help (also try --help-long and --help-man).\n      --log-level=0              Logging verbosity on a scale of 0 (info) to 5 (trace). Can be\n                                 disabled with \"-1\".\n      --[no-]profile             Enables profiling and sets a pprof and fgprof server on :18066.\n  -j, --[no-]json                Output in JSON format.\n      --[no-]json-legacy         Use the pre-v3.0 JSON format. Only works with git, gitlab,\n                                 and github sources.\n      --[no-]github-actions      Output in GitHub Actions format.\n      --concurrency=12           Number of concurrent workers.\n      --[no-]no-verification     Don't verify the results.\n      --results=RESULTS          Specifies which type(s) of results to output: verified (confirmed\n                                 valid by API), unknown (verification failed due to error),\n                                 unverified (detected but not verified), filtered_unverified\n                                 (unverified but would have been filtered out). Defaults to\n                                 verified,unverified,unknown.\n      --[no-]no-color            Disable colorized output\n      --[no-]allow-verification-overlap\n                                 Allow verification of similar credentials across detectors\n      --[no-]filter-unverified   Only output first unverified result per chunk per detector if there\n                                 are more than one results.\n      --filter-entropy=FILTER-ENTROPY\n                                 Filter unverified results with Shannon entropy. Start with 3.0.\n      --config=CONFIG            Path to configuration file.\n      --[no-]print-avg-detector-time\n                                 Print the average time spent on each detector.\n      --[no-]no-update           Don't check for updates.\n      --[no-]fail                Exit with code 183 if results are found.\n      --[no-]fail-on-scan-errors\n                                 Exit with non-zero error code if an error occurs during the scan.\n      --verifier=VERIFIER ...    Set custom verification endpoints.\n      --[no-]custom-verifiers-only\n                                 Only use custom verification endpoints.\n      --detector-timeout=DETECTOR-TIMEOUT\n                                 Maximum time to spend scanning chunks per detector (e.g., 30s).\n      --archive-max-size=ARCHIVE-MAX-SIZE\n                                 Maximum size of archive to scan. (Byte units eg. 512B, 2KB, 4MB)\n      --archive-max-depth=ARCHIVE-MAX-DEPTH\n                                 Maximum depth of archive to scan.\n      --archive-timeout=ARCHIVE-TIMEOUT\n                                 Maximum time to spend extracting an archive.\n      --include-detectors=\"all\"  Comma separated list of detector types to include. Protobuf name or\n                                 IDs may be used, as well as ranges.\n      --exclude-detectors=EXCLUDE-DETECTORS\n                                 Comma separated list of detector types to exclude. Protobuf name\n                                 or IDs may be used, as well as ranges. IDs defined here take\n                                 precedence over the include list.\n      --[no-]no-verification-cache\n                                 Disable verification caching\n      --[no-]force-skip-binaries\n                                 Force skipping binaries.\n      --[no-]force-skip-archives\n                                 Force skipping archives.\n      --[no-]skip-additional-refs\n                                 Skip additional references.\n      --user-agent-suffix=USER-AGENT-SUFFIX\n                                 Suffix to add to User-Agent.\n      --[no-]version             Show application version.\n\nCommands:\nhelp [\u003ccommand\u003e...]\n    Show help.\n\ngit [\u003cflags\u003e] \u003curi\u003e\n\n    Find credentials in git repositories.\n\ngithub [\u003cflags\u003e]\n    Find credentials in GitHub repositories.\n\ngithub-experimental --repo=REPO [\u003cflags\u003e]\n    Run an experimental GitHub scan. Must specify at least one experimental sub-module to run:\n    object-discovery.\n\ngitlab --token=TOKEN [\u003cflags\u003e]\n    Find credentials in GitLab repositories.\n\nfilesystem [\u003cflags\u003e] [\u003cpath\u003e...]\n    Find credentials in a filesystem.\n\ns3 [\u003cflags\u003e]\n    Find credentials in S3 buckets.\n\ngcs [\u003cflags\u003e]\n    Find credentials in GCS buckets.\n\nsyslog --format=FORMAT [\u003cflags\u003e]\n    Scan syslog\n\ncircleci --token=TOKEN\n    Scan CircleCI\n\ndocker [\u003cflags\u003e]\n    Scan Docker Image\n\n\ntravisci --token=TOKEN\n    Scan TravisCI\n\npostman [\u003cflags\u003e]\n    Scan Postman\n\nelasticsearch [\u003cflags\u003e]\n    Scan Elasticsearch\n\njenkins --url=URL [\u003cflags\u003e]\n    Scan Jenkins\n\nhuggingface [\u003cflags\u003e]\n    Find credentials in HuggingFace datasets, models and spaces.\n\nstdin\n    Find credentials from stdin.\n\nmulti-scan\n    Find credentials in multiple sources defined in configuration.\n\njson-enumerator [\u003cpath\u003e...]\n    Find credentials from a JSON enumerator input.\n\nanalyze\n    Analyze API keys for fine-grained permissions information.\n```\n\nFor example, to scan a `git` repository, start with\n\n```\ntrufflehog git https://github.com/trufflesecurity/trufflehog.git\n```\n\n## Configuration\n\nTruffleHog supports defining [custom regex detectors](#custom-regex-detector-alpha)\nand multiple sources in a configuration file provided via the `--config` flag.\nThe regex detectors can be used with any subcommand, while the sources defined\nin configuration are only for the `multi-scan` subcommand.\n\nThe configuration format for sources can be found on Truffle Security's\n[source configuration documentation page](https://docs.trufflesecurity.com/scan-data-for-secrets).\n\nExample GitHub source configuration and [options reference](https://docs.trufflesecurity.com/github#Fvm1I):\n\n```yaml\nsources:\n- connection:\n    '@type': type.googleapis.com/sources.GitHub\n    repositories:\n    - https://github.com/trufflesecurity/test_keys.git\n    unauthenticated: {}\n  name: example config scan\n  type: SOURCE_TYPE_GITHUB\n  verify: true\n```\n\nYou may define multiple connections under the `sources` key (see above), and\nTruffleHog will scan all of the sources concurrently.\n\n## S3\n\nThe S3 source supports assuming IAM roles for scanning in addition to IAM users. This makes it easier for users to scan multiple AWS accounts without needing to rely on hardcoded credentials for each account.\n\nThe IAM identity that TruffleHog uses initially will need to have `AssumeRole` privileges as a principal in the [trust policy](https://aws.amazon.com/blogs/security/how-to-use-trust-policies-with-iam-roles/) of each IAM role to assume.\n\nTo scan a specific bucket using locally set credentials or instance metadata if on an EC2 instance:\n\n```bash\ntrufflehog s3 --bucket=\u003cbucket-name\u003e\n```\n\nTo scan a specific bucket using an assumed role:\n\n```bash\ntrufflehog s3 --bucket=\u003cbucket-name\u003e --role-arn=\u003ciam-role-arn\u003e\n```\n\nMultiple roles can be passed as separate arguments. The following command will attempt to scan every bucket each role has permissions to list in the S3 API:\n\n```bash\ntrufflehog s3 --role-arn=\u003ciam-role-arn-1\u003e --role-arn=\u003ciam-role-arn-2\u003e\n```\n\nExit Codes:\n\n- 0: No errors and no results were found.\n- 1: An error was encountered. Sources may not have completed scans.\n- 183: No errors were encountered, but results were found. Will only be returned if `--fail` flag is used.\n\n## :octocat: TruffleHog Github Action\n\n### General Usage\n\n```\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Checkout code\n      uses: actions/checkout@v4\n      with:\n        fetch-depth: 0\n    - name: Secret Scanning\n      uses: trufflesecurity/trufflehog@main\n      with:\n        extra_args: --results=verified,unknown\n```\n\nIn the example config above, we're scanning for live secrets in all PRs and Pushes to `main`. Only code changes in the referenced commits are scanned. If you'd like to scan an entire branch, please see the \"Advanced Usage\" section below.\n\n### Shallow Cloning\n\nIf you're incorporating TruffleHog into a standalone workflow and aren't running any other CI/CD tooling alongside TruffleHog, then we recommend using [Shallow Cloning](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt) to speed up your workflow. Here's an example of how to do it:\n\n```\n...\n      - shell: bash\n        run: |\n          if [ \"${{ github.event_name }}\" == \"push\" ]; then\n            echo \"depth=$(($(jq length \u003c\u003c\u003c '${{ toJson(github.event.commits) }}') + 2))\" \u003e\u003e $GITHUB_ENV\n            echo \"branch=${{ github.ref_name }}\" \u003e\u003e $GITHUB_ENV\n          fi\n          if [ \"${{ github.event_name }}\" == \"pull_request\" ]; then\n            echo \"depth=$((${{ github.event.pull_request.commits }}+2))\" \u003e\u003e $GITHUB_ENV\n            echo \"branch=${{ github.event.pull_request.head.ref }}\" \u003e\u003e $GITHUB_ENV\n          fi\n      - uses: actions/checkout@v3\n        with:\n          ref: ${{env.branch}}\n          fetch-depth: ${{env.depth}}\n      - uses: trufflesecurity/trufflehog@main\n        with:\n          extra_args: --results=verified,unknown\n...\n```\n\nDepending on the event type (push or PR), we calculate the number of commits present. Then we add 2, so that we can reference a base commit before our code changes. We pass that integer value to the `fetch-depth` flag in the checkout action in addition to the relevant branch. Now our checkout process should be much shorter.\n\n### Canary detection\n\nTruffleHog statically detects [https://canarytokens.org/](https://canarytokens.org/).\n\n![image](https://github.com/trufflesecurity/trufflehog/assets/52866392/74ace530-08c5-4eaf-a169-84a73e328f6f)\n\n### Advanced Usage\n\n```yaml\n- name: TruffleHog\n  uses: trufflesecurity/trufflehog@main\n  with:\n    # Repository path\n    path:\n    # Start scanning from here (usually main branch).\n    base:\n    # Scan commits until here (usually dev branch).\n    head: # optional\n    # Extra args to be passed to the trufflehog cli.\n    extra_args: --log-level=2 --results=verified,unknown\n```\n\nIf you'd like to specify specific `base` and `head` refs, you can use the `base` argument (`--since-commit` flag in TruffleHog CLI) and the `head` argument (`--branch` flag in the TruffleHog CLI). We only recommend using these arguments for very specific use cases, where the default behavior does not work.\n\n#### Advanced Usage: Scan entire branch\n\n```\n- name: scan-push\n        uses: trufflesecurity/trufflehog@main\n        with:\n          base: \"\"\n          head: ${{ github.ref_name }}\n          extra_args: --results=verified,unknown\n```\n\n## TruffleHog GitLab CI\n\n### Example Usage\n\n```yaml\nstages:\n  - security\n\nsecurity-secrets:\n  stage: security\n  allow_failure: false\n  image: alpine:latest\n  variables:\n    SCAN_PATH: \".\" # Set the relative path in the repo to scan\n  before_script:\n    - apk add --no-cache git curl jq\n    - curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin\n  script:\n    - trufflehog filesystem \"$SCAN_PATH\" --results=verified,unknown --fail --json | jq\n  rules:\n    - if: '$CI_PIPELINE_SOURCE == \"merge_request_event\"'\n```\n\nIn the example pipeline above, we're scanning for live secrets in all repository directories and files. This job runs only when the pipeline source is a merge request event, meaning it's triggered when a new merge request is created.\n\n## Pre-commit Hook\n\nTruffleHog can be used in a pre-commit hook to prevent credentials from leaking before they ever leave your computer.\n\nSee the [pre-commit hook documentation](PreCommit.md) for more information.\n\n## Custom Regex Detector (alpha)\n\nTruffleHog supports detection and verification of custom regular expressions.\nFor detection, at least one **regular expression** and **keyword** is required.\nA **keyword** is a fixed literal string identifier that appears in or around\nthe regex to be detected. To allow maximum flexibility for verification, a\nwebhook is used containing the regular expression matches.\n\nTruffleHog will send a JSON POST request containing the regex matches to a\nconfigured webhook endpoint. If the endpoint responds with a `200 OK` response\nstatus code, the secret is considered verified. If verification fails due to network/API errors, the result is marked as unknown.\n\nCustom Detectors support a few different filtering mechanisms: entropy, regex targeting the entire match, regex targeting the captured secret,\nand excluded word lists checked against the secret (captured group if present, entire match if capture group is not present). Note that if\nyour custom detector has multiple `regex` set (in this example `hogID`, and `hogToken`), then the filters get applied to each regex. [Here](examples/generic_with_filters.yml) is an example of a custom detector using these filters.\n\n**NB:** This feature is alpha and subject to change.\n\n### Regex Detector Example\n[Here](/pkg/custom_detectors/CUSTOM_DETECTORS.md) is how to setup a custom regex detector with verification server.\n\n## Generic JWT Detection\n\nTruffleHog supports detection and verification of a subset of generic JWTs it finds.\nSpecifically, if a JWT uses public-key cryptography rather than HMAC and the public key can be obtained, TruffleHog can determine whether the JWT is live or not.\n\n## :mag: Analyze\n\nTruffleHog supports running a deeper analysis of a credential to view its permissions and the resources it has access to.\n\n```bash\ntrufflehog analyze\n```\n\n# :heart: Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\n\u003ca href=\"https://github.com/trufflesecurity/trufflehog/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=trufflesecurity/trufflehog\" /\u003e\n\u003c/a\u003e\n\n# :computer: Contributing\n\nContributions are very welcome! Please see our [contribution guidelines first](CONTRIBUTING.md).\n\nWe no longer accept contributions to TruffleHog v2, but that code is available in the `v2` branch.\n\n## Adding new secret detectors\n\nWe have published some [documentation and tooling to get started on adding new secret detectors](hack/docs/Adding_Detectors_external.md). Let's improve detection together!\n\n# Use as a library\n\nCurrently, trufflehog is in heavy development and no guarantees can be made on\nthe stability of the public APIs at this time.\n\n# License Change\n\nSince v3.0, TruffleHog is released under a AGPL 3 license, included in [`LICENSE`](LICENSE). TruffleHog v3.0 uses none of the previous codebase, but care was taken to preserve backwards compatibility on the command line interface. The work previous to this release is still available licensed under GPL 2.0 in the history of this repository and the previous package releases and tags. A completed CLA is required for us to accept contributions going forward.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrufflesecurity%2Ftrufflehog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrufflesecurity%2Ftrufflehog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrufflesecurity%2Ftrufflehog/lists"}