trufflesecurity/trufflehog

Find, verify, and analyze leaked credentials

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 29 minutes ago
Added to GitGenius on September 8th, 2025
Created on December 31st, 2016
Open Issues & Pull Requests: 519 (+0)
Number of forks: 2,547
Total Stargazers: 27,568 (+0)
Total Subscribers: 206 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 5.8 days
Mean response time: 127.1 days
90th percentile: 478.1 days
Tracked items: 432

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "question" is answered fastest, typically in about 17 hours, while "pkg/sources" waits about 13 months. 78% of tracked open issues have had no activity in three months, so the open count overstates what is actively being worked. Only 6% of issues opened in the past year have been closed.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 260
New in 7 days: 1
Closed in 7 days: 1
Avg open age: 473 days
Stale 30+ days: 250
Stale 90+ days: 231

Recent activity

Opened in 7 days: 1
Closed in 7 days: 1
Comments in 7 days: 1
Events in 7 days: 1

Top labels

  • bug (419)
  • enhancement (292)
  • pkg/detectors (46)
  • pkg/sources (29)
  • question (23)
  • contributions welcomed (21)
  • help wanted (17)
  • pkg/engine (10)

Detailed Description

TruffleHog is an open-source, static analysis tool designed to scan code repositories (Git, Docker images, etc.) for secrets accidentally committed by developers. These secrets can include API keys, passwords, tokens, certificates, and other sensitive information that, if exposed, could lead to significant security breaches. Developed by Truffle Security, it aims to prevent credential leakage *before* it impacts production systems. It's particularly valuable in DevOps environments where frequent code changes and automated deployments are common, increasing the risk of accidental commits.

The core functionality of TruffleHog revolves around pattern matching. It utilizes a comprehensive and regularly updated collection of regular expressions (regex) to identify potential secrets within the codebase. These patterns cover a wide range of services and secret types, including AWS, Azure, Google Cloud, GitHub, Docker Hub, and many more. Crucially, TruffleHog doesn't just look for exact matches; it also employs techniques to detect variations and obfuscations of secrets, such as base64 encoding or slight modifications to key formats. The tool can be run against local Git repositories, remote repositories (GitHub, GitLab, Bitbucket), and even Docker images.

TruffleHog offers several modes of operation. The default mode, 'scan', performs a basic scan of the repository history, reporting any detected secrets. The 'watch' mode is designed for continuous monitoring; it hooks into Git repositories and automatically scans new commits as they are pushed, providing real-time alerts. A 'debug' mode is available for troubleshooting and understanding the tool's behavior. Furthermore, TruffleHog supports customizable regex patterns, allowing users to add detection rules for internal or less common services. It also provides options to ignore specific files or directories, reducing false positives.

The output of TruffleHog is designed to be actionable. It reports the detected secret, the file and line number where it was found, the commit hash where it was introduced, and a confidence level indicating the likelihood of a true positive. This information allows developers to quickly locate and revoke compromised credentials. TruffleHog can output results in various formats, including JSON, CSV, and text, making it easy to integrate with existing security workflows and reporting systems. It also supports integration with CI/CD pipelines, enabling automated secret detection as part of the build process.

Beyond the core scanning capabilities, TruffleHog v3 introduced significant improvements, including enhanced detection accuracy, faster scan times, and improved support for various file types and repository formats. The project is actively maintained and benefits from a strong community contribution, ensuring that the regex patterns remain up-to-date and effective against emerging threats. It's a valuable addition to any organization's DevSecOps toolkit, helping to proactively mitigate the risks associated with accidentally exposed secrets and improve overall security posture.