Signing and verifying container images with Sigstore cosign

Signing and verifying container images with cosign lets a cluster admit only images built by an approved pipeline. This page covers keyless and key-based signing, Rekor, admission checks and air-gapped limits.

On this page

Signing and verifying container images with cosign before anything runs

If your team must show that only approved images reach production clusters you run, you need a way to prove where each image came from and that it was not changed after the build. cosign, part of the Sigstore project, signs and verifies image artifacts stored in OCI registries, so a signature travels with the image and can be checked before a pod is admitted. You need it when a security review, an internal control or a customer contract asks who built a container and whether the cluster would run anything else. Signing answers the identity and integrity question only. It does not tell you whether the image contains known vulnerabilities, whether the base image is appropriate, or whether a developer should have been able to push to that repository at all. Those answers come from image scanning, admission policy and registry access controls, which this topic connects to signing.

Before you commit to a design, decide two things: who may sign (a CI workflow identity, a set of build pipelines, or a named signing key held in your secrets platform) and where verification happens (an admission policy in each cluster, a gate in the deployment pipeline, or both). Keyless signing ties a signature to an OIDC identity issued to the CI job and records it in the Rekor transparency log, which suits teams that already run an identity provider for pipelines. Key-based signing uses a private key you generate, store and rotate yourself, which often fits air-gapped networks better. Confirm with your security team which model your audit evidence must support, and confirm the current cosign and Rekor command options against the Sigstore documentation for the versions you plan to pin, since flags change between releases.

Plan the registry and network path early, because signature verification needs to reach the registry where signatures are stored and, for keyless verification, the transparency log and trust roots. In an air-gapped environment you must mirror the images, signatures and, where used, a private Rekor instance or offline bundles into networks the cluster can reach, and document how those copies are refreshed. Every signing key or trusted identity pattern is a long-lived control, so write down who approves a change to it, how a compromised key is revoked, and how you will test that unsigned or wrongly signed images are blocked in a non-production cluster before enforcement starts.

How signing, Rekor and admission checks fit together

The flow starts in the CI pipeline, where the build pushes an image to the registry and cosign signs it, either keyless through the pipeline's OIDC identity or with a private key. The signature is stored in the registry beside the image, and a transparency log entry is recorded in Rekor. When a pod is submitted, the admission controller, such as Kyverno, checks the signature against the trust policy before the pod is admitted. Check that each trust boundary has a named owner and that the policy names the exact signing identity or key.

Signing happens in CI, verification happens at admission, and the registry and log sit between them.

Keyless or key-based signing: which fits your environment

Keyless signing removes the long-lived private key from the pipeline. At signing time, the CI job proves its identity to an OpenID Connect provider, and a certificate authority issues a short-lived signing certificate bound to that workload identity, such as a specific repository and branch. The signature and certificate are then recorded in Rekor, the Sigstore transparency log, so anyone can later check that a signature was made under a given identity at a given time. Verification therefore depends on trusting the identity issuer and the signing identity, not on distributing a key.

  • Identity choice: Verifiers must pin the expected issuer and certificate identity, for example one repository and one protected branch. A loose identity match means any pipeline that can obtain a token from that issuer can produce an image your policy accepts.
  • Trust roots: The default public Sigstore instance relies on public certificate authority and transparency infrastructure. A self-hosted Sigstore deployment lets you run your own roots and log, at the cost of operating them.
  • Public log exposure: Signing events in a public Rekor instance are visible to outsiders, including repository and workflow metadata. Confirm whether that metadata is acceptable for your code and image names before you choose the public log.
  • Air-gapped networks: Keyless verification needs reachable trust roots and log data. Plan a private Sigstore instance, or confirm how offline verification material would be mirrored into the network.

Before adopting this model, confirm the issuer, the identity pinning rules and where your transparency log will live.

Configuration options and when each fits

This table compares the main choices for signing and verifying images with cosign: signing identity, transparency logging, signature storage, admission enforcement and attestations. Read each row against your registry, network rules and audit needs, then confirm the details with the cosign and Kyverno documentation before you commit.

