Skip to content

security: sign CLI release artifacts with keyless cosign + SLSA (#430) - #433

Merged
scttfrdmn merged 2 commits into
mainfrom
feat/cosign-signing
Jul 22, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
feat/cosign-signing

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Part of the suite-wide supply-chain effort (#344). Signs the downloadable spawn CLI artifacts (Homebrew/Scoop/manual), which shipped with checksums.txt only.

Separate from spored signing. spored is already KMS-signed + boot-verified fail-closed (#440); that S3-upload step in this workflow is untouched. This PR adds cosign signing for the CLI GoReleaser artifacts.

What

  • .goreleaser.yaml — signs: block runs keyless cosign sign-blob --bundle over checksums.txt (transitively authenticates every artifact by hash). Keyless via GitHub OIDC / Fulcio / Rekor — no long-lived key. Publishes checksums.txt.bundle.
  • release.yaml — installs cosign (pinned), adds attestations: write, adds actions/attest-build-provenance over checksums.txt (SLSA). id-token: write already present.

cosign 3.x

Uses --bundle (modern Sigstore bundle: signature + cert + Rekor entry) — cosign 3.x dropped --output-signature/--output-certificate.

Validated with goreleaser check (valid; only the pre-existing brews deprecation) and the same local key-based round-trip proven in truffle#105 (sign → verify OK → tamper rejected). Takes effect from the next tagged release. Closes #430.

Fourth external-review polish: surface the safety model in the CLI, not just
the docs. `spawn status` on a running managed instance now appends:

  Lifecycle protection:
    In-instance (spored):  enforces TTL + idle rules on the instance itself
    Out-of-band reaper:    backstop in the spore.host-infra account, if deployed
    Termination deadline:  2026-07-22 18:00 PDT (in 2h 55m)
    Max compute cost:      ~$4.82 by deadline (on-demand rate, compute only; ...)
    Idle timeout:          30m (stops the instance when idle; never terminates)

Computed controller-side from tags: deadline from the launch-anchored
spawn:ttl-deadline tag (falls back to launch+TTL), max cost from
LookupEC2OnDemandPrice x hours-to-deadline. Honest about the reaper — it is
NOT authoritatively visible from the launch account (pkg/doctor ReaperConfigured
says the same), so it is described as a backstop 'if deployed' rather than
claiming dual enforcement. Shown for both the SSH and SSM status paths; only for
running/pending managed instances. Unit-tested (block presence, gating,
deadline resolution).
Signs checksums.txt with keyless cosign (Sigstore, GitHub OIDC identity) and
adds SLSA build provenance for the downloadable spawn CLI artifacts. Separate
from and complementary to spored's KMS publisher-signing + boot verification
(#440) — the spored S3-upload step is untouched.

- .goreleaser.yaml: signs: block → cosign sign-blob --bundle over checksums.txt
  (cosign 3.x bundle format). Publishes checksums.txt.bundle.
- release.yaml: install cosign, add attestations: write, add
  attest-build-provenance over checksums.txt. id-token: write already present.

Takes effect from the next tagged release. Refs #344. Closes #430
@scttfrdmn
scttfrdmn merged commit 687c6c0 into main Jul 22, 2026
6 checks passed
@scttfrdmn
scttfrdmn deleted the feat/cosign-signing branch July 22, 2026 04:04
scttfrdmn added a commit that referenced this pull request Jul 22, 2026
The #433 cosign PR inserted the Attest step between GoReleaser and its env:
block, so GITHUB_TOKEN/tap/scoop tokens attached to the attest step instead —
GoReleaser then failed at startup ('missing GITHUB_TOKEN') and the v0.92.0
release aborted before building. Move the env: back onto the GoReleaser step.
(truffle/lagotto/mcp were unaffected — their env block was added in-place.)
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.47059% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/status.go 76.47% 10 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

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.

Sign release artifacts with cosign/OIDC (+ SLSA provenance)

1 participant