Repository navigation
Conversation
The GitHub Actions recipe in docs/ci-integration.mdx piped the Gitleaks release tarball from curl straight into tar with no integrity check. Download the archive and its published checksums file, verify it with sha256sum -c, then extract. Raised in NVIDIA#603. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: HetCreep <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
I reviewed the diff and tested the step in a Debian container under bash -e without pipefail, which is GitHub's default shell. The check works as written. It fails closed on a mismatched archive, a missing or CRLF checksum line, and an empty checksums file, and a genuine release still installs. The CHANGELOG entry sits under Unreleased → Documentation, and no test asserts the old recipe text.
Three inline comments:
- P2: check against a pinned digest instead of a checksums file from the same release.
- P3: download into
$RUNNER_TEMP, with--retry. - P3: a non-blocking follow-up for maintainers about the managed Gitleaks install.
The two suggestion blocks work together. Applying both gives exactly the step I tested: a genuine archive installs, a tampered one fails with exit 1, and nothing is left in the checkout.
Check the download against the SHA-256 already pinned in scanner_install.py and ci/Dockerfile.tier1 instead of a checksums file from the same release, which a replaced release can replace as well. Download into $RUNNER_TEMP so the archive stays out of the checkout, and retry the request as ci/Dockerfile.tier1 does. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: HetCreep <[email protected]>
|
Thanks for the thorough review and the container repro. I checked the points against main: the digest matches the pin in Pushed 4cab9ae, which applies both suggestions: a pinned I ran the check against a fake archive locally (genuine passes; a tampered archive and a wrong digest both exit 1 with nothing extracted). I did not run the full workflow on a GitHub runner. I left the managed-install question and the optional drift-guard test for the maintainers. |
|
Review follow-up on Re-reviewed the current pinned-digest implementation against the existing comments. The same-origin checksums weakness and checkout-pollution/retry issues are addressed in source. Independently downloaded the genuine Gitleaks 8.30.0 linux/x64 release, verified the pinned SHA-256, extracted it and ran |
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: HetCreep <[email protected]>
NVIDIA#630 landed the same pinned-digest Gitleaks step on main with its own CHANGELOG entry under Changed, so this bullet repeated it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
|
Thanks @HetCreep for raising #603 and for this fix. The pinned-digest Gitleaks step and the That left this PR with only a second CHANGELOG entry for the same change, so I dropped it in 3e9f94d and am closing this as superseded by #630. Thanks again for the careful write-up and the quick turnaround on the review. |
Summary
The GitHub Actions CI recipe in
docs/ci-integration.mdxdownloaded the Gitleaks release tarball and piped it straight fromcurlintotarwith no integrity check. A reader who copies the recipe runs whatever that URL returns.This change downloads the archive into
$RUNNER_TEMP(with--retry 3) and verifies it withsha256sum -cagainst a SHA-256 digest pinned in the recipe, the same value already pinned inscanner_install.pyandci/Dockerfile.tier1, then extracts it. No behavior change for a genuine release; it fails closed if the archive does not match. The digest must be updated together withGITLEAKS_VERSION.Scoped to the checksum fix only. Two related points from the same review — the recipe pinning mutable action/tool tags while the repo's own workflows SHA-pin everything, and the
jqquality gate passing on an emptyquality_summary— are described in #603 for maintainer direction rather than forced here.Closes part of #603.
Verification
make lint— could not run the pinned Fern CLI in this environment; the edit stays inside the existing ```yaml code fence, so MDX structure is unchanged.make test— N/A (docs-only)make build— N/A (docs-only)Release Impact
CHANGELOG.md🤖 Generated with Claude Code