Skip to content
secret-scan
Menu

gitleaks project

gitleaks

gitleaks scans with the generated config; the gitleaks filter classifies its JSON report.

generate-gitleaks-config.mjs writes generated.gitleaks.toml from the private value rules and the whole-file exceptions. Run gitleaks detect --source . --config <that file> --report-format json --exit-code 0, then the gitleaks filter on the report.

--exit-code 0 keeps gitleaks from failing the job on raw matches; the gate on .summary.private decides instead.

If gitleaks logs “0 commits scanned”, a global git config may be in the way: prefix the command with GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null.