gitleaks/gitleaks
Systems
Internal building blocks of the Gitleaks binary. Each page below covers one Go package (or directory) in depth.
| System | Source | Responsibility |
|---|---|---|
| cmd | cmd/ |
Cobra CLI: git, dir, stdin, plus deprecated detect/protect |
| detect | detect/ |
The detection engine: Detector, rule loop, allowlist evaluation, baseline filtering |
| config | config/ |
Rule + allowlist parsing, the embedded default gitleaks.toml, extend/inherit |
| sources | sources/ |
Producers of Fragments: git history, filesystem, single readers, archives |
| codec | detect/codec/ |
Recursive base64/hex/percent decoding |
| report | report/ |
Output formats: JSON, CSV, JUnit, SARIF, template |
| regexp | regexp/ |
Build-tag pluggable regex engine |
Adjacent code that doesn't warrant a full page:
logging/— a thin wrapper aroundzerolog. Single file (logging/log.go— see the package). Uselogging.Debug(),.Trace(),.Warn(), etc. Don't importzerologdirectly.version/— a single variable populated by-ldflagsat build time. Seeversion/version.go.cmd/scm/— thescm.Platformenum (GitHub, GitLab, Azure DevOps, Gitea, Bitbucket) plus parsing. Used to render findingLinkURLs. Seecmd/scm/scm.go.cmd/generate/— offline tool that regeneratesconfig/gitleaks.tomlfrom per-provider rule files. Documented in how to contribute.
If you're new to the codebase, read detect first — it's the heart of the scanner — and then branch out to whichever system is relevant to your change.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.