fix(dispatcher): Verify installer attestation before running self-update#1671
Conversation
The dispatcher self-update flow (uloop update / scheduled 24h refresh) now requires a valid Sigstore attestation for install.sh / install.ps1 before it will execute the downloaded installer. Fail-closed on bundle-missing, network-failure, digest-mismatch, and identity-mismatch — the .sha256 file ships from the same origin as the asset and cannot certify authenticity if that origin is compromised, so attestation is the true root of trust. - update.Command gains a ReleaseTag field so the verifier can resolve the tag to a commit SHA and bind it to the certificate's Source Repository Digest extension (OID 1.3.6.1.4.1.57264.1.13). - New attestation_verify.go wires the attestation package into the dispatcher package with a swappable var so tests can isolate download/checksum behavior from real network + sigstore verification. Also exposes the two publish-workflow SANs (dispatcher-publish, native-cli-publish) for Phase B3's runner-download reuse. - downloadVerifiedUpdateInstaller now calls the verifier with attestationDispatcherPublishWorkflowPath after checksum verification succeeds. - Tests cover happy path, attestation failure fail-closed, and the workflow path / release tag actually passed through to the verifier.
|
Warning Review limit reached
Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ 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 |
Follow-up to Fable 5 review on PR #1671. The verifier previously relied on the git-refs endpoint returning 404 for an empty tag, which meant correctness depended on remote behavior for what should be a local contract violation (this repo's CLAUDE.md standardizes on contract programming). Fail closed locally with ErrVerificationFailed and add a test so a future refactor cannot silently regress the guard.
Summary
The dispatcher self-update flow (
uloop updateand the scheduled 24h refresh) now requires a valid Sigstore attestation forinstall.sh/install.ps1before executing the downloaded installer.This is Phase B2 of TODO 2 (
docs/spec— 2026-07-09 uloop CLIインストールのセキュリティ改善). Phase B1 (verifier package, PR #1670) is already merged; Phase B3 will wire the same verifier into the project runner download path.User Impact
Before: A compromised GitHub releases origin could serve a malicious
install.sh+ matchinginstall.sh.sha256, and the dispatcher would happily execute it — sha256 alone cannot prove authenticity when the checksum ships from the same origin as the asset.After: The installer will not run unless the bundled
.sigstore.jsoncryptographically verifies against Sigstore's public-good trust anchor, the workflow identity matches.github/workflows/dispatcher-publish.ymlon an allowed ref (refs/heads/v3-betaorrefs/heads/main), and the release tag's commit SHA matches the certificate's Source Repository Digest extension. Fail-closed on bundle-missing, network-failure, digest-mismatch, and identity-mismatch.Changes
update.Commandgains aReleaseTagfield so the verifier can resolve the tag to a commit SHA for OID1.3.6.1.4.1.57264.1.13binding.attestation_verify.gowires theinternal/attestationpackage into the dispatcher package with a swappable var (verifyReleaseAssetAttestation) so unit tests can isolate download/checksum logic from real Sigstore verification. Exposes both publish-workflow SANs (dispatcher-publish, native-cli-publish) so Phase B3 can reuse the constants.downloadVerifiedUpdateInstallercalls the verifier withattestationDispatcherPublishWorkflowPathafter the sha256 check succeeds.Verification
scripts/check-go-cli.sh— 0 lint issues across all Go modulesgo test ./...incli/dispatcher/— all packages pass, including attestation + dispatcherRefs:
docs/plans/spec, TODO 2 Phase B2