fix(ci): allowlist the published extension key by exact value - #112
Merged
Merged
Conversation
The Chrome extension manifest "key" field holds the published half of an RSA key pair. Chrome uses it to pin a stable extension ID, so it ships in every copy of the extension. It decodes to a 294-byte SubjectPublicKeyInfo beginning MIIBIjANBgkqhkiG and carries no private material. The default generic-api-key rule matches it on the field name alone. The secret scan reads every fetched ref, so the value reaches it from rescue/codex/browser-observer-post-96-78c0be92 even though no pull request contains that commit. Every capture pull request fails as a result. Pin the one exact literal. The entry does not widen the rule and does not exempt a path, so any other value in that field is still reported. A .gitleaksignore was the alternative and was rejected: its fingerprints are commit-and-line pinned, so they break on the next rebase. tests/test_gitleaks_allowlist.sh reads the anchored value back out of the config and requires that one changed character is still reported. It then mutates the config two ways, widening the regex and adding a path-wide exemption, and requires that each mutation would defeat that check. The scan itself now runs against the reviewed config. 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.
Every capture pull request is failing Secret Scan, and main is stale-green
gitleaksreports one finding:This is not introduced by any pull request. That commit is not an ancestor of any PR branch.
secret-scan.ymlrunsgitleaks git .after afetch-depth: 0checkout, which reads every fetched ref, so a value on any pushed branch reaches the scan.Main is stale-green, not clean. Its last successful scan ran at
2026-08-27T22:35:02Z. The rescue branch was pushed at2026-08-28T02:25:35Z, about ten minutes later. Main would fail this scan today. Please do not read the green tick on main as evidence the tree is unaffected.The value is a public key
The manifest
keyfield is the published half of an RSA key pair. Chrome uses it to pin a stable extension ID, so it ships inside every copy of the extension and is public by construction.Verified independently:
MIIBIjANBgkqhkiG, a SubjectPublicKeyInfo headergeneric-api-keymatched it on the field namekeyalone. It is the same false-positive shape asopenadapt-desktop#138, where the rule matchedSIGNING_KEY_SHA256, the digest of FFmpeg's public signing key.The change
A value-anchored
.gitleaks.tomlallowlist pinning that one exact literal, following the reviewed desktop pattern.What it deliberately does not do:
.gitleaksignore. Those fingerprints are commit-and-line pinned, so they break on the next rebase, which is why the queue-drain doc rejects them.The scan now runs against the reviewed config:
gitleaks git . --config .gitleaks.toml.The durable part is the test
tests/test_gitleaks_allowlist.shruns in the same job, before the scan. It reads the anchored value back out of the committed config, so it cannot drift from what the scanner actually allows, then:^[A-Za-z0-9+/=]+$and requires that this would defeat check 2,Checks 3 and 4 are what stop the allowlist quietly becoming a rule-wide or path-wide exemption later. A scanner left permanently red on a known false positive is how a real leak gets waved through, and an allowlist that silently widens is how one gets waved through quietly.
Validated locally against gitleaks 8.30.1, the exact version the workflow pins. Full-history scan with this config:
no leaks found.