ci(secret-scan): allowlist public contract addresses in the generated address book - #7
Closed
SaulBuilds wants to merge 1 commit into
Closed
SaulBuilds wants to merge 1 commit into
SaulBuilds wants to merge 1 commit into
Conversation
Matr0xshka
approved these changes
Sep 27, 2026
Matr0xshka
left a comment
There was a problem hiding this comment.
Reviewed the secret-scan hardening/allowlist change. The allowlist is scoped to exact public 0x + 40-hex contract-address values and does not disable default gitleaks rules or skip files. Merge remains gated on CI.
BerryManifold
approved these changes
Sep 27, 2026
BerryManifold
left a comment
Contributor
There was a problem hiding this comment.
Second-look review from BerryManifold: approved the code/content diff as submitted. Merge remains gated on required CI and branch protection.
… address book
The merge-gate secret-scan (gitleaks) flags the generated on-chain address
book as a false positive. The default generic-api-key rule keys off trigger
words in the contract NAME -- e.g. "ModelAccessControl" (the word "Access") and
"WebAuthnP256Validator" (the word "Auth") -- and reports their values:
"ModelAccessControl": "0x...40 hex..."
Those values are PUBLIC 40204 contract addresses (0x + 40 hex = 20 bytes), not
credentials. Nothing secret is exposed.
Fix: add a NARROW .gitleaks.toml allowlist that exempts ONLY findings whose
secret is exactly a 0x-prefixed 40-hex EVM address. It keeps useDefault = true,
disables no rule, and skips no file.
Narrowness proven locally with gitleaks 8.30.1 (the version pinned by
.github/workflows/merge-gate.yml): after temporarily injecting a Stripe key, a
GitHub PAT, a 0x-prefixed 64-hex private key, and a generic api_key into
crates/chainio/src/generated/addresses.json, gitleaks still reports all four (leaks found: 4)
while the public addresses are exempt. The test edit was not committed.
A paths-scoped allowlist was deliberately avoided: in gitleaks 8.30.1 an
allowlist paths match skips the whole file even with condition="AND", which
would suppress real secrets in that file. Scoping by the address value pattern
is strictly narrower.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vv2gVzy5XLFKg48yckN9YQ
SaulBuilds
force-pushed
the
fix/gitleaks-address-allowlist
branch
from
September 27, 2026 21:44
a6d15cc to
df7696e
Compare
Contributor
Author
|
Superseded: the equivalent address-only gitleaks allowlist (exact 0x+40-hex values) landed with the address-book sync. Thanks for the clearer header comments; happy to fold them in as a follow-up. |
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.
What
Adds a small, narrow
.gitleaks.tomlso thesecret-scanmerge gate stopsflagging the generated on-chain address book as a secret. Hardening /
scanner-compatibility only — no behavior change to the code.
Why (the false positive)
The default gitleaks
generic-api-keyrule keys off trigger words in thecontract name and reports the value beside it. In the address book:
Those values are public 40204 contract addresses (
0x+ 40 hex = 20 bytes),not credentials. Nothing secret is exposed.
The fix (narrow, not blanket)
useDefault = true— every default rule stays on. Nothing is disabled.0x-prefixed 40-hex EVM address. Real credentials are not 20-byte hexaddresses, so they are still caught.
Why not a
paths-scoped allowlistThe obvious "scope it to the address-book file" approach was tested and
rejected: in gitleaks
8.30.1(the version this repo pins) an allowlistpathsmatch skips the whole file — even withcondition = "AND"— whichwould suppress any real secret that ever landed in that file. Scoping by the
address value pattern is strictly narrower.
Which workflow runs gitleaks
.github/workflows/merge-gate.yml, jobsecret-scan:if [ -f .gitleaks.toml ]; then cfg=(--config .gitleaks.toml); fi"$RUNNER_TEMP/gitleaks" git . "${cfg[@]}" --log-opts="$range" --redact --no-bannerSo a
.gitleaks.tomlat the repo root is picked up automatically. gitleaksversion is pinned at line 40 (
GL_VERSION: 8.30.1), which this PR was verifiedagainst.
Narrowness proof (gitleaks 8.30.1, local, not committed)
no leaks found(the publicaddresses are exempt).
Stripe key (
sk_live_…), a GitHub PAT (ghp_…), a0x-prefixed 64-hexprivate key, and a generic
api_key = '…'— and rescan with this config→
leaks found: 4. All four are still flagged (stripe-access-token,github-pat,generic-api-key×2); the public addresses remain exempt..gitleaks.toml.Real secret still flagged after allowlist: YES.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Vv2gVzy5XLFKg48yckN9YQ