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.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |


Please read our Comment Policy before commenting.