Repository navigation
Conversation
|
I ran the branch's
The 0.1.0 row is the useful one. That release predates Separately, I checked the 0.3.9 archive by hand against the wrong versions: it verifies as 0.3.9 and is rejected as 0.3.8 or 1.3.9, so the tag in the identity regex does its job. The failing "Proofline gate" check says the author needs a Proofline seat, and the |
|
Follow-up for |
|
@mohsen1 Hello, Rodrigo here ( everything else was AI as expected). I just make a simple change to avoid malicious actor inserting a compromise binary. These days this simple stuff can protect you from bigger issues. I will try to find some time to build some stronger feature as well, but I though this quick one would be useful |
Check build provenance in the installer with PROOFLINE_VERIFY_PROVENANCE=1
Who this helps
People who install the CLI on machines where a replaced binary would matter: CI runners, build hosts, laptops with cloud credentials.
The release job already records SLSA build provenance for every archive (
actions/attestinrelease.yml). For v0.3.9, all five archives carry an attestation signed byprooflinedev/cli/.github/workflows/release.yml@refs/tags/v0.3.9. Nothing checks it yet:install.shcompares the archive withSHA256SUMS, but both files come from the same R2 origin. Anyone who can write the bucket (for example with a leakedCLI_RELEASE_R2_CREDENTIALS) can replace both, and the check still passes.What it adds
curl -fsSL https://proofline.sh/cli | PROOFLINE_VERIFY_PROVENANCE=1 shWith
PROOFLINE_VERIFY_PROVENANCE=1, after the existing checksum check and before extracting anything, the installer runs:vX.Y.Ztag or by amaindispatch, so only those two refs pass. The tag is the version being installed, so an older, genuine archive served as a newer version fails.ghis missing, the installer stops before downloading anything, as--setupalready does withoutgit. If verification fails, nothing is installed. Any value other than1,0or unset is refused, so a typo can't silently turn the check off.gh.shellcheck -s sh install.shis clean.Tests
install.shhad no tests.tests/install.rsruns the real installer under/bin/shwith a PATH that contains only the tools it uses, a stand-incurlthat serves a locally built release, and a stand-ingh. It needs no network and no real GitHub CLI. It covers:ghis never called;gharguments, including the identity regex;PROOFLINE_VERIFY_PROVENANCE=1withoutgh, which makes zero downloads;ghruns.I confirmed that each test fails when its rule is removed from
install.sh. The tests are#![cfg(unix)], matching the installer.I also ran the new function against the published v0.3.9
aarch64-apple-darwinarchive with the realgh. It passes for0.3.9and is rejected when the same archive is claimed as0.3.8or1.3.9.cargo fmt --check,cargo clippy --locked --all-targets -- -D warningsandcargo test --lockedpass. The one exception,agent_install::unattended_registration_preserves_settings_and_uses_the_installed_binary, fails the same way on an unmodifiedmainon my macOS machine. No dependencies were added.Possible follow-ups (not in this PR)
PROOFLINE_VERIFY_PROVENANCE=1inhosted-install.yml, which already hasgh. Following the README, I'm suggesting this rather than changing the workflow myself.proofline updatethe same check. In Rust that needs a Sigstore verifier, a larger and separate change.ghis present and signed in.