Skip to content

Gitleaks: narrow the fixture allowlist and run the guard in CI - #2354

Merged
remigiusz-antczak merged 2 commits into
mainfrom
fix/gitleaks-guard-5
Nov 13, 2026
Merged

remigiusz-antczak merged 2 commits into
mainfrom
fix/gitleaks-guard-5

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

Combines #2351 and #2352 into one commit and fixes a CI failure in #2351. The per-PR test legs run every test script with CI set but do not install gitleaks, so the guard failed with "gitleaks not installed". Now only REQUIRE_GITLEAKS=1 makes the guard strict, and the dedicated gitleaks job sets it.

Tests: 3/3 guard runs (PASS with gitleaks; SKIP with CI=1 and no gitleaks; FAIL with REQUIRE_GITLEAKS=1 and no gitleaks). actionlint is clean and the size gate passes.

🤖 Generated with Claude Code

remigiusz-antczak and others added 2 commits November 13, 2026 13:20
.gitleaks.toml exempts only the fictional fixture values in the two secret test scripts instead of whole files; its comment states the value regexes apply repo-wide. .gitleaksignore lists the fingerprints of the 19 remaining history hits, all triaged as fictional, so a history scan reports 0 findings. test_gitleaks_allowlist.sh asserts the 0-finding history scan (skipped on shallow checkouts), counts a probe as detected only on exit 1 plus an aws-access-token report (any other exit fails), and fails when gitleaks is missing under REQUIRE_GITLEAKS=1.

Add a gitleaks job to ci.yml: full-history checkout without persisted credentials, gitleaks 8.30.1 installed from its release tarball and verified against a hardcoded sha256, then REQUIRE_GITLEAKS=1 bash scripts/test_gitleaks_allowlist.sh. The gates aggregate needs it; job permissions stay contents: read.

The guard is strict (missing gitleaks, shallow history or no .git FAILs) only when REQUIRE_GITLEAKS=1 is set. Keying strictness on CI broke the per-PR test legs, which run every test script with CI set but do not install gitleaks; they now SKIP it.

Supersedes #2351 and #2352.

Tests: 3/3 test_gitleaks_allowlist.sh runs (PASS with gitleaks; SKIP with CI=1 and no gitleaks; FAIL with REQUIRE_GITLEAKS=1 and no gitleaks). actionlint clean; size gate ok.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@remigiusz-antczak
remigiusz-antczak merged commit dd2c027 into main Nov 13, 2026
12 checks passed
@remigiusz-antczak
remigiusz-antczak deleted the fix/gitleaks-guard-5 branch November 13, 2026 14:39
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.

1 participant