Skip to content

ci: pin gitleaks and verify the tarball (86cb43y3t) - #7

Merged
jonnyspicer merged 1 commit into
mainfrom
ci/pin-gitleaks
Aug 18, 2026
Merged

ci: pin gitleaks and verify the tarball (86cb43y3t)#7
jonnyspicer merged 1 commit into
mainfrom
ci/pin-gitleaks

Conversation

@jonnyspicer

Copy link
Copy Markdown
Contributor

Closes ClickUp 86cb43y3t.

secret-scan.yml resolved gitleaks' latest release at run time and piped the tarball straight into tar.

Unpinned

This is a required check, so a new gitleaks release could change what the gate accepts with no commit in this repo — the same failure mode the retina repos' # Pinned deliberately ruff pins exist to avoid. It also made a red run ambiguous: a new finding and an upstream rules change look identical.

Pinned to 8.30.1, which is the current latest (published 2026-03-21), so this is a no-op for behaviour today — it freezes where we already are rather than moving us.

Unverified

Piping the download into tar extracts bytes nothing has checked. The pin alone fixes reproducibility, not tampering, so the tarball is now written to disk and checked against the published SHA-256 before extraction.

curl -sSL also lacked -f, so an HTTP error page was written into the pipe and tar reported a confusing error instead of curl reporting the real one. Added -f, plus --retry 3 --retry-delay 5 for the transient TLS failure seen on ops#2:

curl: (60) SSL certificate problem: self-signed certificate
##[error]Process completed with exit code 60.

Dropping the releases/latest lookup also removes the jq dependency and one network call.

Verification

Run locally (this box is arm64, so the sudo install and gitleaks version lines were not exercised — CI runners are x64):

  • download + checksum + extract succeeds
  • wrong checksum → exits 1, before tar runs
  • bad version → curl exits 22, before the checksum runs

Both failure paths abort rather than falling through to a green job, which was the specific thing the ticket asked to confirm.

Bumping later

Change GITLEAKS_VERSION and GITLEAKS_SHA256 together. Each release ships gitleaks_<VERSION>_checksums.txt.

🤖 Generated with Claude Code

secret-scan.yml resolved gitleaks' latest release at run time and piped the
tarball straight into tar. Two problems, neither introduced by the work that
noticed them.

Unpinned: this is a required check, so a gitleaks release changed what the
gate accepts with no commit in this repo — the failure mode the retina repos'
"Pinned deliberately" ruff pins exist to avoid. It also made a red run
ambiguous between a real new finding and a rules change upstream.

Unverified: piping the download into tar extracts bytes nothing has checked,
and `curl -sSL` without -f writes an HTTP error page into the pipe rather than
failing, so tar reported the confusing error instead of curl reporting the
real one.

Pins 8.30.1 (current latest, so no behaviour change today), verifies the
published SHA-256 before extracting, and adds --retry for the transient TLS
failure seen on ops#2. Drops the releases/latest lookup, so the step no longer
needs jq or a second network call.

Verified locally: download + checksum + extract succeeds; a wrong checksum
exits 1 and a bad version exits 22, both before the next stage runs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jonnyspicer
jonnyspicer merged commit 6d829e4 into main Aug 18, 2026
3 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.

1 participant