[Bug] make check-secrets fails on the local reflog, not on repository content #522
Labels
No labels
accepted
bug
declined
docs
duplicate
enhancement
good first issue
in-progress
needs-info
privacy
security
triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
LibreKAT/Ocideck#522
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
make check-secretsfails on a clean checkout ofmain, on a finding insidegit's own bookkeeping:
Both gitleaks passes report "no leaks found". Only the trufflehog filesystem
pass fails, and it fails on the reflog:
.git/logs/HEADis 2109 lines of commitSHAs, and a 40-character hex SHA matches the LokaliseToken pattern.
Why this matters more than one false positive
The finding is not about repository content at all.
.git/logs/HEADismachine-local, untracked, and never pushed — it records what this checkout did
locally. Consequences:
many commits you happen to have made, so two developers on the same commit get
different answers, and re-running "fixes" nothing.
.gitleaks.tomlhandles gitleaksfindings, because trufflehog is not reading that config.
and this one is the last line before a committed credential reaches a public
repository.
Proposed solution
Exclude
.git/from the trufflehog filesystem pass. The git history isalready covered by the separate
trufflehog gitpass and bygitleaks git, sonothing is lost: scanning
.git/as a filesystem re-reads the same objects in aform that carries no useful context and generates exactly this class of noise.
Keep the two-scanner setup — the point of running both is that they disagree
usefully — and keep
--no-verification(turning it off sends candidate keys tothe issuing service to see whether they are live).
Verify in two directions
Clean on a fresh checkout and still failing on a planted test credential in a
tracked file. A secret-scanning gate that has been quietly narrowed until it
always passes is worse than no gate.