How do you make sure only signed, trusted images run in your cluster?

To run only trusted images in Kubernetes, sign every image in your CI pipeline, deploy it by digest instead of by tag, and run an admission controller that rejects any Pod whose image lacks a valid signature from your build identity. Kubernetes does not check image signatures by itself. Tools such as Sigstore policy-controller and Kyverno add that check when a Pod is created, and signed provenance and SBOM attestations extend it from who built an image to how and from what.

Tags are mutable, digests are not

A tag such as api:v1.4.2 is a pointer that anyone with push access can move to a different image. A digest such as api@sha256:3f1c... is a hash of the image manifest, so it always refers to exactly the same content. A signature covers the digest, which means a deployment that references a tag can verify one image at admission and pull another later if the tag moves in between.

The risk is not theoretical for anything referenced by tag. In March 2025, attackers who compromised the tj-actions/changed-files GitHub Action “retroactively modified multiple version tags to reference a malicious commit”, according to the GitHub advisory. The malicious code printed secrets from the runner’s memory into the workflow logs, and CISA told users to audit runs between 12 and 15 March 2025 and rotate every exposed secret. Workflows that referenced the action by tag and ran in that window executed the attacker’s code without any change on their side.

Deploy images by digest. Your CI pipeline can write the digest into the manifests, and some admission controllers rewrite tags to digests for you.

How signing works

Cosign, part of the Sigstore project, is the most common signing tool for container images. It supports two modes:

  • Key-based signing: you hold a private key, ideally in a cloud KMS, and distribute the public key to verifiers. You are responsible for protecting and rotating the key.
  • Keyless signing: the CI job presents its OIDC identity token, the same kind of token used for workload identity federation. Sigstore’s Fulcio certificate authority issues an X.509 certificate that is valid for 10 minutes and binds an ephemeral key to that identity, and the Rekor transparency log records the signing event. No long-lived key exists to steal.

With keyless signing, verification checks the identity instead of a key. For an image built by a GitHub Actions workflow:

bash
cosign verify registry.example.com/api@sha256:3f1c... \
  --certificate-identity https://github.com/acme/api/.github/workflows/release.yml@refs/heads/main \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

This accepts only images signed by the release workflow on the main branch, not by a pull request job or a developer laptop. Kubernetes itself uses keyless signing for its release binaries and images, and the Kubernetes documentation shows how to verify them with the same command. The Notary Project’s Notation is the other common signature format, and some policy tools support both.

Provenance and SBOM attestations

A signature proves who published an image. An attestation is a signed statement about it, stored next to the image in the registry.

AttestationWhat it answersCommon formats and tools
Build provenanceWhich source commit, workflow and builder produced this imageSLSA provenance, GitHub artifact attestations
SBOMWhich packages and versions the image containsSPDX, CycloneDX, generated by tools such as Syft or Trivy
Vulnerability scanWhich known vulnerabilities a scanner found at a point in timeScanner output wrapped in a signed attestation

SLSA defines build levels for provenance. At Build L1 provenance exists, at L2 a hosted build platform generates and signs it, and at L3 the platform also isolates runs from each other and keeps signing secrets away from user-defined build steps. GitHub states that its artifact attestations reach SLSA v1.0 Build Level 2 on their own and Build Level 3 when the build runs in a shared reusable workflow. An admission policy can then require provenance from a specific repository and builder, not only a valid signature.

Enforcing signatures at admission

Signing has no effect until the cluster refuses unsigned images. Two open source options cover most setups:

  • Sigstore policy-controller: a ClusterImagePolicy matches images by glob pattern and lists the keys or keyless identities allowed to sign them, plus required attestations. It validates only namespaces labelled policy.sigstore.dev/include: "true", resolves tags to digests, and by default rejects images that match no policy. A policy can run in warn mode first.
  • Kyverno: verifyImages rules check Cosign and Notary signatures and attestations. By default they rewrite image tags to digests and require every matched image to use one, so the node pulls exactly the verified image.

Plan for three details before you enforce:

  1. System and third-party images. Your CNI, CSI drivers and add-ons are signed by their publishers or not at all. Verify publisher signatures where they exist, and exclude or mirror the rest deliberately.
  2. Webhook failure policy. If the policy controller is down, a webhook set to fail closed blocks every new Pod, and one set to fail open admits unsigned images. Run several replicas and decide which risk you accept.
  3. Admission happens once. Pods that were running before you turned on the policy are not re-checked. Restart workloads after enabling enforcement.

Signature checks belong next to the other admission controls, such as Pod Security Admission, which limits what a container may do once it runs.

Registries and mirrors

Pull every production image from registries you control. Copy third-party images into your private registry, together with their signatures, or put a pull-through cache in front of public registries, then restrict allowed registries in your admission policy. This removes the dependency on a public registry’s availability and rate limits and gives you one place to scan and sign. Grant push access only to CI identities, and pull-only access to everything else.

A valid signature proves that an image came from your pipeline, not that the pipeline was safe. An attacker who controls a step in the release workflow gets a validly signed image. Harden the pipeline that signs:

  • Lock third-party actions to exact commits, with a workflow dependency lockfile or by pinning each action to a full commit SHA, as GitHub’s secure use reference recommends. A tag can be moved.
  • Grant id-token: write only to the job that signs, and keep the default token read-only.
  • Sign only on protected branches or tags, and write the verification policy against that exact workflow and ref.
  • Keep build and signing separate from jobs that run untrusted pull request code, as described in how to deploy to Kubernetes from CI/CD.

Images on Cloudfleet

Cloudfleet Container Registry (CFCR) is an OCI-compliant registry included with every Cloudfleet organization, with a europe region served entirely on EU-based infrastructure. Administrators can push and users can only pull, Cloudfleet Kubernetes Engine (CFKE) clusters pull without extra credentials, and images can be referenced by digest. The registry overview covers regions, access and authentication.

On this page