detect-secrets vs Gitleaks
detect-secrets
github.comGitleaks
github.comSide by side
| Figure | detect-secrets | Gitleaks |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| Self-hosted | Yes | Yes |
| Plans published | 1 | 1 |
| Spec score · Secrets Scanning Software | 8.5 (#3) | 7.8 (#11) |
| Baselines | The scan command creates or updates a baseline of potential secrets found in a repository. | A report can be used as a baseline so subsequent scans report only new findings. |
| Installation | The project documents installation with pip or Homebrew. | The project documents installation through Homebrew, Docker, Go, and prebuilt release binaries. |
| Integrations | The README documents installation through pip and Homebrew and integration as a pre-commit hook. | The project documents use as a pre-commit hook and as a GitHub Action. |
| License | The repository identifies its license as Apache-2.0. | The repository is distributed under the MIT License, which permits use, copying, modification, distribution, sublicensing, and sale subject to its terms. |
| Purpose | detect-secrets detects secrets in code and helps prevent new secrets from entering a codebase. | Gitleaks detects secrets such as passwords, API keys, and tokens in Git repositories, files, and stdin. |
Plans
In their own words
detect-secrets
detect-secrets is a free, open-source Python module for finding secrets in codebases and helping stop new secrets from entering Git changes. It runs on Linux, macOS, and Windows, with self-hosted use documented through pip or Homebrew. Heuristic regular expressions inspect changes for newly committed secrets, alongside entropy and keyword detection. The scan command creates or updates a baseline of potential findings; hook flags new secrets; and audit lets analysts review, label, report, or compare baseline entries. Users can configure it as a pre-commit hook with the pre-commit framework. Built-in plugins and filters can be adjusted, and custom detector plugins and filters can be developed. Exclusions, matching-line or file exclusions, secret-value exclusions, and inline allowlist comments help handle false positives. The package can also be imported into Python scripts to scan files and serialize findings. Word-list filtering and gibberish detection require optional packages, and gibberish detection is disabled by default. The project uses Apache-2.0 licensing.
Gitleaks
Gitleaks is free, MIT-licensed software that detects secrets such as passwords, API keys, and tokens in Git repositories, files, and standard input. It runs on Linux, macOS, Windows, and self-hosted systems. Scans can target repositories, directories, individual files, or streamed data. Custom rules can use Go regular expressions, entropy checks, path matching, keywords, and allowlists. A previous report can serve as a baseline so later scans show only new findings. Output is available in JSON, CSV, JUnit, SARIF, or template formats. The project documents pre-commit hook and GitHub Action use, plus CI/CD, pull-request, and supported VCS workflows for GitHub, GitLab, Azure DevOps, Gitea, and Bitbucket. Installation options include Homebrew, Docker, Go, and prebuilt release binaries. A redaction option masks secrets in logs and standard output, with a default redaction value of 100%. The project describes itself as feature complete, with future releases limited to security patches, and its security policy supports only the latest version.