mrkeyoor.com_
Thu 17 Sept 20:42 UTC
AI Toolsevaluationupdated 26 Aug 2026

gitleaks review

Gitleaks is a command-line scanner that looks for passwords, API keys, and other secrets in Git history, directories, files, or standard input. It is meant to stop credentials from reaching a repository or to find them later in history, with outputs that fit local hooks and CI systems.

+116stars / 7d
Verdict

Our Gitleaks build finished in 28 seconds and all 7 parsed Go test groups passed in 10 seconds, so it remains an easy secret-scanning baseline for Git and CI. Use it as one layer, with reviewed rules and suppressions, because a clean result cannot cover credential formats the rules do not recognize. New adopters should also compare Betterleaks, since Gitleaks now accepts security patches rather than new features.

We ran it

Lab card: what happened when we ran gitleaksScreenshot of gitleaks (gitleaks.io)
Install✓ · 25s187 packages
Build✓ · 28s
Tests✓ · 10s7 passed · 0 failed of 7 (go test)
Repo453 files~21,902 lines of source · 1.2 MB · 3 CI workflows · Dockerfile

Answers from our run

Does gitleaks build from source?

Dependencies installed in 25 seconds (187 packages), and the build succeeded in 28 seconds. We cloned commit b58d3f1 into a clean Debian container with 3 CPUs and no project-specific setup.

Do gitleaks's tests pass?

Yes: 7 of 7 passed when we ran the project's own test command (go test). Some failures need services or credentials a bare container does not have.

Who should not use gitleaks?

Teams looking for an expanding feature roadmap: the maintainer says Gitleaks is feature complete, future releases will be security patches, and new work is moving to Betterleaks.

What are the alternatives to gitleaks?

TruffleHog, detect-secrets, git-secrets. Our Gitleaks build finished in 28 seconds and all 7 parsed Go test groups passed in 10 seconds, so it remains an easy secret-scanning baseline for Git and CI.

Setup5/5Binary, package, Docker, hook, and Action paths; our build passed
Docs4/5Detailed commands, config precedence, rules, baselines, and reports
Community5/528,960 stars and a fresh push despite the feature freeze
Maturity4/5Stable and tested, with known detection and suppression limits

Discussed on

  1. hnGitLeaks – Search engine for exposed secrets on GitHub108 points
  2. hnI wrote Gitleaks, now I'm maintaining Betterleaks15 points
  3. hnShow HN: Gitleaks-CI. Check GitHub PRs for Secrets7 points
  4. hnWe are resuming GitLeaks.com4 points
  5. hnGitleaks – Scan Git repos (or files) for secrets using regex and entropy3 points

Who it’s for

Engineering teams that want secret scanning in pre-commit and CI workflows.
Security teams that need Git-history scanning, directory scanning, and SARIF or JSON reports from one binary.
Organizations prepared to tune rules, baselines, and allowlists for their own credentials and fixtures.
Developers who want a fast local check before code reaches a hosted repository.

Who it’s NOT for

Teams looking for an expanding feature roadmap: the maintainer says Gitleaks is feature complete, future releases will be security patches, and new work is moving to Betterleaks.
Anyone treating a clean scan as proof that no secret exists: the detector is rule based, and open reports describe missed OpenAI, Anthropic, Supabase, Basic Auth, and generic API-key cases.
Operators who cannot review suppressions: issue #2239 reports that a fingerprint can hide a different secret placed on the same file, rule, and line.
Pipelines that must fail on every unreadable file: issue #2232 reports permission-denied files can be skipped while the command exits successfully.
Teams expecting remediation: Gitleaks finds suspected secrets, but credential revocation, rotation, and history cleanup remain separate work.

Setup reality

Our Go sandbox installed 187 packages in 25 seconds. The build succeeded in 28 seconds, and the test step finished in 10 seconds with 7 passed and 0 failed.

For normal use, the README offers release binaries, Homebrew, Docker images, a GitHub Action, a pre-commit hook, and source builds. The binary needs access to the repository or mounted files it scans. CI also needs a policy for exit code 1, report retention, redaction, and trusted configuration.

The main work begins after installation: choose git, dir, or stdin, tune false positives, and review baselines or allowlists. Archive and decoding recursion default to depth 0, while large-file limits and scan timeouts are explicit settings.

Gitleaks checks Git history, files, and stdin for secrets

Gitleaks has a narrow job: find strings that look like credentials before or after they enter source control. Its git mode scans patches from git log -p, dir inspects files and directories, and stdin accepts streamed content. Findings include the rule, file, line, commit details, and a fingerprint. That makes the output useful to a developer fixing one commit and to a CI system producing JSON, CSV, JUnit, SARIF, or a custom report.

What happened when we ran it

Our sandbox installed 187 Go packages in 25 seconds at commit b58d3f1. The source build completed in 28 seconds. Tests finished in another 10 seconds, with 7 parsed Go test groups passing and 0 failing. We used Go 1.24 on Debian, 3 CPUs, and 8 GB of RAM in an unprivileged container without secrets. The repository also has 3 CI workflow files and a Dockerfile.

