Gitleaks finds passwords, API keys, and tokens in git history, directories, files, or stdin. It uses configurable regex rules and fits into local workflows and CI.
Overview
Gitleaks is a detection tool aimed at secrets such as passwords, API keys, and tokens embedded in git repositories, on disk, or piped through standard input. Its matching engine relies primarily on pattern rules you can customize through a dedicated configuration format, with a default ruleset available for common leak types.
Scanning supports three modes. The git mode walks commit history and patches, including optional commit ranges via git log options. The dir mode scans arbitrary paths and files in the working tree. The stdin mode accepts streamed content for ad hoc checks. Reports can be written as JSON, CSV, JUnit, or SARIF, and custom output templates are supported.
Operational extras include baselines that suppress known legacy findings, allow comments and fingerprint-based ignore files, recursive decoding of encoded secret fragments, and nested archive extraction for dir and git scans. Composite rules can require multiple pattern hits within defined line or column proximity. Integration paths include pre-commit hooks, a companion GitHub Action for pull request and commit scanning, Docker images, and package installs on common platforms.
Maintenance focus has shifted toward security patches rather than new features, while rule tuning and configuration remain central to how teams adopt the scanner in DevSecOps pipelines.
Key features
- Git, directory, and stdin scan modes
- Customizable TOML secret detection rules
- JSON, CSV, JUnit, and SARIF reporting
- Baseline reports for legacy noise
- Encoded text and nested archive scanning
- Composite multi-rule proximity matching
- Pre-commit and GitHub Action integration
- Docker and binary distribution options
Use cases
- Scan repos before merge or release
- Hook commits with pre-commit gitleaks
- Audit filesystems and CI artifacts
- Baseline noisy historical repositories
Does the same job as
Gitleaks doesn't name these products itself, but its own description shows it does the same job.