fix(install): make provenance check opt-in#1325
Conversation
a330f80 to
c5c224a
Compare
|
I’m not convinced we should run My understanding is that I’d prefer one of these approaches instead:
If we keep the current automatic
So my preference would be to remove the automatic dependency on |
c5c224a to
bc20a9a
Compare
|
Both points confirmed and fixed, and I took the broader suggestion — provenance is now opt-in.
On the two specifics:
Verified end-to-end: default skips without calling gh; strict mode dies with a clear message on missing/old/unauthenticated gh (2.55.0) and verifies on 2.95.0. |
58159d5 to
96e329d
Compare
gh attestation verify downloads Sigstore's trusted root, which since Rekor v2 GA contains an Ed25519 (PKIX_ED25519) tlog key that gh builds older than 2.56.0 cannot parse. The installers ran gh automatically and failed closed, so an outdated (or unauthenticated) gh on PATH aborted the whole install even though the sha256 checksum had already matched (END-609). gh is not a ggshield dependency: its version/auth/network state is ambient, and even a public attestation lookup needs an authenticated gh, so running it by default is fragile and usually cannot run anyway. Make it opt-in in both install.sh and install.ps1. By default the install relies on the mandatory sha256 check and prints the manual `gh attestation verify` command. Set GGSHIELD_REQUIRE_ATTESTATION=1 (or true/yes/on) to require provenance: it then fails closed if gh is missing, older than 2.56.0, unauthenticated, or the artifact does not verify. Refs: END-609 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
96e329d to
f82ddd4
Compare
Fixes END-609: the install aborted because
gh attestation verifyfails whenghis older than 2.56.0 — its bundledsigstore-gocan't parse the Ed25519 (PKIX_ED25519) tlog key in Sigstore's trusted root. The installers ranghautomatically and failed closed, so an outdated (or unauthenticated)ghon$PATHblocked the whole install even though the sha256 checksum had already matched.Following @clement-tourriere's review:
ghis not a ggshield dependency, and a public attestation lookup still needs an authenticatedgh, so running it automatically is fragile and usually can't run anyway. Build-provenance verification is now opt-in, in bothinstall.shandinstall.ps1:ghis not invoked. The installer prints the manualgh attestation verifycommand.GGSHIELD_REQUIRE_ATTESTATION=1(also acceptstrue/yes/on): runsgh attestation verifyand fails the install ifghis missing, older than 2.56.0, unauthenticated, or the provenance doesn't verify.Also addressed from review:
install.ps1got the same opt-in design (it previously had the identical fail-closed bug).1truthy value (true/yes/on) now enables it too, and an unrecognized value warns instead of silently skipping.gh auth statusprecheck distinguishes "not logged in" from a real provenance mismatch.scripts/install/README.mdnow describes the opt-in behavior and documentsGGSHIELD_REQUIRE_ATTESTATION.Verified: 8/8 unit cases on the gate logic; earlier end-to-end runs with real
ghbinaries (default skips without invoking gh; strict dies clearly on missing/old/unauthenticated gh and verifies on 2.95.0);bash -n+ shellcheck clean oninstall.sh.install.ps1was not lintable locally (no pwsh).Refs: END-609