Gitleaks is a command-line secret scanner that looks for passwords, API keys, tokens and other credentials in source code and related data.
It is designed for both local developer use and automated security workflows, with a configurable detection engine rather than a hard-wired set of checks. Gitleaks can inspect a working tree as well as Git history, making it useful both for preventing new leaks and for examining repositories that may already contain sensitive material. Upstream describes the project as feature complete, with future work focused on security fixes rather than new functionality.
This is free and open source software.
Key Features
- Scan Git repositories, directories and individual files, or feed content directly through standard input.
- Use built-in secret detection rules or define custom rules in TOML configuration files.
- Extend the default configuration while selectively disabling rules that are not relevant to a project.
- Combine regular expressions with entropy thresholds, keywords and secret groups to tune detection.
- Create baselines so previously reviewed findings can be ignored while newly introduced secrets remain visible.
- Apply global and rule-specific allowlists based on commits, paths, regular expressions and stop words.
- Generate reports in JSON, CSV, JUnit and SARIF formats, or use a custom report template.
- Redact all or part of detected secrets from command output and logs.
- Recursively decode encoded content and inspect nested archives when those scanning options are enabled.
- Integrate into pre-commit workflows and CI pipelines, including GitHub-based automation.
- Limit scans by target size, timeout, selected rules and Git history options.
- Return a configurable exit code when leaks are found, making it straightforward to enforce policy in scripts.
Website: github.com/gitleaks/gitleaks
Support:
Developer: gitleaks
License: MIT License
Gitleaks is written in Go. Learn Go with our recommended free books and free tutorials.
Related Software
| Secret Scanning Tools | |
|---|---|
| Gitleaks | Detects secrets and credentials in Git repositories |
| TruffleHog | Finds, classifies and verifies exposed secrets across many sources |
| detect-secrets | Helps detect and prevent secrets from being committed to source code |
| Talisman | Checks Git changes for secrets and sensitive data before they are committed |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.