ConfigsApr 16, 2026·3 min read

Cosign — Sign and Verify Container Images and Artifacts

Cosign by Sigstore lets you cryptographically sign container images, verify signatures in CI/CD and admission controllers, and establish software supply chain trust with keyless signing via OIDC.

TL;DR
Cosign signs and verifies container images and artifacts using keyless OIDC-based signing or traditional key pairs for supply chain security.
§01

What it is

Cosign is a tool from the Sigstore project for cryptographically signing container images and other software artifacts. It supports both traditional key-pair signing and keyless signing via OIDC identity providers (GitHub Actions, Google, Microsoft). Signatures can be verified in CI/CD pipelines and Kubernetes admission controllers to ensure only trusted images run in production.

Cosign targets DevOps engineers, security teams, and platform operators who need to establish software supply chain trust without managing long-lived signing keys.

§02

How it saves time or tokens

Keyless signing eliminates key management overhead. Instead of generating, rotating, and securing private keys, Cosign uses your existing OIDC identity (e.g., GitHub Actions workflow identity) to produce short-lived certificates. Verification is automated in CI/CD, so no manual signature checks are needed.

§03

How to use

  1. Install Cosign: go install github.com/sigstore/cosign/v2/cmd/cosign@latest or download the binary.
  2. Sign an image with keyless signing (requires OIDC identity).
  3. Verify the signature before deploying.
§04

Example

# Keyless signing (opens browser for OIDC auth)
cosign sign myregistry.io/myapp:v1.0.0

# Verify the signature
cosign verify myregistry.io/myapp:v1.0.0 \
  --certificate-identity=user@example.com \
  --certificate-oidc-issuer=https://accounts.google.com

# Key-pair signing (traditional)
cosign generate-key-pair
cosign sign --key cosign.key myregistry.io/myapp:v1.0.0
cosign verify --key cosign.pub myregistry.io/myapp:v1.0.0
§05

Related on TokRepo

§06

Common pitfalls

  • Keyless signing requires network access to Sigstore's public infrastructure (Fulcio CA, Rekor transparency log). Air-gapped environments need key-pair signing instead.
  • Verification requires specifying the expected certificate identity and OIDC issuer. Omitting these checks weakens the trust chain.
  • Cosign stores signatures as OCI artifacts alongside the image in the registry. Some registries do not support OCI artifacts; check compatibility.
  • Kubernetes policy enforcement requires an admission controller like Kyverno or Connaisseur to reject unsigned images at deploy time.
  • Signing multi-architecture images requires signing the manifest list, not individual platform images.

Frequently Asked Questions

What is keyless signing in Cosign?+

Keyless signing uses your OIDC identity (Google, GitHub, Microsoft) to obtain a short-lived certificate from Fulcio, Sigstore's certificate authority. The signing event is recorded in Rekor, a public transparency log. No long-lived private key is needed.

How do I verify Cosign signatures in Kubernetes?+

Use a policy engine like Kyverno, OPA Gatekeeper with Cosign integration, or Connaisseur as a Kubernetes admission webhook. These tools verify image signatures before allowing pods to be created, rejecting unsigned or incorrectly signed images.

Can Cosign sign non-container artifacts?+

Yes. Cosign can sign and verify any OCI artifact, including Helm charts, WASM modules, and arbitrary blobs stored in OCI-compatible registries. The cosign sign-blob command signs files directly.

What is Sigstore?+

Sigstore is an open-source project under the Linux Foundation that provides free code signing infrastructure. It includes Cosign (signing tool), Fulcio (certificate authority), Rekor (transparency log), and policy-controller for Kubernetes.

Does Cosign work with GitHub Actions?+

Yes. GitHub Actions provides OIDC tokens that Cosign uses for keyless signing. This is the most common CI/CD integration. The sigstore/cosign-installer action sets up Cosign in your workflow.

Citations (3)
  • Cosign GitHub— Cosign signs and verifies container images with keyless OIDC signing
  • Sigstore Project— Sigstore provides free code signing infrastructure
  • Sigstore Docs— Fulcio certificate authority and Rekor transparency log

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets