Safeguard
Developer Tools•

Keyless, KMS or your own key: which cosign signing fits?

Compare keyless, cloud KMS and self-managed keys for cosign: who holds the key, what you verify, and which fits CI, air-gapped and regulated use.

Safeguard Security Team
4 min read

Choose keyless signing when your CI has an identity provider and you can reach Sigstore. Choose a KMS or Vault key when you need keys under your control or must sign without public services. Choose a plain key pair only for small, low risk cases where you can protect the file.

What each model means

Sigstore's docs say identity based signing is the default, because managing and distributing keys securely is hard. Keyless signing associates an identity, not a key, with a signature: a certificate authority issues a short lived certificate binding an ephemeral key to an OIDC identity, and the signing event goes in the Rekor log.

Cosign can also use external key stores. The key management page lists AWS KMS, GCP KMS, Azure Key Vault, HashiCorp Vault, OpenBao, OVHcloud KMS and Kubernetes Secrets.

Comparison

KeylessKMS or Vault keyLocal key pair
Who holds the private keyNobody, it is ephemeralYour key serviceA file you protect
What verifiers checkIdentity and issuerA public keyA public key
Needs public Sigstore servicesYes, for public instanceNoNo
Rotation burdenNone for keysYoursYours
Audit trailPublic log entryYour KMS logsLittle by default
Works air gappedNeeds private deployment or offline bundle planYesYes

Decision guide

  1. Public open source project with CI on a major platform: keyless fits well. Verifiers check your repository workflow identity.
  2. Private software with strict data rules: a KMS key keeps signing inside your cloud boundary. Note that keyless public logging can expose emails or repository names in certificates.
  3. Disconnected environment: use a KMS, Vault or a private Sigstore deployment you run.
  4. Prototype: a local key pair is fine, but do not ship it to customers without a plan for storage and rotation.

Practical details for KMS keys

  • Generate the key in the provider with the generate key pair command and a provider URI.
  • Export the public key and verify with the file, so verification does not call the KMS each time.
  • For AWS, the docs warn that key creation is not supported through cosign with key ARN or key ID forms, and recommend aliases.
  • Kubernetes Secrets storage keeps the private key and password in one secret, so review cluster access carefully.

What to verify, whichever you choose

Keyless: certificate identity and issuer. Key based: that the public key is the one you published, through a channel an attacker cannot rewrite. In both cases, verify the digest you deploy.

What signing alone does not do

None of these choices prove the code is safe. They prove who signed.

Where Safeguard fits

Safeguard's policy gates and SBOM scanning sit beside signing as a check on content, and compliance and evidence automation helps document the controls you chose.

Quick check

Can I switch models later?

Yes, but consumers must learn the new verification rule. Publish the change and keep the old key or identity trusted for old releases.

Is keyless less secure than a KMS key?

They fail differently. Keyless removes stored keys but trusts identity providers and the CA. A KMS key trusts your cloud access controls.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.