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.
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.
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.
How to use
- Install Cosign:
go install github.com/sigstore/cosign/v2/cmd/cosign@latestor download the binary. - Sign an image with keyless signing (requires OIDC identity).
- Verify the signature before deploying.
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
Related on TokRepo
- AI tools for security -- Security tooling and supply chain protection.
- AI tools for DevOps -- CI/CD and infrastructure automation tools.
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
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.
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.
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.
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.
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
Related on TokRepo
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.