That clean run is a useful sign for contributors and teams that prefer source builds. The checkout contained 453 files, roughly 21,902 lines of source, and only 1.2 MB on disk before dependencies. There was no separate tests directory, but Go tests can live beside package code, and our test command found and passed 7 groups. None of these figures measure detection accuracy. They show that the project installed, compiled, and ran its own available test target in our clean environment.

Three scan modes cover different failure windows

Use git when history matters, such as checking every patch in a repository or a selected commit range. Use dir to examine the current filesystem, including material that Git does not know about. Use stdin when another process already produces the text. Those modes are related, but they are not interchangeable. A pre-receive range scan sees added patch lines; issue #2218 notes that an unchanged old secret in a modified file can fall outside that patch.

Rules and suppressions need routine review

Gitleaks is primarily a rule engine. The default configuration supplies known credential patterns, keywords, entropy checks, paths, and allowlists. Teams can replace the defaults or extend them, and configuration can come from a command flag, environment variables, or a repository file. Composite rules added in v8.28.0 can require nearby supporting matches, which helps express credentials whose pieces appear within a limited number of lines or columns.

Rules always lag some credential formats. Recent open reports describe gaps for OpenAI keys, an Anthropic rule behaving differently on macOS ARM64, new Supabase secrets, encoded Basic Auth, and a generic key in single-line JSON. Issue #2239 raises a separate suppression risk: the ignore fingerprint uses file, rule, and line, so replacing an ignored secret with a new one on the same line may remain hidden. Review .gitleaksignore like code, keep entries specific, and retest them when files move or credential formats change.

A clean exit can still mean incomplete coverage

Secret scanners are often used as a binary gate, which makes silent skips more dangerous than visible false positives. Issue #2232 reports that a file which cannot be opened because of permissions may be skipped while the run still prints that no leaks were found and exits 0. Issue #1338 describes a malformed Git diff that can leave a scan waiting indefinitely. Both are reminders to inspect warnings, set a timeout, and verify that the scanner reached every intended path.

Our own 10-second test result does not contradict those field reports. It confirms the checked-in test target passed in one clean Linux container. Production repositories add submodules, large histories, generated archives, permission boundaries, and custom rules. Run Gitleaks against seeded canary credentials in the same CI image and command used for real code. A canary that fails to trigger is more informative than another green scan against an empty fixture.

Feature work has moved to Betterleaks

The README now says Gitleaks is feature complete and that future releases will contain security patches only. The maintainer is focusing on Betterleaks. That statement is clearer than an ambiguous stale repository, and it changes the buying decision: existing users can keep a stable scanner, while teams seeking new detection features should compare the successor before standardizing. The latest published Gitleaks release we fetched was v8.30.1 from March 21, 2026.

Maintenance has not stopped. The repository was pushed on August 26, 2026, the same day we checked, and GitHub showed 464 open issues and pull requests combined. The current push and busy tracker argue against calling it abandoned. They do not restore a feature roadmap the maintainer explicitly closed. Pin v8.30.1 or a reviewed commit, watch for security patches, and understand that missing provider rules may need local configuration or a move to another scanner.

Gitleaks belongs in a layered secret policy

The best use is early and repeated: a local hook for quick feedback, CI on every change, and periodic history or directory scans. A baseline can make adoption possible in a repository with old findings, but every suppression should have an owner and a reason. When Gitleaks reports a real credential, remove it from code, rotate or revoke it at the provider, and decide whether history must be rewritten. Deleting the string from the latest commit does not invalidate a token already copied elsewhere.

Our run makes the tool easy to recommend as a first layer: 25 seconds to install, 28 seconds to build, and 7 of 7 test groups passed. The limit is equally clear. Regex and entropy rules cannot recognize every secret, and an ignored or unreadable path can weaken a clean result. Pair Gitleaks with provider-side secret controls, restricted credentials, and repository-host push protection where available. The scanner is useful evidence that a defined set of rules found nothing, not a certificate that the repository contains no credentials.

Alternatives

ProjectWhat it isPick it when
TruffleHog gh↗A secret scanner that can verify many credentials against their providers.pick this instead when credential verification and scanning many source types matter more than a compact Git-focused workflow.
detect-secretsA baseline-oriented secret detector designed for gradual adoption in existing repositories.pick this instead when maintaining a reviewed baseline is central to how your team handles existing findings.
git-secretsA smaller Git hook tool for blocking prohibited patterns before commits land.pick this instead when a narrow local hook and custom prohibited patterns are enough.

What people are saying

  1. [github-trending] gitleaks/gitleaks

Sources

  1. Gitleaks README
  2. Gitleaks v8.30.1 release
  3. Ignore fingerprint issue #2239
  4. Unreadable file handling issue #2232
  5. Pre-receive scan limitation issue #2218

More ai tools reviews

rowboat · skills · superpowers-zh · yolov5 · eve · MemOS · the whole board →