DecisionOptionWhen it fits and what to confirm
Signing identityKeyless signing with OIDC identityFits CI systems that can obtain short-lived identity tokens from your identity provider. Confirm the OIDC issuer, the certificate identity pattern you will pin in policy, and whether your CI runner can reach the public signing services.
Signing identityKey-based signing with a private keyFits environments where a long-lived signing key can be held in a KMS or HSM and rotated under your own process. Confirm key storage, who can use the key, and how revocation and rotation are recorded.
Transparency logPublic Rekor instanceFits teams that accept public logging of signing events and want independent evidence of when a signature was created. Confirm that image or signer metadata published there is acceptable to your data handling rules.
Transparency logSelf-hosted Rekor or log disabledFits air-gapped or confidential build pipelines where public logging is not allowed. Confirm how verifiers will check inclusion without the public log, and document the trade-off in your review.
Signature storageSignatures stored in the same registry as the imageFits most setups because signatures travel with the image and are checked by the same pull path. Confirm your registry accepts the extra artifacts and that retention or cleanup jobs do not remove them.
Admission enforcementKyverno image verification policyFits clusters that already run Kyverno for other policies and want signature checks in YAML and audit mode first. Confirm the Kyverno version, how it reaches registries and the transparency log, and how exceptions are granted.
Admission enforcementOther policy engine or custom admission checkFits organizations with an existing admission stack or specific verification rules. Confirm that the engine can verify cosign signatures, how it handles offline trust roots, and who owns the webhook's availability.
AttestationsSBOM or provenance attestationsFits teams that must show what went into an image and how it was built. Confirm the attestation formats your policy checks, and whether verifiers will require them before an image is admitted.

Setting up signing in CI and verification at admission

This sequence moves image signing from an idea into a working control: CI signs each image by digest, the registry stores the signatures, and the cluster checks them at admission before any unsigned image can run.

  1. Define signing identity and key custody

    Decide who or what is allowed to sign, and how the signing material is held. Choose between keyless signing, where CI signs with a short-lived certificate tied to the pipeline identity and the transparency log records the event, and key-based signing, where a long-lived cosign key pair is kept in a KMS or hardware-backed store with restricted access. Write down the signing identity (for example, the repository and branch allowed to sign), who approves key rotation, and where the private key lives. Done when the owners, the identity string or key location, and the rotation owner are written in a document your security team has approved. Confirm the keyless identity provider and any KMS support with your own environment and the cosign documentation before you commit.

  2. Add cosign to the build pipeline and sign by digest

    Add a signing job to the CI pipeline after the image is built and pushed. The job signs the image reference with its immutable digest, not a mutable tag such as latest, so the signature cannot drift to a different image later. Record the digest output by the build step and pass it to the signing command. Run the signing command in a job with only the permissions it needs to sign and to write to the registry. Done when the pipeline log shows a signature was pushed for a specific digest. Check the result by running cosign verify against that digest with the expected identity or public key, and confirm it passes.

  3. Configure registry permissions for signature artifacts

    Cosign stores signatures as separate artifacts in the same registry as the image. Confirm that the registry account used by CI can write those artifacts, and that cluster pull credentials and most users can only read them. Test a push and a pull of the signature artifact with the actual pipeline credentials and a read-only credential. Also check that your registry's retention or garbage collection rules do not delete signature artifacts while the images they cover are still in use. Done when the write test succeeds for CI, the read test succeeds for the cluster credential, and a non-CI write attempt is denied.

  4. Record the trust policy in Git

    Write the trust policy as versioned configuration that lists which registries and image paths require signatures, the accepted signing identities or public keys, and any exceptions with an owner and an expiry review. Store it in the same Git repository as the cluster policies so changes go through review. Keep the public key or identity values in the policy, not the private key. Done when the policy file is merged, a reviewer has approved it, and a dry run against the policy engine's test tooling produces the expected result for a sample signed image and a sample unsigned image.

  5. Deploy the admission engine in audit mode

    Install the admission engine that will verify signatures, for example Kyverno with an image verification policy, or another policy engine your team has chosen. Start with the policy in audit mode so that violations are reported but not blocked. Confirm the admission webhook is healthy, that the engine can reach the registry to fetch signatures, and that its own namespace is excluded from the policy so it cannot block its own recovery. Done when the policy report shows evaluations for existing workloads and the engine's pods are running without webhook errors in the logs.

  6. Verify signed and deliberately unsigned test images

    Run two controlled tests in a non-production namespace. First, deploy a workload using an image built and signed by the pipeline, and confirm the policy report records it as passing. Second, deploy a copy of a test image that was never signed, or a signed image from a different identity, and confirm the policy report flags it as a failure. Before the test, verify the signed image manually with cosign verify against its digest so you know the policy result matches the signature state. Done when the signed image passes, the unsigned image is reported, and the results are saved with the policy change record.

  7. Enforce the policy and confirm rejection

    Once the audit results are clean for all in-scope namespaces and the exceptions are documented, switch the policy from audit to enforce for those namespaces. Then repeat the unsigned-image deployment and confirm the admission request is rejected with a message that names the policy. Keep the audit-to-enforce change in Git so the rollback is one reviewed revert. Done when an unsigned image is blocked, a signed image still deploys, and the rollback procedure has been tested once.

