ci: allowlist the synthetic fixture token by content, not commit SHA - #68
Merged
Merged
Conversation
The weekly full-history secret scan has been failing since the 4.2.0 clean-slate history rewrite. `.gitleaksignore` fingerprints are bound to a commit SHA (`<commit>:<file>:<rule>:<line>`), and the rewrite re-parented every tracked file into a single squash commit, so all three entries still named the pre-rewrite SHA `eec4c7a7` -- a commit that no longer exists in this repository. The exemption was dead and gitleaks reported 3 leaks. The failure was invisible on push and pull_request because gitleaks-action scans only the commits in the event range there; it surfaced only on the weekly schedule, which scans full history and re-reads the squash commit. Replace the SHA-bound fingerprints with a `.gitleaks.toml` allowlist scoped by path AND line content, so the exemption survives any future rebase, squash, or history rewrite. Scoping with condition = "AND" keeps coverage: only this one literal synthetic value in this one fixture is exempt. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Summary
The weekly full-history Secret scan has been failing on
mainsince the 4.2.0 clean-slate history rewrite..gitleaksignorefingerprints are bound to a commit SHA (<commit>:<file>:<rule>:<line>); the rewrite re-parented every tracked file into a single squash commit, so all three entries still named the pre-rewrite SHAeec4c7a7— a commit that no longer exists here. The exemption was dead and gitleaks reported 3 leaks.The breakage was invisible on
pushandpull_requestbecause gitleaks-action scans only the commits in the event range there. It surfaced only on the weeklyschedule, which scans full history and re-reads the squash commit.This replaces the SHA-bound fingerprints with a
.gitleaks.tomlallowlist scoped by line content, so the exemption survives any future rebase, squash, or history rewrite.Evidence
gitleaks detectwith no--log-opts,leaks found: 3, allgeneric-api-keyontests/fixtures/provider_dispatcher_protocol_v1.jsonlines 9/23/36 at commitb9c5a4e4.git cat-file -t eec4c7a7d9940b9122fa255694ec8cb6a754388b→ fails; the SHA is absent from this repository.The flagged value is not a credential.
"lane_token": "3b73a0ffbe3426ef5761f5c09b756ef6"is deterministically derived from fixed all-a/all-bdigests byruntime_client._dispatcher_lane_token, and pinned byte-for-byte bytest_dispatcher_protocol_matches_the_cross_repository_fixture, which holds the wire protocol in parity with the workspace-side counterpart. Changing the literal would break that parity contract, which is why the fix is an allowlist rather than a fixture edit.Why the exemption stays narrow. Top-level
pathsandregexesare OR'd (there is noconditionat top level), so adding apathsentry would exempt the whole fixture file. InsteadregexTarget = "line"is matched against a regex pinning both the key and the literal value: any other secret added to that same fixture is still reported.One non-obvious trap, recorded in the file's comments. The first attempt used top-level
[[allowlists]]withcondition = "AND"and silently did nothing (run 30335168339, still 3 leaks). In gitleaks 8.24config/config.go, the pluralAllowlistsfield withconditionis parsed only inside[[rules]]; the top level takes singularAllowlist. An unsupported top-level table is dropped without warning — a quiet way to disable your own exemption.Boundary declaration
Generated and release surfaces
SKILL.mdfiles are in parity.changelog.d/fragment: CI-tooling fix with no user-visible behavior change (changelog.d/README.md§ "When NOT to add a fragment").CHANGELOG.mduntouched.Verification
python3 scripts/build_skills.py --check— PASSpython3 scripts/build_marketplace.py --check— PASSpython3 scripts/build-changelog.py --check— PASSpython3 -m unittest discover -s tests -t .— PASS (Ran 579 tests, OK, exit 0)python3 -m unittest discover -s scripts -p 'test_*.py'— PASS (Ran 254 tests, OK, exit 0)python3 scripts/check_release_consistency.py— PASSpython3 scripts/secret_scan.py— PASS (321 files, clean)python3 scripts/check-public-export-safety.py --active-tree— SAFEgit diff --check— cleanworkflow_dispatchof Secret scan on this branch, exercising the exact failing full-history path — green.check-public-export-safety.py --historyreports threeraw_provider_recipehits locally. They are unreachable dangling blobs left in the local clone by the same 4.2.0 rewrite (git rev-list --objects origin/mainmatches none of them;plugins/antigravity-collab/is not tracked onmain). Pre-existing, local-only, unrelated to this diff; a fresh CI checkout does not carry those objects.Review and post-condition
Tier 3 (
docs/public-governance.md) — declared conservatively: this changes the coverage of a credential-scanning gate on a public repository. Not an operator-reserved path (no CODEOWNERS entry).Independent cross-family review — Grok (xAI), distinct from the Anthropic-family author:
Post-condition: after merge, confirm the next scheduled Secret scan on
mainis green, or dispatch it manually onmainto confirm immediately.Compliance trace
author: claude
standing_directives: public boundary declaration; changelog-fragment convention; independent cross-family review; full verification-gate run before merge
tier: 3
cross_check: PROCEED — Grok (xAI) governance review, APPROVE, confidence H, zero concerns; distinct family from the Anthropic-family author
post_condition: next scheduled (or manually dispatched) Secret scan on main is green
mcp_coverage_gap: NONE
contributor_rights: OWNER-AUTHORED
operator_reserved: no