Repository navigation
release: signed by spin-stack's KMS key, as OpenPGP, from the release environment - #4
Merged
Merged
Conversation
… environment The registries take a release only with SHA256SUMS signed by an OpenPGP key they hold. The key is a KMS key (spin-stack/ci's signing.tf) whose private half never leaves KMS: kmspgp makes the OpenPGP key of it - its user id self-signed by KMS, the same key byte for byte every time, so the public half a registry was given once is what every release is checked against - and signs the checksums by asking KMS. GnuPG verifies what it signs. The release job assumes the one role that may sign, from the release environment, which only a v* tag deploys to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… exempt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e held Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The registries (registry.terraform.io, registry.opentofu.org) only take a release whose
SHA256SUMSis signed with an OpenPGP key they hold for spin-stack. The key is a KMS key, created by spin-stack/ci#18, and its private half never leaves KMS.internal/kmspgp: the OpenPGP key of an RSA KMS key. It's a v4 key with a fixed creation time (Created), and KMS self-signs its user idspin-stack (terraform-provider-spin releases). The same KMS key always gives the same key byte for byte (go-crypto's random salt notation is turned off; it guards EdDSA and does nothing for RSA PKCS#1 v1.5). So the public key a registry was given once is the one every later release is checked against. Signing sends KMS the SHA-256 digest (RSASSA_PKCS1_V1_5_SHA_256,MessageType: DIGEST) and writes a detached binary signature, asgpg --detach-signdoes.TestGnuPGVerifiesTheSignature):gpg --importof the printed key, thengpg --verifygivesGood signature from "spin-stack (terraform-provider-spin releases)", and fails over other bytes.errinSignature.Sign), so the KMS refusal is kept and reported instead of "need to call Sign".internal/cmd/kmspgp:publicprints the armored key and its fingerprint, for the registries.sign -out <sig> <file>is what GoReleaser runs.release.ymlruns in thereleaseenvironment, which GitHub lets onlyv*tags deploy to (already created). It assumesterraform-provider-spin-release(ci#18) by OIDC. There's no GPG secret.A local GoReleaser snapshot (without signing or publishing) builds every zip with
LICENSEandTHIRD_PARTY_NOTICES. Tests pass,mutate: 12 refused, 0 survived.Order: ci#18 is applied first (Deploy). Then
go run ./internal/cmd/kmspgp -key alias/terraform-provider-spin-signing publicwith that account's credentials prints the key for both registries, and thev0.1.0tag publishes.🤖 Generated with Claude Code