ci: allowlist two verified gitleaks false positives - #97
Merged
Conversation
The weekly full-history gitleaks scan has failed every Monday since at
least 2026-05-25, always on the same two findings. Neither is a
credential:
- Tests/Pester/Logging.Tests.ps1 uses 'sk_live_abcd1234' as the fixture
for the test asserting Write-StructuredLog redacts keys named "Token".
The assertion is that the value does not reach the log file.
- docs/fileserver-docker.md shows readers the shape of a Cloudflare
tunnel token. The base64 payload decodes to
{"a":"abcdef...","t":"a1b2c3d4...","s":"ABCDEF..."} -- literal
ellipses, no live tunnel.
A permanently red secret scanner is worse than no scanner, because a
genuine leak arrives as "3 findings" in a job everyone has learned to
skip. The push and pull_request runs stay green because they only scan
new commits, so the weekly job was the only one reporting and it was
reporting noise.
Allowlist both by exact literal value rather than by path or commit, so
a real secret added to either file still fails the scan.
Note the singular [allowlist] table. gitleaks 8.24.3 silently ignores
the plural [[allowlists]] array at global scope -- it parses without
error and suppresses nothing -- and because push/PR runs skip history, a
broken allowlist would not surface until the following Monday. The file
carries a maintenance warning to that effect.
Verified locally with gitleaks 8.24.3 over all 589 commits: 2 findings
before, 0 after, and a planted secret in an allowlisted file still
fails the scan.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TheAbider
added a commit
that referenced
this pull request
Aug 3, 2026
PR #97 fixed the weekly full-history scan, but nothing prevents that fix from being silently undone. The push and pull_request gitleaks runs scan only the new commits, so a broken allowlist yields a green PR and does not surface until the following Monday. Section 207 asserts the invariants that keep the suppression safe: - The singular [allowlist] table is used and [[allowlists]] is not. gitleaks 8.24.3 silently ignores the plural array at global scope: it parses, warns about nothing, and suppresses nothing. Upstream docs show the plural form, so this is easy to "modernise" into a no-op. - No `paths` or `commits` entries, which would blind the scanner to whole files or whole commits instead of to two exact values. - useDefault stays true, so the allowlist is not layered over an empty ruleset that scans for nothing. - Exactly two reviewed entries, and no catch-all regex. - The workflow keeps its schedule trigger and fetch-depth: 0, without which nothing ever scans history at all. The section deliberately does not embed the two allowlisted literals; it counts entries instead, so the test file does not reintroduce the strings it exists to describe. Mutation-verified: violating all six config invariants and both workflow invariants at once fails 9 of the 10 asserts and the suite exits 1. The tenth ("file present") correctly still passes, since the file existed. Structural test count 5428 -> 5438; README badge synced by the suite.
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.
Problem
The weekly full-history gitleaks scan has failed every Monday since at least 2026-05-25 — eleven consecutive runs — always on the same two findings.
The
pushandpull_requestruns stay green because gitleaks only scans new commits on those events. Only theschedulerun doesgit log -p --full-history --all, so it re-reports the same two historical commits forever.A permanently red secret scanner is worse than no scanner: a genuine leak would arrive as "3 findings" in a job everyone has learned to skip.
The two findings are not credentials
Tests/Pester/Logging.Tests.ps1:133— the fixture for the test asserting the logger redacts data keys namedToken. The value is deliberately Stripe-shaped so the test is meaningful, and the assertion is that it never reaches the log file:Sibling cases in the same block use
hunter2-plaintextandtopsecret-xyz.docs/fileserver-docker.md:145— shows readers the shape of a Cloudflare tunnel token. The base64 payload decodes to:{"a":"abcdef...","t":"a1b2c3d4...","s":"ABCDEF..."}Literal ellipses, no live tunnel, no account identifier. The next line of that document reads "Never commit
.envto version control."Approach
Allowlist by exact literal value, not by path and not by commit, so a real secret added to either file in any future commit still fails.
Note the file uses the singular
[allowlist]table. gitleaks 8.24.3 silently ignores the plural[[allowlists]]array at global scope — it parses without error, emits no warning, and suppresses nothing. Since push/PR runs skip history, a broken allowlist would not surface until the following Monday, so the file carries a maintenance warning and a re-verification command.Verification
Run locally against full history with gitleaks 8.24.3 — the exact version CI pins — after checksum-verifying the release archive.
[[allowlists]]form[allowlist]form (this PR)The last row is the one that matters. Three secrets were planted and all three were caught while the two known false positives stayed suppressed — 3 findings, not 5:
TUNNEL_TOKENappended todocs/fileserver-docker.md— an allowlisted file. Caught, proving the suppression is not path-scoped.sk_live_9f3c7a2e8b1d4506, inTests/Pester/Logging.Tests.ps1. Caught, proving exact-value scoping.api_keyin a new file. Caught.The mutation commit was discarded and never pushed.
Follow-up
After merge, the gitleaks workflow should be dispatched manually on
masterto confirm the full-history path is green, since no required check exercises it.