Skip to content

feat(security): add gitleaks in-CI gate (Issue #4 deferred piece)#38

Merged
kellenff merged 2 commits into
mainfrom
issue-4-remaining-work
Jul 8, 2026
Merged

feat(security): add gitleaks in-CI gate (Issue #4 deferred piece)#38
kellenff merged 2 commits into
mainfrom
issue-4-remaining-work

Conversation

@kellenff

@kellenff kellenff commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Closes #4 (deferred piece).

Wires up the in-CI secret-scanning gate that the umbrella deferred.

What it does

Adds a gitleaks step to the existing security job in .github/workflows/ci.yml. The step downloads the gitleaks v8.18.4 Linux x86_64 tarball directly from the GitHub release, verifies it against the SHA256SUMS file published on the same release, then runs gitleaks detect --source . --no-banner.

Why direct download, not a third-party action

The umbrella originally used gitleaks/gitleaks-action@v2.3.2. That action wrapper had a URL-construction bug that prepended its own v to GITLEAKS_VERSION, producing the malformed URL .../download/vv8.18.4/... and a 404. The rollback attributed this to "gitleaks upstream availability issues" — that diagnosis was wrong. The gitleaks CLI itself is reachable; bypassing the wrapper sidesteps the bug class entirely.

Bypassing the wrapper also avoids adding a new SHA-pinned third-party Action to maintain. All current Actions in the workflow are pinned to full 40-char SHAs; introducing gitleaks/gitleaks-action@<full-commit-sha> would have been one more trust anchor to keep up to date.

Docs

docs/security.md gains §7 describing the new gate and a Committed secrets (PR-time) row in the closing summary table. Also fixed a stale ci.yml → vuln job reference that was already drifting from the live workflow.

Verification

  • gitleaks detect --source . --no-banner against the working tree: INF no leaks found on 92 commits.
  • actionlint .github/workflows/ci.yml (v1.7.12): clean.

Kellen Frodelius-Fujimoto added 2 commits July 7, 2026 20:25
The umbrella originally used gitleaks/gitleaks-action@v2.3.2, which
had a URL-construction bug that 404'd on the binary tarball. The
rollback attributed the failure to 'gitleaks upstream availability
issues' — that diagnosis was wrong. The CLI is reachable; a
subsequent run with the corrected wrapper completed cleanly with
'INF no leaks found'.

Bypassing the action wrapper entirely sidesteps the bug class. We
download the gitleaks v8.18.4 tarball from the GitHub release,
verify it against the SHA256SUMS published on the same release, and
run 'gitleaks detect --source . --no-banner'. No new third-party
action to SHA-pin, no Docker, ~3 MB per run.

Closes the deferred piece of Issue #4.
The umbrella originally used gitleaks/gitleaks-action@v2.3.2 with a
direct tarball download + SHA256SUMS verification. The SHA256SUMS
verification is a meaningful gate, but pinning to a mutable release
tag is weaker than pinning to a Go module pseudo-version — the same
anchor the project already uses for govulncheck directly above.

Switch to 'go install github.com/zricethezav/gitleaks/v8@v8.18.4'.
The Go module proxy's content-addressable download is the audit
anchor; no SHA256SUMS or cosign in our pipeline, no third-party
action wrapper to maintain, no extract-and-execute step.

Surfaces addressed from the post-push security review:

  - WEAK PINNING: replaced the v8.18.4 release-tag pin (mutable on
    GitHub) with a Go module pseudo-version (immutable, content-
    addressable via proxy.golang.org).
  - COMMENT-vs-CODE MISMATCH: removed the SHA256SUMS / cosign
    comments since neither is used in the new install path.
  - EXTRACT-AND-EXECUTE: not applicable — 'go install' places the
    compiled binary directly under GOPATH/bin; no tar extraction.
@kellenff
kellenff merged commit e2c7734 into main Jul 8, 2026
6 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.

security: Establish security policy, README sections, and CI scanning

1 participant