Cosign
Container signing tool from Sigstore
Cosign is an open-source command-line tool for signing, verifying, and storing signatures for container images and other software artifacts, built as the primary client of the Sigstore project. It supports both traditional key-pair signing…
Definition
Cosign is an open-source command-line tool for signing, verifying, and storing signatures for container images and other software artifacts, built as the primary client of the Sigstore project. It supports both traditional key-pair signing and Sigstore's keyless signing model, which issues short-lived certificates tied to an OpenID Connect identity, and stores signatures alongside the artifact in a compatible container registry.
Overview
Container images move through registries and deployment pipelines with little built-in assurance about who published them or whether they were altered along the way, a gap that traditional container tooling left largely unaddressed for most teams because setting up code signing infrastructure was seen as too cumbersome for routine use. Cosign was created to make signing a container image as easy as running a single command, removing the friction that had kept image signing from becoming standard practice. Mechanically, Cosign can sign an artifact using a conventional private key the user manages, or using Sigstore's keyless flow, where Cosign obtains a short-lived signing certificate from Fulcio after the user authenticates through an OpenID Connect provider, and records the signing event in Rekor's public transparency log. The resulting signature is stored as a separate object attached to the same container registry entry as the image itself, using a convention that lets any Cosign-aware tool locate and verify it without needing a separate signature database. Verification checks that the signature matches the image's content hash and, for keyless signatures, confirms the signing identity against policy. Cosign is the tool developers actually run day to day within the Sigstore ecosystem; Fulcio and Rekor operate behind the scenes as the certificate authority and transparency log Cosign talks to. It occupies a similar functional space to Docker Content Trust and Notary, earlier container signing approaches, but differentiates itself through the keyless signing option and tighter integration with the broader Sigstore transparency infrastructure. Cosign can also attach non-signature metadata to an image, such as SBOMs or in-toto attestations, extending its use beyond signing alone. In practice, CI/CD pipelines invoke Cosign to sign every container image immediately after it's built and pushed to a registry, often using keyless signing tied to the CI system's own OIDC identity so no secret key needs to be stored in the pipeline at all. Kubernetes clusters can then run an admission controller that calls Cosign's verification logic to reject any image that isn't signed by a trusted identity before it's allowed to run. Adopting Cosign for keyless signing requires trusting Sigstore's public Fulcio and Rekor infrastructure, or running private instances if that dependency is unacceptable for an organization's security posture. Traditional key-based signing with Cosign avoids that dependency but reintroduces the private key management burden Sigstore was designed to eliminate, so the choice between the two modes is itself a real trade-off teams need to make deliberately.
Key Features
- Signs and verifies container images and other OCI artifacts
- Supports keyless signing using Sigstore's Fulcio certificate authority
- Records signing events in Rekor's public transparency log
- Also supports traditional private key-based signing workflows
- Stores signatures alongside images in standard container registries
- Can attach SBOMs and in-toto attestations to signed artifacts
- Integrates with Kubernetes admission controllers for signature enforcement
- Command-line and library interfaces suited to CI/CD automation