Skip to content

Support signing with hsm - #760

Draft
wagoodman wants to merge 1 commit into
mainfrom
support-hsm-signing
Draft

wagoodman wants to merge 1 commit into
mainfrom
support-hsm-signing

Conversation

@wagoodman

Copy link
Copy Markdown
Contributor

This is not complete and needs a lot of work and verification.

Adds an AWS KMS signing path so the Developer ID private key never has to live on the signing machine. The existing --p12 flow is untouched.

What's in the branch:

  • --kms-key and --kms-cert-chain flags on quill sign (and sign-and-notarize). URI scheme matches sigstore/cosign (awskms:///alias/... or awskms:///arn:...).
  • New quill csr subcommand for enrolling a Developer ID cert against a KMS-resident keypair (Apple's normal CSR flow assumes the private key is local... with the key in KMS that path doesn't work).
  • KMS-backed crypto.Signer implementation pinned to RSASSA_PKCS1_V1_5_SHA_256. We explicitly do not use sigstore/sigstore/pkg/signature/kms because it forces RSA-PSS, which Apple Developer ID CMS does not use.
  • TestSign_KMS runs the existing trusted fixtures through an in-process fake KMS provider and asserts byte-identical CodeDirectory + CMS output to the P12 path. Passes codesign --verify.
  • .github/workflows/apple-e2e-kms.yaml + workflow_dispatch-only pipeline that signs quill itself with a real KMS key + real Developer ID cert and submits to Apple Notary. The only thing that proves Apple actually accepts what we produce.
  • docs/hsm-signing.md: threat model, end-to-end walkthrough, IAM policy, troubleshooting.

TODOs before the Apple E2E workflow can run (one-time, manual):

  • Create an RSA_2048 SIGN_VERIFY KMS key + alias (alias/quill-ci-signing or similar).
  • Create an IAM role with kms:Sign + kms:GetPublicKey on that key, OIDC trust scoped to this repo + main.
  • Run quill csr against the new key, submit to Apple Developer portal, assemble chain.pem from the issued cert + Apple intermediates.
  • Set repo Variables (non-secret, cert chain is public material): QUILL_KMS_KEY_URI, QUILL_KMS_CERT_CHAIN_PEM, AWS_KMS_SIGNING_ROLE_ARN, AWS_KMS_REGION.
  • (Existing) APPLE_NOTARY_ISSUER, APPLE_NOTARY_KEY_ID, APPLE_NOTARY_KEY secrets reused as-is.
  • Dispatch the workflow once to confirm the wiring end-to-end.

Out of scope, follow-up issues:

  • GCP KMS (gcpkms://) and Azure Key Vault (azurekms://) providers.
  • PKCS#11 provider (CloudHSM, YubiHSM, on-prem).
  • ECDSA Developer ID support.

Closes #759

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@oss-housekeeper oss-housekeeper Bot added the dependencies dealing with project dependencies label May 7, 2026

This branch has not been deployed

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

Labels

dependencies dealing with project dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support HSM-backed signing

1 participant