Skip to content

ci(security): pin and verify the Trivy installer - #996

Merged
MBombeck merged 1 commit into
mainfrom
ci/pin-trivy-installer
Sep 16, 2026
Merged

MBombeck merged 1 commit into
mainfrom
ci/pin-trivy-installer

Conversation

@MBombeck

Copy link
Copy Markdown
Owner

The Trivy install step fetched contrib/install.sh from a tag and piped it into a shell. A tag can be moved to other content, so the job ran whatever that ref pointed at with the runner's privileges. Code scanning flagged it: Scorecard Pinned-Dependencies, "downloadThenRun not pinned by hash" (alert 88).

The script now comes from the commit v0.74.0 points at, is verified against its SHA-256 before it runs, and the installed binary version is unchanged. Both values are in the step's env and get bumped together.

The Trivy install step piped a script fetched from a tag straight into a
shell. A tag can be moved to other content, so the job ran whatever the
ref pointed at, with the runner's privileges, and the Scorecard check
flagged it as an unpinned download-then-run.

The script now comes from the commit the tag points at, is checked
against its SHA-256 before it runs, and the binary version stays what it
was.
@MBombeck
MBombeck merged commit 78996e6 into main Sep 16, 2026
24 checks passed
@MBombeck
MBombeck deleted the ci/pin-trivy-installer branch September 16, 2026 11:46
@MBombeck MBombeck mentioned this pull request Sep 16, 2026
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