Skip to content

Verify SHA-256 checksums for yq, grpcurl and stern downloads - #2

Merged
ngpayyappilly merged 2 commits into
mainfrom
claude/checksum-verification
Nov 12, 2026
Merged

ngpayyappilly merged 2 commits into
mainfrom
claude/checksum-verification

Conversation

@ngpayyappilly

Copy link
Copy Markdown
Owner

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 via checksums_hashes_order rather 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 RUN blocks as shell against the real v4.47.1 / 1.9.3 / 1.33.0 release assets:

  • amd64 and arm64: all three verify OK and produce binaries of the correct architecture.
  • Negative test: a corrupted stern hash fails with exit 1.

The PR workflow (hadolint plus native amd64/arm64 build and smoke test) will give the full build confirmation.

Reliability notes

  • Fails closed: a missing or changed checksum entry aborts the build.
  • Temp files are removed in the same layer.

Part of an SRE review series (supply chain hardening).


Generated by Claude Code

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
@ngpayyappilly
ngpayyappilly merged commit 6510965 into main Nov 12, 2026
4 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.

2 participants