fix(ci): allowlist lockfile sha256 hashes in gitleaks working-tree scan - #1178
fix(ci): allowlist lockfile sha256 hashes in gitleaks working-tree scan#1178groupthinking wants to merge 1 commit into
Conversation
The default gitleaks square-access-token rule flags the high-entropy SHA-256 package-integrity digests in uv.lock (e.g. line 5129, the parso sdist hash) as a leaked credential. Because the working-tree gitleaks job scans uv.lock on every branch, this false positive fails the scan on essentially every open PR, blocking the green gate repo-wide. Add a line-scoped regex allowlist for `hash = "sha256:<hex>"` digests so lockfile integrity hashes are no longer treated as secrets, while any genuine token elsewhere in a lockfile is still scanned. Verified with gitleaks 8.18.4 (the version CI installs): the scan goes from "leaks found: 1" to "no leaks found" (exit 1 -> 0). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L1YVe2AKQxtpn5LKpJW6BE
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
Agent Completion Truth Gate: BLOCKEDReasons: Machine-readable verdict{
"details": {
"invalid_fields": [
"issue.number",
"policy.agent_login",
"policy.run_id"
]
},
"reasons": [
"invalid_payload"
],
"verdict": "blocked"
} |
Status: code-CI green; blocked only by the pre-existing governance gate + human mergeWhat this PR does (verified): the Code CI on The two red checks are both the repo's governance-gate family, not a defect in this change:
Merge is a human decision: base is protected Generated by Claude Code |
Canonical issue
No canonical issue — repo-hygiene CI fix surfaced while triaging the
gitleaks (working tree)failure that appears on every open PR (observed on the dependabot bump #1171, but present repo-wide).Outcome
The
gitleaks (working tree)job stops failing on a false positive. The defaultsquare-access-tokenrule was flagging the high-entropy SHA-256 package-integrity digests inuv.lock(uv.lock:5129, theparsosdist hash) as a leaked credential. Because that job scansuv.lockon every branch offmain, the false positive was failing the scan — and blocking the green gate — on essentially every open PR. After this change the scan reportsno leaks found.Scope
.gitleaks.toml— one line-scoped regex allowlist entry.hash = "sha256:<hex>"lines only, so a genuine token appearing elsewhere in a lockfile (e.g. a credentialed private-index URL) is still scanned.Risk
hash = "sha256:..."line would be missed. Real credentials do not take that shape (Square tokens aresq0atp-…/EAAA…base64, not lowercase hex), so this is not a realistic exposure..gitleaks.tomlreturns to the prior allowlist. Nothing else depends on it.Verification
Verified with gitleaks 8.18.4 (the exact version CI installs) against the current head on a clean tree off
main(ad7e2c1):gitleaks detect --no-git --config .gitleaks.toml --redact --exit-code 1on the pre-fix config →leaks found: 1,RuleID: square-access-token,File: uv.lock,Line: 5129, exit 1.no leaks found, exit 0.regexTarget = "line"withhash = "sha256:[0-9a-f]{64}"; only matches integrity-digest lines.Production evidence
Not applicable as a runtime artifact: this PR changes only
.gitleaks.toml(a CI config file). It touches noapps/webfile, no route, and no dependency, so the deployed bundle for this head is byte-identical tomain. The relevant evidence is the behavioural before/after above (exit 1 → exit 0 with gitleaks 8.18.4).Agent handoff
main).Generated by Claude Code