Skip to content

ci: allowlist secret fixtures by value instead of commit - #77

Merged
ElbertePlinio merged 1 commit into
mainfrom
fix/gitleaks-allowlist
Sep 3, 2026
Merged

ElbertePlinio merged 1 commit into
mainfrom
fix/gitleaks-allowlist

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

Why

gitleaks fingerprints in .gitleaksignore are pinned to a commit SHA, and CI checks out with fetch-depth: 0, so the scan covers every branch on the remote. Any rebase, squash-merge, or cherry-pick of a branch carrying a test fixture produces a new SHA and turns main red until another fingerprint lands. That happened on every merge in the #64 stack, and it is why #70 is red right now.

What

Replace .gitleaksignore with a .gitleaks.toml that extends the default rules and allowlists the four synthetic fixture values by exact anchored regex:

  • the jwt.io HS256 sample token (packages/core tests)
  • the {"sub":"picklab"} placeholder JWT (packages/browser tests)
  • the counting-pattern PAT ghp_0123…abcde (packages/cli telemetry test)
  • api_key=abc123 from the CLI secret-shape sweep (crates/pickforge-cli tests)

The allowlist follows the string, not the commit. No rule and no path is exempted, so a real secret in a test file is still reported.

Verification

Local gitleaks 8.30.1 (same as CI) against a clone with every remote branch and PR head fetched, ignore file removed:

Scan Result
All refs, no config 9 leaks, all four fixture values
All refs, this config 242 commits, no leaks
Throwaway commit with a different PAT and JWT, this config 2 leaks reported

Closes #60.

gitleaks fingerprints are pinned to a commit SHA, and CI scans every branch
on the remote. Any rebase, squash-merge, or cherry-pick of a branch carrying a
test fixture produced a new SHA and turned main red until another fingerprint
was added. That happened on every merge of the #64 stack.

Replace .gitleaksignore with a .gitleaks.toml that extends the default rules
and allowlists the four synthetic fixture values by exact anchored regex. The
allowlist follows the string, not the commit, so history rewrites stop
mattering. Nothing else is exempt: a real secret in a test file is still
reported, and a fresh PAT or JWT with a different value was verified to fail
the scan under this config.

Verified locally with gitleaks 8.30.1 against a clone with every remote ref
fetched: 242 commits, no leaks, with the ignore file removed.

Closes #60.
@ElbertePlinio
ElbertePlinio merged commit da870c5 into main Sep 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install the enforced TypeScript gate baseline

1 participant