Security and privacy · Edition No. 28 · 22 Sep 2026

gitleaks/gitleaks

It searches a Git repository, including its whole history, for passwords and keys that were committed by mistake.

← Security and privacyRead the whole edition →

29.4k stars · MIT · v8.30.1, read from /releases/latest, shown as '21 Mar' with no year; ungh.cc dates the same tag 2026-03-21 with the year present · Track this in Scout

It searches a Git repository, including its whole history, for passwords and keys that were committed by mistake.

▶Repo detailsthe review · specs · pros & cons · install

What it is

A single command-line program written in Go, with about two hundred built-in rules for recognising the shape of a secret: cloud keys, database passwords, payment keys, personal access tokens. It can scan the files as they are now, the whole commit history, or run automatically before every commit.

What it is good for. Anyone who writes code without a colleague to review it, and anyone about to make a private repository public. It is also worth running on a repository that has already been public for years, because the useful question is not whether a secret is visible today but whether one was ever committed. A key that was live for one afternoon in 2023 is still a live key if nobody rotated it.

Stars29.4k
LicenceMIT
Latestv8.30.1, read from /releases/latest, shown as '21 Mar' with no year; ungh.cc dates the same tag 2026-03-21 with the year present
Good
  • It is one downloaded file and needs nothing else installed.
  • It reads history, which is the part people forget. Searching current files finds almost nothing useful.
  • Running it before each commit means the mistake never gets recorded in the first place.
Watch for
  • It reports things that are not secrets. A random-looking test string matches the same patterns. Expect to read the list and dismiss some of it.
  • It cannot fix anything. Finding an old key tells you to go and cancel that key at the provider, which is manual work.
  • Rewriting history to remove a secret is a separate, harder job with a real chance of breaking other people's copies of the repository.
Similar repositories
  • trufflesecurity/trufflehog

    It also hunts for leaked credentials, but it goes a step further and tries each one against the live service to see whether it still works, across many more sources than Git.

    Track this in Scout
  • Yelp/detect-secrets

    It also finds secrets in a code base, but it is built around a signed-off baseline file so a team only ever reviews what is new.

    Track this in Scout
  • getsops/sops

    It works on the other side of the same problem: instead of finding a secret that was committed, it encrypts the values in a settings file so committing it is safe.

    Track this in Scout
Install
# macOS or Linux with Homebrew
brew install gitleaks
# or download the binary for your system from
# https://github.com/gitleaks/gitleaks/releases
# scan the files as they are now
gitleaks dir . -v
# scan the whole commit history
gitleaks git . -v
Screenshots
gitleaks/gitleaks: GitHub preview card

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.