# Verify who signed a container image

[Read this guide on KeySigner](https://keysigner.io/integrations/guides/verify-a-container-image-publisher/)

Pin a test image by digest and require the intended publisher before a build or deployment accepts it.

## Before you start

- Use a disposable image repository and read access to the image and its signature. Record the fully qualified reference with its SHA-256 digest. Ask the publisher which signing system and identity it uses.
- For keyless Sigstore verification, gather the expected certificate identity and OIDC issuer from your release policy. For Notation, gather the approved certificate chain and trusted signer identity.

## Data and access

- **Shared or checked**. The verifier checks the immutable image digest and the publisher identity named by the signature and trust policy.
- **Check separately**. Pull access and deployment approval are separate. Pin the digest so a mutable image tag does not change the object evaluated.

## 1. Sigstore

For a keyless signature, compare the expected certificate identity and issuer with your release policy. A workflow identity may include the repository, workflow path and Git ref. The identity you observed on an image can help diagnose a mismatch. Use the approved identity and issuer to decide which signer is authorized.

**Check.** You have a digest-pinned image reference and the publisher identity or certificate subject from a trusted source.

## 2. Cosign

Replace the placeholders with the identity and issuer in your release policy and the image’s pinned digest. To try a public example, use the signed Cosign image and expected publisher in Sigstore’s installation guide. Change only the expected identity and verify the same digest again.

~~~
cosign verify --certificate-identity "$EXPECTED_IDENTITY" \
  --certificate-oidc-issuer "$EXPECTED_ISSUER" "$IMAGE_AT_DIGEST"
~~~

**Check.** Cosign accepts the pinned image with the correct identity and issuer and fails when only the expected identity changes.

## 3. Notation

Install the approved trust store. Import a strict trust policy scoped to the image repository that names the full certificate subject expected from your signer. Verify the same digest against that policy. In disposable configuration, change only the expected subject, then restore it. If a signed digest fails, run notation verify -v to inspect the reason.

~~~
notation verify "$IMAGE_AT_DIGEST"
~~~

**Check.** Notation says Successfully verified signature with the matching policy. With the wrong subject, verbose output says the signing certificate does not match the trusted identities.

## 4. Test the release gate

In a scratch build, require the verification command to succeed before continuing. Run the build on the intended signed digest and an unsigned digest. Check that the unsigned image stops the gate.

**Check.** A digest with no signature fails the build check. If your publisher sets a signature expiry, also check that a disposable signature fails once it expires.

## Check your result

Verification accepts the pinned image from the approved publisher. An unsigned image or a different signer fails the required check in the scratch build.

### What we tested

**Tested on November 18, 2026.** Cosign 3.1.4 verified the project’s public GHCR image by digest and rejected a different expected publisher identity. In a disposable Distribution 3.1.2 registry, Notation 1.3.2 accepted the pinned image under a strict trust policy. It rejected a different trusted subject, an unsigned image and an expired signature.

[How to verify your setup](https://keysigner.io/integrations/verify-a-setup/)

## If you get stuck

### A signature exists but the image fails the gate

Review the registry and image digest first. Then check the certificate identity and issuer in Cosign, or the repository scope, trusted identity and trust store in Notation.

## Tools in this guide

- [Sigstore](https://keysigner.io/integrations/sigstore/)
  - [Verify the signer identity and issuer](https://docs.sigstore.dev/quickstart/verification-cheat-sheet/)
- [Cosign](https://keysigner.io/integrations/cosign/)
- [Notation](https://keysigner.io/integrations/notation/)

## Setup instructions

- [Verify keyless container image signatures with Cosign](https://docs.sigstore.dev/cosign/verifying/verify/)
- [Sign and verify a test container image with Notation](https://notaryproject.dev/docs/quickstart-guides/quickstart-sign-image-artifact/)
- [Scope a Notation trust policy to approved repository and signer identities](https://github.com/notaryproject/specifications/blob/main/specs/trust-store-trust-policy.md)
- [Try a release approval gate](https://keysigner.io/integrations/guides/test-a-release-approval-gate/)
- [Check the signing identity used for Cosign’s own releases](https://docs.sigstore.dev/cosign/system_config/installation/)
- [Check an approved package with Cosign](https://keysigner.io/integrations/guides/check-an-approved-package-with-cosign/)
- [Check an approved container image with Notation](https://keysigner.io/integrations/guides/check-an-approved-image-with-notation/)

[More guides for this task](https://keysigner.io/integrations/tasks/review-code-and-releases/)
