Verify the Zig toolchain checksum and pin noz by commit - #162
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe PR adds weekly Dependabot updates for GitHub Actions. Both CI jobs verify Zig archives before extraction. The integration job checks out ChangesCI supply-chain hardening
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
The CI toolchain was fetched and executed without any integrity check.
The version was pinned, which is good, but nothing verified the bytes. The archive went straight from the network into
tarand then ontoPATHas the compiler that builds this relay. Anything able to affect that response, a compromised mirror or an intercepted connection, would have its output compiling and running in CI, and there was no point in the pipeline where a check could have failed. This ran in both jobs.Now the tarball is downloaded to disk, verified against a pinned SHA-256 published by ziglang.org, and only extracted if it matches:
Also adds
-fso an HTTP error page is a failure rather than something handed totar,--retry 3for transient network faults, andset -euo pipefailso a failing check actually stops the step.noz pinned by commit
The integration job cloned
privkeyio/nozat--branch v0.2.1. A tag is a moving pointer; a commit is not. Now pinned to848a2e3, which is whatv0.2.1currently resolves to, so this is not a version change. Swapped--depth 1for--filter=blob:none, since a shallow clone cannot check out an arbitrary commit.Dependabot
Added for
github-actions, weekly and grouped, matching the other repositories. Zig has no Dependabot ecosystem, sobuild.zig.zonand the toolchain checksum stay manual; the config records that.Test plan
Verified locally rather than by reading:
70e49664...ba3d00confirmed against the actual bytes served (55478392 bytes, matching the published size)sha256sum -cpasses, extract,zig versionreports0.16.0sha256sum -creportsFAILEDand exits 1, so the step aborts beforetarrunsnozpin verified:--filter=blob:noneclone pluscheckout --detach 848a2e3succeeds, andv0.2.1resolves to that same commitThe checksum is per-platform and per-version; changing
ZIG_VERSIONrequires updatingZIG_SHA256from the same index, and a mismatch fails loudly.Summary by CodeRabbit