Repository navigation
Verify SHA-256 checksums for yq, grpcurl and stern downloads - #2
Merged
Merged
Conversation
Previously only kubectl was checksum verified. The other three binaries were fetched over HTTPS with no integrity check, so a tampered release asset would have been baked into the image silently. Each download now goes to /tmp, is verified against the upstream checksums file, and only then installed/extracted. yq publishes a multi-hash table, so the SHA-256 column is located via checksums_hashes_order instead of hard-coding a column index. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014iDTyB5N8EdZyyZo4ymUVR
The grpcurl and stern blocks used `(cd /tmp && sha256sum -c ...)`, which hadolint flags as DL3003. Look up the expected hash with awk and verify by absolute path instead, as the yq block already does. This also drops the temporary .sha256 files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014iDTyB5N8EdZyyZo4ymUVR
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.
Summary
Only kubectl was checksum verified. yq, grpcurl and stern were fetched over HTTPS with no integrity check, so a tampered release asset would have been baked into the image silently.
Each download now goes to
/tmp, is verified against the upstream checksums file, and only then installed or extracted. yq publishes a multi-hash table, so the SHA-256 column is located viachecksums_hashes_orderrather than a hard-coded index.Testing
No Docker daemon was available in my environment, so I could not do a full image build. I ran the three changed
RUNblocks as shell against the real v4.47.1 / 1.9.3 / 1.33.0 release assets:OKand produce binaries of the correct architecture.The PR workflow (hadolint plus native amd64/arm64 build and smoke test) will give the full build confirmation.
Reliability notes
Part of an SRE review series (supply chain hardening).
Generated by Claude Code