Repository navigation
Conversation
The Apple Developer ID Application certificate's private key moves from a PKCS#12 file in GitHub secrets into Google Cloud KMS (HSM protection level), matching how Windows EV signing already works. rcodesign reaches the key through the Cloud KMS PKCS#11 library (libkmsp11), authenticated with the existing code-signing workload identity federation service account. Because PKCS#11 support is unreleased upstream and gated behind an optional cargo feature, rcodesign is now built from a pinned revision with a vendored copy of the upstream fix for double module initialization (indygreg/apple-platform-rs#350), cached by revision and patch hash. sign_darwin.sh keeps the PKCS#12 path as a fallback so the migration can be rolled back by restoring the previous environment variables.
Darwin signing authenticates as release-signer@coder-release-signing through the auth step the KMS GPG signing added (gcloud_auth_gpg): its credentials file is pinned to GOOGLE_APPLICATION_CREDENTIALS on the build step, where the Cloud KMS PKCS11 library reads it, while jsign and gsutil keep the ambient coder-ci credentials. The step loses its GPG enablement gate and its GPG-only naming because darwin signing needs the credentials even when the optional KMS GPG signing is disabled; the GPG steps keep their own gates.
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.
Darwin binaries are signed with an Apple Developer ID certificate whose private key currently lives in GitHub secrets as an exportable PKCS#12 bundle. This moves signing to a non-exportable HSM key in the
coder-release-signingproject introduced by coder/gcp#331 (key + IAM in coder/gcp#333). rcodesign reaches the key through the Cloud KMS PKCS#11 library (libkmsp11), authenticating asrelease-signer@coder-release-signingthrough the environment-gatedgithub-release-signingworkload identity pool.scripts/sign_darwin.shgains a Cloud KMS PKCS#11 mode, selected byAC_PKCS11_LIBRARY. The PKCS#12 path remains as a fallback, so rollback is restoring the previous environment variables.install-rcodesigncomposite action builds rcodesign from a pinned upstream revision with thepkcs11cargo feature, because PKCS#11 support is not in any apple-codesign release (latest is 0.29.0) and the feature is off by default. It also applies theapple-codesign/srcportion of apple-codesign: initialize PKCS#11 modules once per process indygreg/apple-platform-rs#350; without it the PKCS#11 module is initialized twice per process and signing fails withCKR_CRYPTOKI_ALREADY_INITIALIZED. The binary is cached by revision and patch hash.gcloud_auth_gpg): its credentials file is pinned toGOOGLE_APPLICATION_CREDENTIALSon the build step only, where the PKCS#11 library reads it, while jsign (Windows) and gsutil keep the ambient coder-ci credentials. The step loses its GPG enablement gate and GPG-only naming because darwin signing needs the credentials even when optional KMS GPG signing is disabled; the GPG steps keep their own gates.AC_CERTIFICATE_P12_BASE64/AC_CERTIFICATE_PASSWORDare replaced byAC_CERTIFICATE_PEM(the public certificate),AC_KMS_KEY_RING, andAC_KMS_KEY, plus theGPG_KMS_WORKLOAD_ID_PROVIDER/GPG_KMS_SERVICE_ACCOUNTsecrets already used by chore: add optional Cloud KMS dual signing for release GPG signatures #32209 (one identity, one auth step, one configuration pair). Notarization (App Store Connect API key) is unchanged.The key is already imported into the HSM and its public key verified against the certificate, and the PKCS#11 signing path was exercised end to end against SoftHSM with a Mach-O binary. Validated end to end on 2026-11-16 via a temporary dispatch-only test workflow: the full release signing path (environment gate, WIF exchange, release-signer, libkmsp11, HSM
AsymmetricSign) produced darwin zips signed by certificate serial161CE6614DEBB3FA0F8DE71963662954and Apple accepted both notarization submissions. The temporary test clause and branch have been removed.Not mergeable until resolved elsewhere:
ev-code-signing/signevare still disabled in coder-ci (Windows signing in the same jobs fails until security re-enables or replaces them), and dry-run releases cannot exchange a signing token under thereleaseWIF condition (workflow_dispatchonv*tags only).Refs coder/gcp#331, coder/gcp#333, coder/gcp#335, indygreg/apple-platform-rs#350