Repository navigation
Verify the gitleaks binary before CI runs it (#885) - #888
Merged
Merged
Conversation
The security workflow installed gitleaks with curl | tar and executed it unchecked. The expected SHA-256 is now pinned in the workflow and checked with sha256sum -c before extraction; a tampered tarball is refused before tar runs. TestWorkflowsVerifyWhatTheyDownload forbids piping downloads into tar or a shell and requires curl -o downloads to be checked in the same step. Its first version missed the original step because the pipe sat after a line continuation. Closes #885
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #885
The security workflow installed gitleaks with
curl | tarand executed it with nothing checked — the scanner that decides whether secrets are present was itself unverified.Fix: the expected SHA-256 is pinned in the workflow and checked with
sha256sum -cbefore extraction. Pinned in the step rather than read from the release'schecksums.txt, because a file fetched alongside the download can be replaced alongside it. Cross-checked when pinned: the published checksum and a locally computed hash of the tarball agree (5bc41815…e3ba).Run locally, the exact step accepts the genuine tarball and refuses a one-byte-modified one before
tarruns.Gate:
TestWorkflowsVerifyWhatTheyDownload— no workflow may pipe a download intotaror a shell, and anycurl -odownload must be checked withsha256sum -cin the same step. Its first version read physical lines and passed the original step, whose| tarsat after a\continuation; it now joins continuations, and fails both on the original step and on the new step with the check removed. No other workflow currently downloads anything this way.The comment on the step records that upgrading gitleaks changes
.gitleaks.toml's allowlist semantics (see #881).🤖 Generated with Claude Code