feat: pin downloaded binaries with sha256 verification#362
Conversation
Merging this PR will not alter performance
|
da97e17 to
95901e4
Compare
Greptile SummaryThis PR introduces SHA-256 pinning for every binary the runner downloads at install time. A new
Confidence Score: 5/5Safe to merge; all production download paths are correctly pinned and verified. The Rust-side changes are clean: src/executor/helpers/introspected_golang/go.sh — the Important Files Changed
|
95901e4 to
b812c0b
Compare
Every binary the runner downloads at install time (the patched valgrind `.deb`, the memtrack installer, the exec-harness installer, the mongo-tracer installer) is now SHA-256-pinned. Each artifact's version, URL template, and expected hash live together in `src/binary_pins.rs`; the download helper rejects an install whose bytes don't match. The valgrind .deb version is derived from `VALGRIND_CODSPEED_VERSION` + `VALGRIND_DEB_REV`, so the constant used for installation detection and the constant used for download URLs cannot drift. A CI-gated network test (`GITHUB_ACTIONS=true`) downloads every pinned URL and asserts the hash matches the declared pin, catching stale or mistyped hashes before release. CONTRIBUTING.md documents the bump workflow. Co-Authored-By: Claude <noreply@anthropic.com>
…tion The introspected `go test` shim now installs `codspeed-go-runner` from a pinned URL whose installer bytes are verified against a sha256 recorded in `go.sh`. The mapping covers every released installer (0.1.1 through 1.2.0) and is stored as a `version sha256` table looked up via awk, so version bumps are a one-line edit. The pinned default replaces the previous "latest" fallback, which silently introduced breaking changes; users can still override via the `go-runner-version` CLI option. A CI-gated Rust test (`GITHUB_ACTIONS=true`) parses the table out of the embedded `go.sh`, downloads each installer in parallel, and asserts its bytes hash to the declared pin — same gating as the existing `binary_pins` network check. Co-Authored-By: Claude <noreply@anthropic.com>
b812c0b to
394df99
Compare
Every binary the runner downloads at install time (the patched valgrind
.deb, the memtrack installer, the exec-harness installer, the mongo-tracer installer) is now SHA-256-pinned. URLs and expected hashes live together in a newPinnedBinaryenum insrc/binary_pins.rs, and the download helper (download_pinned_file) rejects the install — and removes the partial file — if the bytes don't match the declared digest.Until now, the runner trusted whatever it pulled from GitHub releases / S3 to be the artifact that was published. That trust is implicit and we have no recovery if an artifact is replaced. Pinning the hashes alongside the version constants makes the supply-chain assumption explicit and verifiable at install time.
Bumping a pinned version now requires updating both the version constant and the matching
PinnedBinary::sha256arm — for valgrind, one hash per supported(distro_version, arch)combination.CONTRIBUTING.mdis updated with the regeneration workflow and the release checklist points at the new location.