feat!: migrate secret-scan from gitleaks to betterleaks - #70
Merged
Conversation
betterleaks is gitleaks' successor, written from scratch by gitleaks' original author after he lost admin control of that repo and its name. MIT, no license key for org use — the same reason this workflow installed the OSS gitleaks binary rather than the paid official action. BREAKING: the `gitleaks-version` input is replaced by `betterleaks-version`. Compatibility is near-total, which is what made the swap cheap. Verified against the v1.8.1 binary rather than the docs: every flag used here exists (--no-banner, --redact, --report-format=sarif, --report-path, --config, --exit-code, --log-opts, git --staged/--pre-commit), release tarballs are named identically in shape and contain a top-level binary on both linux arches, and .gitleaks.toml / GITLEAKS_CONFIG / .gitleaksignore (same fingerprint format) / `gitleaks:allow` are all still honoured as fallbacks. Expect new findings: ~98.6% recall on CredData vs gitleaks' ~70.4%. This repo was exactly that case — full history went from "no leaks" to 1 leak, a low-confidence generic-password match on the GRAFANA_ADMIN_PASSWORD placeholder in examples/README.md. Such matches live in committed history, so an allow-comment can't clear them; .gitleaksignore pins the fingerprint. Adds a `confidence` input as the blunter escape hatch for consumers. Local tooling moves too (mise.toml, lefthook.yml), and the docs move to @V3. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011c5RTvAwJB62bcvuARUqKr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
betterleaks is gitleaks' successor, written from scratch by gitleaks' original author (Zach Rice) after he lost admin control of that repository and its name. It's MIT, he retains ownership, and it carries no license key requirement for org use — which is the same reason
secret-scan.ymlinstalled the OSS gitleaks binary rather than the paid officialgitleaks-action.BREAKING
The
gitleaks-versioninput is replaced bybetterleaks-version(default1.8.1). A caller still passinggitleaks-versionwill fail validation.Per the repo's precedent for breaking input changes, this bumps the major — docs move to
@v3.release.ymlderives the floating tag generically (v1.2.3→v1), so av3.0.0tag createsv3with no change needed there.Compatibility
Verified against the actual v1.8.1 binary, not the docs:
--no-banner,--redact,--report-format=sarif,--report-path,--config,--exit-code,--log-opts, andgit --staged --pre-commitbetterleaksbinary (static ELF) — install step verified end-to-end.gitleaks.toml,GITLEAKS_CONFIG,.gitleaksignore(same fingerprint format) andgitleaks:allowcomments as fallbacks, so existing consumer configs need no changesmiseregistry already carriesbetterleaks(via aqua, with cosign verification on install)datasource=github-releases depName=betterleaks/betterleaksExpect new findings
betterleaks reports ~98.6% recall on CredData vs gitleaks' ~70.4%. A repo that scanned clean may not any more. This repo was exactly that case:
The finding is a false positive —
GRAFANA_ADMIN_PASSWORD=ci-validate, a documentation placeholder inexamples/README.md:159at commit526db3a, matched bygeneric-passwordat low confidence.Because such matches live in committed history, a
betterleaks:allowcomment on the current line can't clear them — the fingerprint has to be pinned. Hence the new.gitleaksignore. Note PR-diff mode is unaffected unless the offending line is touched, so this surprise lands on push/scheduled full-history runs, not on PRs.Consumers hitting the same thing have two options, both verified:
.gitleaksignore(preferred — keeps low-confidence detection on)confidence: mediuminput (blunter; drops a whole tier)Also changed
mise.toml+lefthook.yml— local pre-commit/pre-push secret scans use betterleaks, somise installon an existing clone swaps the binarygitleaks-sarif→betterleaks-sarifTest plan
actionlintcleanyamllint .github/ .yamllint.ymlclean (only pre-existing line-length warnings inclaude-code-review.yml).gitleaksignore(betterleaks git --redact --no-banner→ exit 0)--log-opts=base..head) runs and writes SARIFlinux_x64andlinux_arm64tarballsNot done
Betterleaks ships
checksums.txt+ a sigstore bundle and the install step still verifies nothing. Left out to keep this diff to the migration — worth a follow-up.🤖 Generated with Claude Code
https://claude.ai/code/session_011c5RTvAwJB62bcvuARUqKr