+26
日增长
31,052
stars
2,381
forks
181
watchers
1,184
prs
1,006
issues
190
releases
README
Gitleaks
┌─○───┐
│ │╲ │
│ │ ○ │
│ ○ ░ │
└─░───┘
[!WARNING]
Gitleaks is feature complete. I'm not merging new features into Gitleaks. Future releases will be security patches only. I'm shifting my focus to Betterleaks
[license]: ./LICENSE
[badge-license]: https://img.shields.io/github/license/gitleaks/gitleaks.svg
[go-docs-badge]: https://pkg.go.dev/badge/github.com/gitleaks/gitleaks/v8?status
[go-docs]: https://pkg.go.dev/github.com/zricethezav/gitleaks/v8
[badge-build]: https://github.com/gitleaks/gitleaks/actions/workflows/test.yml/badge.svg
[build]: https://github.com/gitleaks/gitleaks/actions/workflows/test.yml
[go-report-card-badge]: https://goreportcard.com/badge/github.com/gitleaks/gitleaks/v8
[go-report-card]: https://goreportcard.com/report/github.com/gitleaks/gitleaks/v8
[dockerhub]: https://hub.docker.com/r/zricethezav/gitleaks
[dockerhub-badge]: https://img.shields.io/docker/pulls/zricethezav/gitleaks.svg
[gitleaks-action]: https://github.com/gitleaks/gitleaks-action
[gitleaks-badge]: https://img.shields.io/badge/protected%20by-gitleaks-blue
[![GitHub Action Test][badge-build]][build]
[![Docker Hub][dockerhub-badge]][dockerhub]
[![Gitleaks Action][gitleaks-badge]][gitleaks-action]
[![GoDoc][go-docs-badge]][go-docs]
[![GoReportCard][go-report-card-badge]][go-report-card]
[![License][badge-license]][license]
Gitleaks is a tool for detecting secrets like passwords, API keys, and tokens in git repos, files, and whatever else you wanna throw at it via stdin. If you wanna learn more about how the detection engine works check out this blog: Regex is (almost) all you need.
➜ ~/code(master) gitleaks git -v
○
│╲
│ ○
○ ░
░ gitleaks
Finding: "export BUNDLE_ENTERPRISE__CONTRIBSYS__COM=cafebabe:deadbeef",
Secret: cafebabe:deadbeef
RuleID: sidekiq-secret
Entropy: 2.609850
File: cmd/generate/config/rules/sidekiq.go
Line: 23
Commit: cd5226711335c68be1e720b318b7bc3135a30eb2
Author: John
Email: [email protected]
Date: 2022-08-03T12:31:40Z
Fingerprint: cd5226711335c68be1e720b318b7bc3135a30eb2:cmd/generate/config/rules/sidekiq.go:sidekiq-secret:23
Getting Started
Gitleaks can be installed using Homebrew, Docker, or Go. Gitleaks is also available in binary form for many popular platforms and OS types on the releases page. In addition, Gitleaks can be implemented as a pre-commit hook directly in your repo or as a GitHub action using Gitleaks-Action.
Installing
bash
MacOS
brew install gitleaks
Docker (DockerHub)
docker pull zricethezav/gitleaks:latest
docker run -v ${path_to_host_folder_to_scan}:/path zricethezav/gitleaks:latest [COMMAND] [OPTIONS] [SOURCE_PATH]
Docker (ghcr.io)
docker pull ghcr.io/gitleaks/gitleaks:latest
docker run -v ${path_to_host_folder_to_scan}:/path ghcr.io/gitleaks/gitleaks:latest [COMMAND] [OPTIONS] [SOURCE_PATH]
From Source (make sure go is installed)
git clone https://github.com/gitleaks/gitleaks.git
cd gitleakTop issues
#1078How to create custom rules to scan secerts in .yaml or .properties file 18 comments · 2023-01-17#539Gitleaks misses quite a few Azure rules.13 comments · 2021-03-16#1637XML Regex is not working in Gitleaks11 comments · 2024-11-13#1048Support multiple report formats in a single execution11 comments · 2022-11-30#988No json report file generated in docker version v8.13.011 comments · 2022-09-27#821Incoming commits are not scanned as part of pre-receive hook10 comments · 2022-03-31#1864Sample AKIA credentials cause SAST/Security Scanners to false flag9 comments · 2025-05-19#1557Managing custom config file9 comments · 2024-10-10
Discussions
#2351Thank you! Using Gitleaks to secure AI coding agent workflows in agent-code-guard0 comments · 2026-11-11#2184I built an Agent-specific static analyzer to catch cross-modal credential leakage0 comments · 2026-07-01#2167ccline — AI terminal helper for security/DevSecOps workflows0 comments · 2026-06-10#2042outcome based on directory executed, 428 leaks in gitleaks/* vs 2 leaks in "."2 comments · 2026-02-23#2033How to list all possible rules when using --enable-rule0 comments · 2026-02-03#1987Why Gitleaks license request form says "This form was created inside TruffleSec"1 comments · 2025-11-12#1950Commit Author name and email2 comments · 2025-09-26#1934Is all processing done locally?1 comments · 2025-08-24
Latest release
v8.30.1 v8.30.1 2026-03-21Changelog 83d9cd684c87d95d656c1458ef04895a7f1cbd8e update goreleaser 8d1f98c7967eb1e79cb44ac6241a124e145d2165 Removed unnecessary functions from report template (2040) ca20267a84aa1fa2c2a9c1a13cdb50cafb48eeb0 its the simple things (2020) b66ac75e4fa93d86d78fccd6e2f36d2c0698b2a2 build: switch to Go 1.24 (2002)