What Rekor records and what it does not prove

Rekor is a transparency log that records signing events so they can be found and audited later. When cosign signs an image, the signing event can be written to Rekor as an entry that ties the image digest to the signature and the identity that produced it. The log is append-only and designed so that tampering with an entry is detectable, which gives you tamper evidence and discoverability: anyone with the right query can ask whether a signature for a given digest was ever recorded, and when. That is useful for incident response, for proving that an image came out of your pipeline, and for spotting signatures created for images you never intended to sign. Confirm in the cosign and Sigstore documentation how your chosen cosign version writes to Rekor, whether that is on by default for keyless signing, and how verification checks the inclusion proof.

Rekor does not prove that the software is safe, that it is free of vulnerabilities, or that the build was not compromised. A valid entry shows that a particular identity or key signed a particular digest at a particular time. If the CI runner, the build script or a signing credential was compromised, the attacker's signature will be recorded just as faithfully. Policy engines that check only for a valid signature will accept it. Plan separate controls for build integrity, dependency review and vulnerability scanning, and define in your policy which signer identities and build workflows are acceptable, not merely that some signature exists.

The public Sigstore instance is the default for many teams, but it publishes image names, digests, signer identities and timestamps to a log anyone can read. For an internal application, a customer-specific image or a registry path that reveals product plans, that metadata may be more than you want outside your organization. A privately operated Rekor instance keeps those entries in your environment but adds operational work: you own availability, backup, key management and the trust roots that your verifiers use. Before choosing, ask your security and legal teams what image names and digests reveal, confirm with the Sigstore documentation which deployment options and trust configuration the cosign release you plan to use supports, and decide how your admission policies will reference the transparency log.

Security risks in image signing programs

A signing program only proves something if the keys, identities, verification rules and exceptions around it are controlled. The cards below cover the failure points we see most often in cosign rollouts, each paired with the control that closes it.

Signing keys leaked from CI

Key-based signing stores a private key that CI jobs can read, so anyone who compromises a pipeline, a runner or a build log can sign arbitrary images. Keep the key in an external KMS or HSM where the pipeline requests signing without holding the key material, restrict which branches and environments can use it, and rotate it on a schedule you can name. Ask who can read the key secret and whether a fork or pull request job can reach it. Keyless signing removes the long-lived key but moves the risk to the identity controls described in the next card.

Overly broad signing identities

With keyless signing, Fulcio issues a short-lived certificate bound to the OIDC identity of the workflow, so the certificate identity is only as narrow as the identity you verify. A verification rule that accepts any workflow in an organization, or any branch of a repository, lets a low-trust job produce a signature the cluster will accept. Pin the certificate identity to the exact repository, workflow file and protected ref, and scope the OIDC claims your CI provider issues. Review each rule when a workflow is renamed or a new branch is allowed to release.

Verification gaps in images and sidecars

A signature checked on a mutable tag does not prove the image running today is the one that was signed, because the tag can be repointed after signing. Verification should target the image digest, and policies should cover every container in a pod, including init containers and injected sidecars, not only the application container. Confirm with your policy engine that its image rules match all container lists in the pod spec, and test with a deliberately unsigned sidecar before you rely on the rule.

Exceptions that bypass policy

Verification rules rarely fail for the workloads that matter most. Teams add namespace exclusions, image pattern allowlists or manual exceptions to unblock a deployment, and those exceptions often outlive the reason for them. Record each exception with an owner, a reason and an expiry date, keep exception objects in Git next to the policy, and review them on a fixed cadence. Ask whether exceptions can be created by the same team that deploys the workload, because that removes the separation the policy was meant to enforce.

Unmanaged trust roots and rotation

Verification depends on trust roots, including the Fulcio and Rekor public keys, root certificates for a private Sigstore deployment, or the public key used in key-based verification. If these are copied into policies by hand, nobody knows when they change, and a stale or wrongly replaced root either blocks every deployment or accepts signatures from the wrong authority. Track each trust root with an owner, store it in version control, and test the rotation path in a non-production cluster. Confirm which roots your deployment depends on before the first rotation.

Missing audit logs of verification

