Skip to content

feat(release): verify GitHub build attestation in the install path #169 - #1810

Closed
nc9 wants to merge 3 commits into
mainfrom
r3/release-attestation-169
Closed

nc9 wants to merge 3 commits into
mainfrom
r3/release-attestation-169

Conversation

@nc9

@nc9 nc9 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Soft-verify per maintainer decision A5. Part of #164. Closes #169.

What

  • install.sh, install.ps1, squirrel self update: after the sha256 check, when gh is present, new enough and logged in, run gh attestation verify <file> --repo squirrelscan/squirrelscan. A mismatch fails, nothing is installed or run. gh absent, too old, or not logged in: visible warning, sha256 alone decides. (A logged-out gh cannot verify, so it counts as absent, never as a pass.)
  • Trust root is GitHub/Sigstore. The release workflow already attests release-assets/* (binaries and manifest.json) with actions/attest-build-provenance, so no workflow change.
  • Docs: new "Verifying a release" section in quickstart (manual command, behaviour table), self.mdx updated. CHANGELOG Added bullet.

Acceptance criteria

  • Artifacts and manifest carry attestation from the release workflow: .github/workflows/release.yml github-release job (existing, subject-path release-assets/*).
  • Automatic verification with degrade-to-warning: scripts/install-attestation-169.test.ts (match, mismatch, not logged in, too old, gh absent), apps/cli/tests/self/attestation.test.ts (7 tests incl. absent gh on an empty PATH), updater.test.ts "a mismatching attestation fails the auto-update before anything is installed".
  • Manual verification documented: docs/quickstart.mdx "Verifying a release".
  • Trust root not on the download origin: GitHub attestation service.
  • install.ps1: Test-ReleaseAttestation with match, mismatch, not-logged-in, too-old and absent checks in scripts/install-ps-contract.test.ps1. pwsh is not available in the authoring sandbox, so these were NOT run locally; CI's installer job runs them.

Review fixes (lead review)

  • Every gh call is bounded: 15s for --help and auth status, 120s for verify. install.sh uses timeout/gtimeout, else a background process with a kill watchdog (macOS). install.ps1 uses Start-Process -PassThru with redirected output, WaitForExit(ms), then Kill. SQUIRREL_TEST_GH_TIMEOUT_SECS overrides the deadlines as a test seam only.
  • A probe timeout is a skip with a warning. A verify timeout fails closed: gh attestation verify timed out after 120s, nothing was installed. In attestation.ts, code === null gives that on verify and a 'timed out' skip reason on a probe.
  • gh auth status --hostname github.com in all three paths.
  • self update prints Attestation verified: built by squirrelscan/squirrelscan on a pass. self.mdx says background auto-updates skip the check silently when gh is unusable.
  • Docs: "Verifying a release" now sits below the body of "If GitHub is blocked on your network", before Homebrew. The misplaced install.sh comment is back above download_and_install.
  • New tests: install.sh hanging gh shim (probe skip, verify fail-closed, no-timeout watchdog), CLI runner returning {code: null}, interactive verified line. The new install.ps1 timeout checks were NOT run (no pwsh here); CI runs them.

Gates

  • After the review fixes: bun test scripts/install-attestation-169.test.ts apps/cli/tests/self/attestation.test.ts apps/cli/tests/self/updater.test.ts: 120 pass; make validate in docs: all checks pass; oxfmt clean.
  • Earlier run: bun test scripts/install-attestation-169.test.ts: 6 pass. install-contract 188 pass. install-path-setup + hardening-168 + install-test-env: 80 pass (with the new file).
  • bun test apps/cli/tests/self/updater.test.ts apps/cli/tests/self/attestation.test.ts: 104 pass.
  • bash -n install.sh ok; apps/cli tsgo clean, lint clean, format:check clean; cd docs && make validate: 62 pass.

Notes

  • No rule meta changed: private rule catalog does not need regenerating.
  • squirrelscan agent skill: no change needed.
  • Residual: releases before attestations were added (pre 2026-07) have none, so pinning one with a logged-in gh fails. --repo alone does not pin the signer workflow; a follow-up could add --signer-workflow.

🤖 Generated with Claude Code

nc9 added 3 commits November 13, 2026 04:38
…to github.com #169

gh probes get 15s and verify 120s in install.sh, install.ps1 and the CLI. A
probe timeout is a skip with a warning, a verify timeout fails closed.
self update prints the verified line, and the docs section moves below the
GitHub-blocked body.

Signed-off-by: Nik Cubrilovic <[email protected]>
…elf-hosted runners #169

--repo alone accepts attestations from any workflow on any branch. Add --cert-identity for release.yml@refs/heads/main and --deny-self-hosted-runners in install.sh, install.ps1 and the CLI, and in the manual command in docs/quickstart.mdx.

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 force-pushed the r3/release-attestation-169 branch from aedbe0d to dfe1fb0 Compare November 13, 2026 04:39
@nc9

nc9 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded: this change is on main via separate merges (rebasing bundle #1814 onto main skipped every code commit from #1810/#1806/#1809/#1812 as already applied).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(release): sign releases and verify provenance in the install path

1 participant