Gitleaks

gitleaks/gitleaks last check 183 releases 6m+
Notes

Find secrets with Gitleaks 🔑

Release notes
view on github
8.20.0 · 1y+

Changelog

  • bf8a49f Make private key check less greedy and include fifth dash (#1440)
  • 9c354f5 print tags if they exist
  • 2278a2a Decode Base64 (#1488)
  • c5b15c9 refactor(config): keyword map (#1538)
  • a971a32 fix: use regexTarget for extend config (#1536)
  • a0f2f46 feat: bump go to 1.22 (#1537)
  • 4e8d7d3 fix: handle pre-commit and staged (#1533)
  • f8dcd83 Bugfix/1352 incorrect report multiple lines (#1501)

Huge huge thanks to @bplaxco for supporting b64 decoding, @recreator66 for bug fixes, and to @rgmz for his continued support of the project in the form of PRs and reviews. Thanks you!

New Feature: Decoding

Sometimes secrets are encoded in a way that can make them difficult to find with just regex. Now you can tell gitleaks to automatically find and decode encoded text. The flag --max-decode-depth enables this feature (the default value "0" means the feature is disabled by default).

Recursive decoding is supported since decoded text can also contain encoded text. The flag --max-decode-depth sets the recursion limit. Recursion stops when there are no new segments of encoded text to decode, so setting a really high max depth doesn't mean it will make that many passes. It will only make as many as it needs to decode the text. Overall, decoding only minimally increases scan times.

The findings for encoded text differ from normal findings in the following ways:

  • The location points the bounds of the encoded text
    • If the rule matches outside the encoded text, the bounds are adjusted to include that as well
  • The match and secret contain the decoded value
  • Two tags are added decoded:<encoding> and decode-depth:<depth>

Currently supported encodings:

  • base64 (both standard and base64url)