Admission decisions are the evidence that the signing program works, yet many clusters only record that a pod was created. Without logs of which signatures were checked, which identity matched and which requests were denied or excepted, you cannot answer whether an unsigned image ever ran. Enable audit logging for policy decisions, forward admission results to your log platform, and retain them long enough for your incident and compliance needs. Confirm with your policy engine which decisions it reports and whether denied requests are logged alongside accepted ones.

Running cosign verification in air-gapped clusters

Keyless verification depends on network paths that an air-gapped cluster may not have. Keyless signing and verification rely on certificate issuance and transparency log infrastructure outside the cluster. Unless those services are mirrored or self-hosted inside your network, admission-time checks that call out to them will fail or stall, and a verification policy that falls back to allowing images would defeat the control. Before choosing keyless mode for a restricted environment, confirm in the current cosign documentation which offline and private-infrastructure options exist, which components they require and how they are configured. Do not assume they are available because they worked in a connected lab.

Key-based signing is usually the simpler path for disconnected clusters, but it moves the work to key distribution. The public key used for verification must be placed inside the network and referenced by the admission policy, and the private key must stay in a controlled signing environment, typically your CI system or a hardware-backed store, with its own rotation and revocation process. Confirm with cosign's current documentation how offline verification handles transparency log entries and whether your chosen flags need network access at verification time. Plan the key ownership model before the first image is signed, because re-signing a large image catalog later is a costly change.

Signatures and attestations must travel with the images they describe. Mirror the image, its signature artifacts and any attestations to the internal registry in one controlled transfer, and verify the mirrored digests rather than tags. Kubeadm can pull control plane images and point kubeadm init at a private registry through --image-repository, which covers cluster components only. It does not mirror your application images or their cosign artifacts, so that work belongs in your registry replication plan. Test the full chain in a disconnected staging cluster with a deliberately unsigned image to confirm the policy blocks it.

Limits to confirm in your environment

Signing and admission checks depend on versions, registry behavior, CI identity, network paths and organizational sign-off that no tutorial can assume. The cards below list the points to confirm before a design is approved, because each one can change which signing mode and enforcement path is workable.

Cosign and Kyverno versions

Signing features, verification flags and the signature formats that policy engines accept change between releases. Pin the cosign version used in CI and the Kyverno version used in the cluster, then test signing and verification together with those exact versions. Record both in the design so a later upgrade of either one triggers a re-test of the full signing path.

Kubernetes source

Registry signature artifact support

Signatures are stored as separate artifacts next to each image, and not every registry handles these artifacts the same way. Confirm with your registry vendor that it stores, replicates and garbage-collects signature and attestation artifacts without breaking tag or digest references. Test a pull through every registry mirror the clusters use, since a mirror that drops artifacts will fail verification in production.

CI provider OIDC claims

Keyless signing binds a signature to an identity token issued by the CI system, such as the repository, branch and workflow. Confirm that your CI provider issues an OIDC token to build jobs, and that the claims you plan to match in policy are present and stable. If the provider cannot issue these claims, key-based signing becomes the practical path and key custody must be designed.

Network reach to transparency logs

Keyless verification and signing can depend on reaching a public transparency log and certificate authority. In a restricted or air-gapped network, the admission controller and CI runners may have no route to those services. Confirm which endpoints each component must reach, whether a private transparency log is an option, and how verification behaves when the log is unreachable, since a fail-closed setting will block deployments.

Exceptions for system namespaces

Control plane add-ons, CNI components and operators are often pulled from upstream images that your team did not sign. Decide which namespaces or images are exempt, who approves each exception, and how exceptions expire. Keep the exception list in Git next to the policies so reviewers can see every image that bypasses verification and why.

Audit team acceptance of trust model

A keyless model trusts the CI identity and a public signing service, while a key-based model trusts whoever controls the private key. Your auditors and security reviewers must accept the model you choose, including how keys are stored, rotated and revoked, or how identities are scoped in policy. Ask them to review the trust model before build work starts, because changing it later affects CI, policy and evidence together.

Questions teams ask before signing images

What drives the cost and effort of rolling out image signing and admission checks?

The main driver is how many build pipelines, registries and clusters are in scope, and how many teams publish images that must be signed. Each pipeline needs a signing step, each cluster needs a verification policy, and each exception path needs a decision and a record. Costs are mostly one-time design and build work, followed by recurring work to maintain policies, rotate keys or identities, and handle new base images. Ask any provider for a quote that lists the pipelines, clusters and registries in scope, the signing mode chosen, the policy engine, and whether testing in a non-production cluster is included.

