Repository navigation
chore: add optional Cloud KMS dual signing for release GPG signatures - #32209
Merged
Merged
Conversation
Add scripts/gpgkms, which creates OpenPGP signatures with an RSA key held in Google Cloud KMS. When CODER_GPG_KMS_KEY and CODER_GPG_KMS_KEY_CREATED are set, sign_with_gpg.sh signs with the existing GPG key first and appends the KMS signature to the same .asc file, then verifies both. With the variables unset, signing is unchanged.
- Authenticate to the coder-release-signing project as release-signer@ in a separate google-github-actions/auth step that doesn't export environment variables. Its credentials file reaches gpgkms only, through CODER_GPG_KMS_CREDENTIALS_FILE, so EV signing and the gcloud steps keep the code signing account. - Pin the OpenPGP creation time (1794787200) in gpgkms instead of taking it from a variable. It is part of the fingerprint and must never change. - Print the KMS public key and fingerprint on main builds (job summary). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GPG_KMS_KEY, GPG_KMS_WORKLOAD_ID_PROVIDER and GPG_KMS_SERVICE_ACCOUNT are now secrets in the release and ci-signing environments. Secrets can't be used in step conditions, so a step records whether GPG_KMS_KEY is set and the KMS steps check its output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…token - Check fs.Parse errors (errcheck in lint/go/new-code). - The coder-release-signing identity provider only accepts push events in ci-signing and release tags in release. ci.yaml also builds on create events for new release branches, and release.yaml allows dry runs from release/* branches; both now sign with the GPG key alone instead of failing at the KMS auth step. Real releases always run on a tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kylecarbs
previously approved these changes
Nov 16, 2026
Appending a second signature to .asc breaks scripted `gpg --verify` for anyone who only has the current key: gpg exits 2 when any signature in the file is from an unknown key. Keep .asc exactly as before and write the KMS signature to <file>.v2.asc, verified against a keyring that holds only the KMS key. The Makefile copies it into site/out/bin (so the server embeds and serves it at /bin) and release.yaml uploads it next to .asc on releases.coder.com. publish.sh already uploads every file next to the checksums file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sreya
approved these changes
Nov 16, 2026
sreya
added a commit
that referenced
this pull request
Nov 16, 2026
The GPG dual-signing work (#32209) authenticates as the same release signer and reads GPG_KMS_WORKLOAD_ID_PROVIDER / GPG_KMS_SERVICE_ACCOUNT; standardize on those names so one identity has one configuration pair. The GCP_RELEASE_SIGNING_* secrets are retired.
kylecarbs
approved these changes
Nov 16, 2026
This branch had an error being deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Adds an optional second release signature from an RSA key held in Google Cloud KMS, so a new release signing key never exists as an exportable file.
scripts/gpgkmsbuilds an OpenPGP key from the KMS public key and a fixed creation time, then signs through a KMS-backedcrypto.Signer(ProtonMail/go-crypto, already in our module graph). WhenCODER_GPG_KMS_KEYandCODER_GPG_KMS_CREDENTIALS_FILEare set,sign_with_gpg.shstill writes<file>.ascwith the existing GPG key exactly as before, and also writes the KMS signature to<file>.v2.asc. The.v2.ascfile is verified against a keyring that holds only the KMS key before it's written. If the variables are unset, signing works as it does today.The KMS signature goes in a separate file because every existing verifier reads
.asconly:.ascagainst a key bundled in the plugin.gpg --verifyexits 2 if any signature in the file is from a key it doesn't have, so appending a second signature to.ascwould break customer scripts that check the exit code..v2.ascships everywhere.ascdoes:site/out/bin(embedded in the server and served at/bin/),releases.coder.com/coder-cli/<version>/, and the GitHub release (the checksums file's signatures).Rollout
The key (
gpg-release, RSA-4096, HSM) and its identity already exist in thecoder-release-signingproject (coder/gcp#331). Onlyrelease-signer@can sign with it, and only from therelease(exactvX.Y.Z/vX.Y.Z-rc.Ntags viarelease.yaml) andci-signing(pushes tomain/release/*) environments.ci-signingenvironment. SetGPG_KMS_WORKLOAD_ID_PROVIDERandGPG_KMS_SERVICE_ACCOUNTinreleasetoo, but leaveGPG_KMS_KEYout ofreleaseuntil the plugin updates and the advisory are ready:GPG_KMS_KEY=projects/coder-release-signing/locations/us-central1/keyRings/release-signing/cryptoKeys/gpg-release/cryptoKeyVersions/1GPG_KMS_WORKLOAD_ID_PROVIDER=projects/720429782538/locations/global/workloadIdentityPools/github-release-signing/providers/coder-coderGPG_KMS_SERVICE_ACCOUNT=release-signer@coder-release-signing.iam.gserviceaccount.comrelease.yamlandci.yamlget a secondgoogle-github-actions/authstep forrelease-signer@withexport_environment_variables: false. Its credentials file goes only togpgkms, throughCODER_GPG_KMS_CREDENTIALS_FILE. EV signing (explicitGCLOUD_ACCESS_TOKEN) and thegcloud storageupload keep the code signing account's default credentials. Every KMS step is skipped while theGPG_KMS_KEYsecret is unset, onci.yamlruns that aren't pushes, and onrelease.yamldry runs from branches, because the identity provider won't issue a token for those.scripts/gpgkms(1794787200, 2026-11-16 00:00 UTC) because it's part of the fingerprint.mainbuild prints the public key and fingerprint to the job summary. No human can sign with the key, so CI makes the self-signature. Confirm the nextmainbuild prints the same fingerprint, and check the UID, RSA-4096 and the expiry.<bin>.v2.ascwith the new key when the server has it, falling back to<bin>.ascwith the old key otherwise. Publish the new key (release.keyas one armored block with both keys, keys.openpgp.org, docs)..ascwith the new key, keep.v2.asc, and revoke the old key.Testing
crypto.Signerthat hides its concrete key type, as the KMS signer does. They cover deterministic public key export, verification by each key, and rejection of armored or non-signature input to-prepend(no longer used bysign_with_gpg.sh).sign_with_gpg.shwith KMS unset produces the same single-signature.ascasmainand removes a stale.v2.asc. WithCODER_GPG_KMS_KEYset, it fails withoutCODER_GPG_KMS_CREDENTIALS_FILE. Given a bogus credentials file, gpgkms fails on that file without falling back to ambient ADC, and no.v2.ascis written.golangci-lint,shellcheck -x, andactionlintpass.release-signer@can sign, so the firstmainbuild is the first real run.