{
	"id": "bd2dc266-bd71-4e50-a13a-a50d07c60298",
	"created_at": "2026-04-06T00:14:04.303804Z",
	"updated_at": "2026-04-10T03:20:46.272877Z",
	"deleted_at": null,
	"sha1_hash": "700cc538c84f5e748c2df212ffd6d3b542c7cdf5",
	"title": "GitHub - trufflesecurity/trufflehog: Find, verify, and analyze leaked credentials",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 1064962,
	"plain_text": "GitHub - trufflesecurity/trufflehog: Find, verify, and analyze\r\nleaked credentials\r\nBy dipto-truffle\r\nArchived: 2026-04-05 18:58:51 UTC\r\nFind leaked credentials.\r\nggoo rreeppoorrtt A +\r\n lliicceennssee AAGGPPLL--33..00 TToottaall DDeetteeccttoorrss 866\r\n🔎 Now Scanning\r\n...and more\r\nTo learn more about TruffleHog and its features and capabilities, visit our product page.\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 1 of 20\n\n🌐 TruffleHog Enterprise\r\nAre you interested in continuously monitoring Git, Jira, Slack, Confluence, Microsoft Teams, Sharepoint (and\r\nmore) for credentials? We have an enterprise product that can help! Learn more at\r\nhttps://trufflesecurity.com/trufflehog-enterprise.\r\nWe take the revenue from the enterprise product to fund more awesome open source projects that the whole\r\ncommunity can benefit from.\r\nWhat is TruffleHog 🐽\r\nTruffleHog is the most powerful secrets Discovery, Classification, Validation, and Analysis tool. In this context,\r\nsecret refers to a credential a machine uses to authenticate itself to another machine. This includes API keys,\r\ndatabase passwords, private encryption keys, and more.\r\nDiscovery 🔍\r\nTruffleHog can look for secrets in many places including Git, chats, wikis, logs, API testing platforms, object\r\nstores, filesystems and more.\r\nClassification 📁\r\nTruffleHog classifies over 800 secret types, mapping them back to the specific identity they belong to. Is it an\r\nAWS secret? Stripe secret? Cloudflare secret? Postgres password? SSL Private key? Sometimes it's hard to tell\r\nlooking at it, so TruffleHog classifies everything it finds.\r\nValidation ✅\r\nFor every secret TruffleHog can classify, it can also log in to confirm if that secret is live or not. This step is\r\ncritical to know if there’s an active present danger or not.\r\nAnalysis 🔬\r\nFor the 20 some of the most commonly leaked out credential types, instead of sending one request to check if the\r\nsecret can log in, TruffleHog can send many requests to learn everything there is to know about the secret. Who\r\ncreated it? What resources can it access? What permissions does it have on those resources?\r\n📢 Join Our Community\r\nHave questions? Feedback? Jump into Slack or Discord and hang out with us.\r\nJoin our Slack Community\r\nJoin the Secret Scanning Discord\r\n📺 Demo\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 2 of 20\n\ndocker run --rm -it -v \"$PWD:/pwd\" trufflesecurity/trufflehog:latest github --org=trufflesecurity\r\n💾 Installation\r\nSeveral options are available for you:\r\nMacOS users\r\nDocker:\r\nEnsure Docker engine is running before executing the following commands:\r\n    Unix\r\ndocker run --rm -it -v \"$PWD:/pwd\" trufflesecurity/trufflehog:latest github --repo https://github.com\r\n    Windows Command Prompt\r\ndocker run --rm -it -v \"%cd:/=\\%:/pwd\" trufflesecurity/trufflehog:latest github --repo https://github\r\n    Windows PowerShell\r\ndocker run --rm -it -v \"${PWD}:/pwd\" trufflesecurity/trufflehog github --repo https://github.com/truf\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 3 of 20\n\nM1 and M2 Mac\r\ndocker run --platform linux/arm64 --rm -it -v \"$PWD:/pwd\" trufflesecurity/trufflehog:latest github --\r\nBinary releases\r\nDownload and unpack from https://github.com/trufflesecurity/trufflehog/releases\r\nCompile from source\r\ngit clone https://github.com/trufflesecurity/trufflehog.git\r\ncd trufflehog; go install\r\nUsing installation script\r\ncurl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh\r\nUsing installation script, verify checksum signature (requires cosign to be installed)\r\ncurl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh\r\nUsing installation script to install a specific version\r\ncurl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh\r\n🔐 Verifying the artifacts\r\nChecksums are applied to all artifacts, and the resulting checksum file is signed using cosign.\r\nYou need the following tool to verify signature:\r\nCosign\r\nVerification steps are as follows:\r\n1. Download the artifact files you want, and the following files from the releases page.\r\ntrufflehog_{version}_checksums.txt\r\ntrufflehog_{version}_checksums.txt.pem\r\ntrufflehog_{version}_checksums.txt.sig\r\n2. Verify the signature:\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 4 of 20\n\ncosign verify-blob \u003cpath to trufflehog_{version}_checksums.txt\u003e \\\r\n--certificate \u003cpath to trufflehog_{version}_checksums.txt.pem\u003e \\\r\n--signature \u003cpath to trufflehog_{version}_checksums.txt.sig\u003e \\\r\n--certificate-identity-regexp 'https://github\\.com/trufflesecurity/trufflehog/\\.github/workflo\r\n--certificate-oidc-issuer \"https://token.actions.githubusercontent.com\"\r\n3. Once the signature is confirmed as valid, you can proceed to validate that the SHA256 sums align with the\r\ndownloaded artifact:\r\nsha256sum --ignore-missing -c trufflehog_{version}_checksums.txt\r\nReplace {version} with the downloaded files version\r\nAlternatively, if you are using the installation script, pass -v option to perform signature verification. This\r\nrequires Cosign binary to be installed prior to running the installation script.\r\n🚀 Quick Start\r\n1: Scan a repo for only verified secrets\r\nCommand:\r\ntrufflehog git https://github.com/trufflesecurity/test_keys --results=verified\r\nExpected output:\r\n🐷🔑🐷 TruffleHog. Unearth your secrets. 🐷🔑🐷\r\nFound verified result 🐷🔑\r\nDetector Type: AWS\r\nDecoder Type: PLAIN\r\nRaw result: AKIAYVP4CIPPERUVIFXG\r\nLine: 4\r\nCommit: fbc14303ffbf8fb1c2c1914e8dda7d0121633aca\r\nFile: keys\r\nEmail: counter \u003ccounter@counters-MacBook-Air.local\u003e\r\nRepository: https://github.com/trufflesecurity/test_keys\r\nTimestamp: 2022-06-16 10:17:40 -0700 PDT\r\n...\r\n2: Scan a GitHub Org for only verified secrets\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 5 of 20\n\ntrufflehog github --org=trufflesecurity --results=verified\r\n3: Scan a GitHub Repo for only verified secrets and get JSON output\r\nCommand:\r\ntrufflehog git https://github.com/trufflesecurity/test_keys --results=verified --json\r\nExpected output:\r\n{\"SourceMetadata\":{\"Data\":{\"Git\":{\"commit\":\"fbc14303ffbf8fb1c2c1914e8dda7d0121633aca\",\"file\":\"keys\",\"email\":\"co\r\n...\r\n4: Scan a GitHub Repo + its Issues and Pull Requests\r\ntrufflehog github --repo=https://github.com/trufflesecurity/test_keys --issue-comments --pr-comments\r\n5: Scan an S3 bucket for high-confidence results (verified + unknown)\r\ntrufflehog s3 --bucket=\u003cbucket name\u003e --results=verified,unknown\r\n6: Scan S3 buckets using IAM Roles\r\ntrufflehog s3 --role-arn=\u003ciam role arn\u003e\r\n7: Scan a Github Repo using SSH authentication in Docker\r\ndocker run --rm -v \"$HOME/.ssh:/root/.ssh:ro\" trufflesecurity/trufflehog:latest git ssh://github.com/\r\n8: Scan individual files or directories\r\ntrufflehog filesystem path/to/file1.txt path/to/file2.txt path/to/dir\r\n9: Scan a local git repo\r\nClone the git repo. For example test keys repo.\r\ngit clone git@github.com:trufflesecurity/test_keys.git\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 6 of 20\n\nRun trufflehog from the parent directory (outside the git repo).\r\ntrufflehog git file://test_keys --results=verified,unknown\r\nTo guard against malicious git configs in local scanning (see CVE-2025-41390), TruffleHog clones local git\r\nrepositories to a temporary directory prior to scanning. This follows Git's security best practices. If you want to\r\nspecify a custom path to clone the repository to (instead of tmp), you can use the --clone-path flag. If you'd like\r\nto skip the local cloning process and scan the repository directly (only do this for trusted repos), you can use the -\r\n-trust-local-git-config flag.\r\n10: Scan GCS buckets for only verified secrets\r\ntrufflehog gcs --project-id=\u003cproject-ID\u003e --cloud-environment --results=verified\r\n11: Scan a Docker image for only verified secrets\r\nUse the --image flag multiple times to scan multiple images.\r\n# to scan from a remote registry\r\ntrufflehog docker --image trufflesecurity/secrets --results=verified\r\n# to scan from the local docker daemon\r\ntrufflehog docker --image docker://new_image:tag --results=verified\r\n# to scan from an image saved as a tarball\r\ntrufflehog docker --image file://path_to_image.tar --results=verified\r\n12: Scan in CI\r\nSet the --since-commit flag to your default branch that people merge into (ex: \"main\"). Set the --branch flag\r\nto your PR's branch name (ex: \"feature-1\"). Depending on the CI/CD platform you use, this value can be pulled in\r\ndynamically (ex: CIRCLE_BRANCH in Circle CI and TRAVIS_PULL_REQUEST_BRANCH in Travis CI). If\r\nthe repo is cloned and the target branch is already checked out during the CI/CD workflow, then --branch HEAD\r\nshould be sufficient. The --fail flag will return an 183 error code if valid credentials are found.\r\ntrufflehog git file://. --since-commit main --branch feature-1 --results=verified,unknown --fail\r\n13: Scan a Postman workspace\r\nUse the --workspace-id , --collection-id , --environment flags multiple times to scan multiple targets.\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 7 of 20\n\ntrufflehog postman --token=\u003cpostman api token\u003e --workspace-id=\u003cworkspace id\u003e\r\n14: Scan a Jenkins server\r\ntrufflehog jenkins --url https://jenkins.example.com --username admin --password admin\r\n15: Scan an Elasticsearch server\r\nScan a Local Cluster\r\nThere are two ways to authenticate to a local cluster with TruffleHog: (1) username and password, (2) service\r\ntoken.\r\nConnect to a local cluster with username and password\r\ntrufflehog elasticsearch --nodes 192.168.14.3 192.168.14.4 --username truffle --password hog\r\nConnect to a local cluster with a service token\r\ntrufflehog elasticsearch --nodes 192.168.14.3 192.168.14.4 --service-token ‘AAEWVaWM...Rva2VuaSDZ’\r\nScan an Elastic Cloud Cluster\r\nTo scan a cluster on Elastic Cloud, you’ll need a Cloud ID and API key.\r\ntrufflehog elasticsearch \\\r\n --cloud-id 'search-prod:dXMtY2Vx...YjM1ODNlOWFiZGRlNjI0NA==' \\\r\n --api-key 'MlVtVjBZ...ZSYlduYnF1djh3NG5FQQ=='\r\n16. Scan a GitHub Repository for Cross Fork Object References and Deleted\r\nCommits\r\nThe following command will enumerate deleted and hidden commits on a GitHub repository and then scan them\r\nfor secrets. This is an alpha release feature.\r\ntrufflehog github-experimental --repo https://github.com/\u003cUSER\u003e/\u003cREPO\u003e.git --object-discovery\r\nIn addition to the normal TruffleHog output, the --object-discovery flag creates two files in a new\r\n$HOME/.trufflehog directory: valid_hidden.txt and invalid.txt . These are used to track state during\r\ncommit enumeration, as well as to provide users with a complete list of all hidden and deleted commits\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 8 of 20\n\n( valid_hidden.txt ). If you'd like to automatically remove these files after scanning, please add the flag --\r\ndelete-cached-data .\r\nNote: Enumerating all valid commits on a repository using this method takes between 20 minutes and a few hours,\r\ndepending on the size of your repository. We added a progress bar to keep you updated on how long the\r\nenumeration will take. The actual secret scanning runs extremely fast.\r\nFor more information on Cross Fork Object References, please read our blog post.\r\n17. Scan Hugging Face\r\nScan a Hugging Face Model, Dataset or Space\r\ntrufflehog huggingface --model \u003cmodel_id\u003e --space \u003cspace_id\u003e --dataset \u003cdataset_id\u003e\r\nScan all Models, Datasets and Spaces belonging to a Hugging Face Organization or User\r\ntrufflehog huggingface --org \u003corgname\u003e --user \u003cusername\u003e\r\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 , --\r\nignore-datasets \u003cdataset_id\u003e , --ignore-spaces \u003cspace_id\u003e .\r\nScan Discussion and PR Comments\r\ntrufflehog huggingface --model \u003cmodel_id\u003e --include-discussions --include-prs\r\n18. Scan stdin Input\r\naws s3 cp s3://example/gzipped/data.gz - | gunzip -c | trufflehog stdin\r\n❓ FAQ\r\nAll I see is 🐷🔑🐷 TruffleHog. Unearth your secrets. 🐷🔑🐷 and the program exits, what gives?\r\nThat means no secrets were detected\r\nWhy is the scan taking a long time when I scan a GitHub org\r\nUnauthenticated GitHub scans have rate limits. To improve your rate limits, include the --token\r\nflag with a personal access token\r\nIt says a private key was verified, what does that mean?\r\nA verified result means TruffleHog confirmed the credential is valid by testing it against the\r\nservice's API. For private keys, we've confirmed the key can be used live for SSH or SSL\r\nauthentication. Check out our Driftwood blog post to learn more Blog post\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 9 of 20\n\nIs there an easy way to ignore specific secrets?\r\nIf the scanned source supports line numbers, then you can add a trufflehog:ignore comment on\r\nthe line containing the secret to ignore that secrets.\r\n📰 What's new in v3?\r\nTruffleHog v3 is a complete rewrite in Go with many new powerful features.\r\nWe've added over 700 credential detectors that support active verification against their respective\r\nAPIs.\r\nWe've also added native support for scanning GitHub, GitLab, Docker, filesystems, S3, GCS, Circle\r\nCI and Travis CI.\r\nInstantly verify private keys against millions of github users and billions of TLS certificates using our\r\nDriftwood technology.\r\nScan binaries, documents, and other file formats\r\nAvailable as a GitHub Action and a pre-commit hook\r\nWhat is credential verification?\r\nFor every potential credential that is detected, we've painstakingly implemented programmatic verification against\r\nthe API that we think it belongs to. Verification eliminates false positives and provides three result statuses:\r\nverified: Credential confirmed as valid and active by API testing\r\nunverified: Credential detected but not confirmed valid (may be invalid, expired, or verification disabled)\r\nunknown: Verification attempted but failed due to errors, such as a network or API failure\r\nFor example, the AWS credential detector performs a GetCallerIdentity API call against the AWS API to verify\r\nif an AWS credential is active.\r\n📝 Usage\r\nTruffleHog has a sub-command for each source of data that you may want to scan:\r\ngit\r\ngithub\r\ngitlab\r\ndocker\r\ns3\r\nfilesystem (files and directories)\r\nsyslog\r\ncircleci\r\ntravisci\r\ngcs (Google Cloud Storage)\r\npostman\r\njenkins\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 10 of 20\n\nelasticsearch\r\nstdin\r\nmulti-scan\r\nEach subcommand can have options that you can see with the --help flag provided to the sub command:\r\n$ trufflehog git --help\r\nusage: TruffleHog [\u003cflags\u003e] \u003ccommand\u003e [\u003cargs\u003e ...]\r\nTruffleHog is a tool for finding credentials.\r\nFlags:\r\n -h, --[no-]help Show context-sensitive help (also try --help-long and --help-man).\r\n --log-level=0 Logging verbosity on a scale of 0 (info) to 5 (trace). Can be\r\n disabled with \"-1\".\r\n --[no-]profile Enables profiling and sets a pprof and fgprof server on :18066.\r\n -j, --[no-]json Output in JSON format.\r\n --[no-]json-legacy Use the pre-v3.0 JSON format. Only works with git, gitlab,\r\n and github sources.\r\n --[no-]github-actions Output in GitHub Actions format.\r\n --concurrency=12 Number of concurrent workers.\r\n --[no-]no-verification Don't verify the results.\r\n --results=RESULTS Specifies which type(s) of results to output: verified (confirmed\r\n valid by API), unknown (verification failed due to error),\r\n unverified (detected but not verified), filtered_unverified\r\n (unverified but would have been filtered out). Defaults to\r\n verified,unverified,unknown.\r\n --[no-]no-color Disable colorized output\r\n --[no-]allow-verification-overlap\r\n Allow verification of similar credentials across detectors\r\n --[no-]filter-unverified Only output first unverified result per chunk per detector if there\r\n are more than one results.\r\n --filter-entropy=FILTER-ENTROPY\r\n Filter unverified results with Shannon entropy. Start with 3.0.\r\n --config=CONFIG Path to configuration file.\r\n --[no-]print-avg-detector-time\r\n Print the average time spent on each detector.\r\n --[no-]no-update Don't check for updates.\r\n --[no-]fail Exit with code 183 if results are found.\r\n --[no-]fail-on-scan-errors\r\n Exit with non-zero error code if an error occurs during the scan.\r\n --verifier=VERIFIER ... Set custom verification endpoints.\r\n --[no-]custom-verifiers-only\r\n Only use custom verification endpoints.\r\n --detector-timeout=DETECTOR-TIMEOUT\r\n Maximum time to spend scanning chunks per detector (e.g., 30s).\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 11 of 20\n\n--archive-max-size=ARCHIVE-MAX-SIZE\r\n Maximum size of archive to scan. (Byte units eg. 512B, 2KB, 4MB)\r\n --archive-max-depth=ARCHIVE-MAX-DEPTH\r\n Maximum depth of archive to scan.\r\n --archive-timeout=ARCHIVE-TIMEOUT\r\n Maximum time to spend extracting an archive.\r\n --include-detectors=\"all\" Comma separated list of detector types to include. Protobuf name or\r\n IDs may be used, as well as ranges.\r\n --exclude-detectors=EXCLUDE-DETECTORS\r\n Comma separated list of detector types to exclude. Protobuf name\r\n or IDs may be used, as well as ranges. IDs defined here take\r\n precedence over the include list.\r\n --[no-]no-verification-cache\r\n Disable verification caching\r\n --[no-]force-skip-binaries\r\n Force skipping binaries.\r\n --[no-]force-skip-archives\r\n Force skipping archives.\r\n --[no-]skip-additional-refs\r\n Skip additional references.\r\n --user-agent-suffix=USER-AGENT-SUFFIX\r\n Suffix to add to User-Agent.\r\n --[no-]version Show application version.\r\nCommands:\r\nhelp [\u003ccommand\u003e...]\r\n Show help.\r\ngit [\u003cflags\u003e] \u003curi\u003e\r\n Find credentials in git repositories.\r\ngithub [\u003cflags\u003e]\r\n Find credentials in GitHub repositories.\r\ngithub-experimental --repo=REPO [\u003cflags\u003e]\r\n Run an experimental GitHub scan. Must specify at least one experimental sub-module to run:\r\n object-discovery.\r\ngitlab --token=TOKEN [\u003cflags\u003e]\r\n Find credentials in GitLab repositories.\r\nfilesystem [\u003cflags\u003e] [\u003cpath\u003e...]\r\n Find credentials in a filesystem.\r\ns3 [\u003cflags\u003e]\r\n Find credentials in S3 buckets.\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 12 of 20\n\ngcs [\u003cflags\u003e]\r\n Find credentials in GCS buckets.\r\nsyslog --format=FORMAT [\u003cflags\u003e]\r\n Scan syslog\r\ncircleci --token=TOKEN\r\n Scan CircleCI\r\ndocker [\u003cflags\u003e]\r\n Scan Docker Image\r\ntravisci --token=TOKEN\r\n Scan TravisCI\r\npostman [\u003cflags\u003e]\r\n Scan Postman\r\nelasticsearch [\u003cflags\u003e]\r\n Scan Elasticsearch\r\njenkins --url=URL [\u003cflags\u003e]\r\n Scan Jenkins\r\nhuggingface [\u003cflags\u003e]\r\n Find credentials in HuggingFace datasets, models and spaces.\r\nstdin\r\n Find credentials from stdin.\r\nmulti-scan\r\n Find credentials in multiple sources defined in configuration.\r\njson-enumerator [\u003cpath\u003e...]\r\n Find credentials from a JSON enumerator input.\r\nanalyze\r\n Analyze API keys for fine-grained permissions information.\r\nFor example, to scan a git repository, start with\r\ntrufflehog git https://github.com/trufflesecurity/trufflehog.git\r\nConfiguration\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 13 of 20\n\nTruffleHog supports defining custom regex detectors and multiple sources in a configuration file provided via the\r\n--config flag. The regex detectors can be used with any subcommand, while the sources defined in\r\nconfiguration are only for the multi-scan subcommand.\r\nThe configuration format for sources can be found on Truffle Security's source configuration documentation page.\r\nExample GitHub source configuration and options reference:\r\nsources:\r\n- connection:\r\n '@type': type.googleapis.com/sources.GitHub\r\n repositories:\r\n - https://github.com/trufflesecurity/test_keys.git\r\n unauthenticated: {}\r\n name: example config scan\r\n type: SOURCE_TYPE_GITHUB\r\n verify: true\r\nYou may define multiple connections under the sources key (see above), and TruffleHog will scan all of the\r\nsources concurrently.\r\nS3\r\nThe S3 source supports assuming IAM roles for scanning in addition to IAM users. This makes it easier for users\r\nto scan multiple AWS accounts without needing to rely on hardcoded credentials for each account.\r\nThe IAM identity that TruffleHog uses initially will need to have AssumeRole privileges as a principal in the trust\r\npolicy of each IAM role to assume.\r\nTo scan a specific bucket using locally set credentials or instance metadata if on an EC2 instance:\r\ntrufflehog s3 --bucket=\u003cbucket-name\u003e\r\nTo scan a specific bucket using an assumed role:\r\ntrufflehog s3 --bucket=\u003cbucket-name\u003e --role-arn=\u003ciam-role-arn\u003e\r\nMultiple roles can be passed as separate arguments. The following command will attempt to scan every bucket\r\neach role has permissions to list in the S3 API:\r\ntrufflehog s3 --role-arn=\u003ciam-role-arn-1\u003e --role-arn=\u003ciam-role-arn-2\u003e\r\nExit Codes:\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 14 of 20\n\n0: No errors and no results were found.\r\n1: An error was encountered. Sources may not have completed scans.\r\n183: No errors were encountered, but results were found. Will only be returned if --fail flag is used.\r\n TruffleHog Github Action\r\nGeneral Usage\r\non:\r\n push:\r\n branches:\r\n - main\r\n pull_request:\r\njobs:\r\n test:\r\n runs-on: ubuntu-latest\r\n steps:\r\n - name: Checkout code\r\n uses: actions/checkout@v4\r\n with:\r\n fetch-depth: 0\r\n - name: Secret Scanning\r\n uses: trufflesecurity/trufflehog@main\r\n with:\r\n extra_args: --results=verified,unknown\r\nIn the example config above, we're scanning for live secrets in all PRs and Pushes to main . Only code changes in\r\nthe referenced commits are scanned. If you'd like to scan an entire branch, please see the \"Advanced Usage\"\r\nsection below.\r\nShallow Cloning\r\nIf you're incorporating TruffleHog into a standalone workflow and aren't running any other CI/CD tooling\r\nalongside TruffleHog, then we recommend using Shallow Cloning to speed up your workflow. Here's an example\r\nof how to do it:\r\n...\r\n - shell: bash\r\n run: |\r\n if [ \"${{ github.event_name }}\" == \"push\" ]; then\r\n echo \"depth=$(($(jq length \u003c\u003c\u003c '${{ toJson(github.event.commits) }}') + 2))\" \u003e\u003e $GITHUB_ENV\r\n echo \"branch=${{ github.ref_name }}\" \u003e\u003e $GITHUB_ENV\r\n fi\r\n if [ \"${{ github.event_name }}\" == \"pull_request\" ]; then\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 15 of 20\n\necho \"depth=$((${{ github.event.pull_request.commits }}+2))\" \u003e\u003e $GITHUB_ENV\r\n echo \"branch=${{ github.event.pull_request.head.ref }}\" \u003e\u003e $GITHUB_ENV\r\n fi\r\n - uses: actions/checkout@v3\r\n with:\r\n ref: ${{env.branch}}\r\n fetch-depth: ${{env.depth}}\r\n - uses: trufflesecurity/trufflehog@main\r\n with:\r\n extra_args: --results=verified,unknown\r\n...\r\nDepending on the event type (push or PR), we calculate the number of commits present. Then we add 2, so that\r\nwe can reference a base commit before our code changes. We pass that integer value to the fetch-depth flag in\r\nthe checkout action in addition to the relevant branch. Now our checkout process should be much shorter.\r\nCanary detection\r\nTruffleHog statically detects https://canarytokens.org/.\r\nAdvanced Usage\r\n- name: TruffleHog\r\n uses: trufflesecurity/trufflehog@main\r\n with:\r\n # Repository path\r\n path:\r\n # Start scanning from here (usually main branch).\r\n base:\r\n # Scan commits until here (usually dev branch).\r\n head: # optional\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 16 of 20\n\n# Extra args to be passed to the trufflehog cli.\r\n extra_args: --log-level=2 --results=verified,unknown\r\nIf you'd like to specify specific base and head refs, you can use the base argument ( --since-commit flag in\r\nTruffleHog CLI) and the head argument ( --branch flag in the TruffleHog CLI). We only recommend using\r\nthese arguments for very specific use cases, where the default behavior does not work.\r\nAdvanced Usage: Scan entire branch\r\n- name: scan-push\r\n uses: trufflesecurity/trufflehog@main\r\n with:\r\n base: \"\"\r\n head: ${{ github.ref_name }}\r\n extra_args: --results=verified,unknown\r\nTruffleHog GitLab CI\r\nExample Usage\r\nstages:\r\n - security\r\nsecurity-secrets:\r\n stage: security\r\n allow_failure: false\r\n image: alpine:latest\r\n variables:\r\n SCAN_PATH: \".\" # Set the relative path in the repo to scan\r\n before_script:\r\n - apk add --no-cache git curl jq\r\n - curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh\r\n script:\r\n - trufflehog filesystem \"$SCAN_PATH\" --results=verified,unknown --fail --json | jq\r\n rules:\r\n - if: '$CI_PIPELINE_SOURCE == \"merge_request_event\"'\r\nIn the example pipeline above, we're scanning for live secrets in all repository directories and files. This job runs\r\nonly when the pipeline source is a merge request event, meaning it's triggered when a new merge request is\r\ncreated.\r\nPre-commit Hook\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 17 of 20\n\nTruffleHog can be used in a pre-commit hook to prevent credentials from leaking before they ever leave your\r\ncomputer.\r\nSee the pre-commit hook documentation for more information.\r\nCustom Regex Detector (alpha)\r\nTruffleHog supports detection and verification of custom regular expressions. For detection, at least one regular\r\nexpression and keyword is required. A keyword is a fixed literal string identifier that appears in or around the\r\nregex to be detected. To allow maximum flexibility for verification, a webhook is used containing the regular\r\nexpression matches.\r\nTruffleHog will send a JSON POST request containing the regex matches to a configured webhook endpoint. If\r\nthe endpoint responds with a 200 OK response status code, the secret is considered verified. If verification fails\r\ndue to network/API errors, the result is marked as unknown.\r\nCustom Detectors support a few different filtering mechanisms: entropy, regex targeting the entire match, regex\r\ntargeting the captured secret, and excluded word lists checked against the secret (captured group if present, entire\r\nmatch if capture group is not present). Note that if your custom detector has multiple regex set (in this example\r\nhogID , and hogToken ), then the filters get applied to each regex. Here is an example of a custom detector using\r\nthese filters.\r\nNB: This feature is alpha and subject to change.\r\nRegex Detector Example\r\nHere is how to setup a custom regex detector with verification server.\r\nGeneric JWT Detection\r\nTruffleHog supports detection and verification of a subset of generic JWTs it finds. Specifically, if a JWT uses\r\npublic-key cryptography rather than HMAC and the public key can be obtained, TruffleHog can determine\r\nwhether the JWT is live or not.\r\n🔍 Analyze\r\nTruffleHog supports running a deeper analysis of a credential to view its permissions and the resources it has\r\naccess to.\r\n❤️ Contributors\r\nThis project exists thanks to all the people who contribute. [Contribute].\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 18 of 20\n\n💻 Contributing\r\nContributions are very welcome! Please see our contribution guidelines first.\r\nWe no longer accept contributions to TruffleHog v2, but that code is available in the v2 branch.\r\nAdding new secret detectors\r\nWe have published some documentation and tooling to get started on adding new secret detectors. Let's improve\r\ndetection together!\r\nUse as a library\r\nCurrently, trufflehog is in heavy development and no guarantees can be made on the stability of the public APIs at\r\nthis time.\r\nLicense Change\r\nSince v3.0, TruffleHog is released under a AGPL 3 license, included in LICENSE . TruffleHog v3.0 uses none of\r\nthe previous codebase, but care was taken to preserve backwards compatibility on the command line interface.\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 19 of 20\n\nThe work previous to this release is still available licensed under GPL 2.0 in the history of this repository and the\r\nprevious package releases and tags. A completed CLA is required for us to accept contributions going forward.\r\nSource: https://github.com/dxa4481/truffleHog\r\nhttps://github.com/dxa4481/truffleHog\r\nPage 20 of 20",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"references": [
		"https://github.com/dxa4481/truffleHog"
	],
	"report_names": [
		"truffleHog"
	],
	"threat_actors": [],
	"ts_created_at": 1775434444,
	"ts_updated_at": 1775791246,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/700cc538c84f5e748c2df212ffd6d3b542c7cdf5.pdf",
		"text": "https://archive.orkl.eu/700cc538c84f5e748c2df212ffd6d3b542c7cdf5.txt",
		"img": "https://archive.orkl.eu/700cc538c84f5e748c2df212ffd6d3b542c7cdf5.jpg"
	}
}