How long does a typical signing rollout take?

Duration depends on how many image sources exist, how standardized the CI pipelines are, and how quickly the organization can agree on a trust policy. Teams that already build images from a shared pipeline template usually move faster than teams with many hand-written pipelines. Audit-mode policies, which report unsigned or unverified images without blocking them, add a period of observation before enforcement. No fixed duration applies to every environment, so ask for a written plan with phases and a clear exit criterion for each phase.

What does the work need from our team?

The work needs four kinds of access and ownership. CI administrators must allow signing steps and manage the identity or key material used for signing. Registry administrators must confirm that signatures and attestations can be stored alongside images. Cluster administrators must install the admission controller and grant it the rights it needs. Finally, one named owner must approve the trust policy, meaning which identities, repositories and registries are trusted and who can grant exceptions. Without that owner, policy decisions stall during rollout.

Can an internal platform team do this alone?

A capable platform team can do it alone if it has time to learn the signing tools, the policy engine and the registry behavior, and if it has the authority to change CI and cluster configuration. The effort usually lies less in the first working signature than in the edges: pipelines that rebuild images outside the standard path, third-party images, rollback procedures and audit evidence. A partner adds value when the team needs a fixed scope, an outside review of the trust model, or extra capacity during a compliance deadline. Ask for a scope document either way so the decision rests on written work, not assumptions.

How does keyless signing compare with key-based signing in effort?

Keyless signing removes long-lived signing keys from CI, so the effort moves to identity configuration: trusting the correct OIDC issuer, repository and workflow identities, and checking the transparency log entries during verification. Key-based signing requires generating, storing, rotating and revoking a key pair, which means a key management process with access controls and an owner for key lifecycle events. Keyless signing is often less work to operate, but it depends on identity claims that must be written precisely in policy. Key-based signing suits environments that cannot reach public identity or transparency services. Your choice should follow your network constraints and key management maturity.

How should we handle legacy unsigned images?

Start by inventorying which images running in clusters lack signatures, and separate them by origin: images built by your pipelines, vendor images and third-party community images. Your own images can usually be rebuilt and signed through the new pipeline. Vendor and third-party images may need a documented exception, a verification of the vendor's own signing process, or a mirror that your team re-signs after review. Run policies in audit mode first so the inventory is visible, then set a dated exception process with an owner and a review date for each exception. Avoid turning off enforcement for whole namespaces to make the backlog disappear.

What happens during an air-gapped deployment?

In an air-gapped network, signing and verification must work without reaching public services. Signing with keys held in an internal key management system avoids dependence on public identity providers, but verification still needs the public keys or certificates, the signatures and any transparency log data to be mirrored into the isolated network. Confirm with the tool maintainers which offline verification modes they support and which artifacts must be copied. Also plan how signatures move with images through the internal registry mirror, and how trust roots are updated and audited. Test the full flow in an isolated lab before enforcing anything in production.

How DeployOpen scopes and delivers image signing

DeployOpen starts image signing with a written decision on who may sign and what identity a signature carries. For each pipeline, the scope fixes the signing identity model, whether signing uses cosign keyless signing tied to the CI provider's OIDC identity or key-based signing with a key held in your own key management system, and who approves changes to either. The same scope records which registries hold images, which admission point enforces verification, and how Rekor transparency log entries are retained for review. DeployOpen then implements the CI signing steps in your pipelines, so that each release image and its signature are produced by the same job and traceable to a specific build.

Enforcement comes after observation. DeployOpen deploys the verification policy in audit mode first, so the team can see which workloads would fail signature checks without blocking deployments. DeployOpen then tests verification with signed and unsigned images, a mismatched identity, and an image pulled from an unapproved registry, and documents the results. Before switching to enforcement, your team confirms exceptions for platform workloads and any images from vendors that do not sign their releases. The trust model document covers signing identities, key custody, rotation steps, verification points and known gaps, written for security and compliance reviewers who need to assess the design.

Engagements are fixed-scope, and the scope, deliverables and timelines are agreed in writing before work starts. DeployOpen prepares the evidence a reviewer will ask for, such as policy configuration, test results and the trust model, but it does not issue audit reports, attestations or certifications; independent auditors and certification bodies make those determinations. Signing keys, identity providers and registries usually need ongoing care after the first delivery. Retainers can cover policy updates, key rotation support and periodic verification testing. Ask any provider for a written list of what is one-time work and what recurs.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.