Where Signatures Live: Referrers & cosign tree
GPG signatures for release files sit next to the files (app.tar.gz.asc). Container images have no "next to": a registry stores manifests and blobs. cosign's answer is to store signatures in the same repository as the image, as OCI artifacts that refer to the image digest. No extra server, and anyone who can pull the image can fetch its signatures.
What cosign 3 writes
crane push /opt/samples/images/alpine-3.18.0.tar localhost:5000/shop/app:1.4.2 > /dev/null 2>&1
D=$(crane digest localhost:5000/shop/app:1.4.2)
cosign sign --key /opt/keys/cosign.key --signing-config /opt/sigstore/offline-signing-config.json "localhost:5000/shop/app@$D" > /dev/null 2>&1
echo "--- tags in the repository"
crane ls localhost:5000/shop/app
echo "--- the referrers index behind the sha256-… tag"
crane manifest "localhost:5000/shop/app:${D/:/-}" | jq '{mediaType, manifests: [.manifests[] | {artifactType, annotations}]}'--- tags in the repository
1.4.2
sha256-f04ffda0b1406b530a735ae8676c9d6fa527618e842cc66b1bc09ae4dbd44e0b
--- the referrers index behind the sha256-… tag
{
"mediaType": "application/vnd.oci.image.index.v1+json",
"manifests": [
{
"artifactType": "application/vnd.dev.sigstore.bundle.v0.3+json",
"annotations": {
"dev.sigstore.bundle.content": "dsse-envelope",
"dev.sigstore.bundle.predicateType": "https://sigstore.dev/cosign/sign/v1",
"org.opencontainers.image.created": "2026-10-23T21:59:07Z"
}
}
]
}
Two things appeared:
- A signature manifest whose
artifactTypeis a Sigstore bundle (application/vnd.dev.sigstore.bundle.v0.3+json): the signature, the signed payload (a DSSE envelope) and the verification material, in Sigstore's standard bundle format. - A tag
sha256-<image digest>pointing at an index that lists that signature manifest. This is the OCI 1.1 referrers tag schema, the fallback for registries that don't implement the referrers API. This registry (Distribution 3.1) doesn't, so cosign maintains the index itself; on registries with the API (most cloud registries), the registry answersGET /v2/<repo>/referrers/<digest>and no tag is needed.
The signature manifest
crane push /opt/samples/images/alpine-3.18.0.tar localhost:5000/shop/app:1.4.2 > /dev/null 2>&1
D=$(crane digest localhost:5000/shop/app:1.4.2)
cosign sign --key /opt/keys/cosign.key --signing-config /opt/sigstore/offline-signing-config.json "localhost:5000/shop/app@$D" > /dev/null 2>&1
SIG=$(crane manifest "localhost:5000/shop/app:${D/:/-}" | jq -r '.manifests[0].digest')
crane manifest "localhost:5000/shop/app@$SIG" | jq '{artifactType, config: .config.mediaType, layer: .layers[0].mediaType, subject: .subject.digest}'
BUNDLE=$(crane manifest "localhost:5000/shop/app@$SIG" | jq -r '.layers[0].digest')
crane blob "localhost:5000/shop/app@$BUNDLE" | jq '{mediaType, verificationMaterial: (.verificationMaterial | keys), keyHint: (.verificationMaterial.publicKey | has("hint")), payloadType: .dsseEnvelope.payloadType, signatures: (.dsseEnvelope.signatures | length)}'{
"artifactType": "application/vnd.dev.sigstore.bundle.v0.3+json",
"config": "application/vnd.oci.empty.v1+json",
"layer": "application/vnd.dev.sigstore.bundle.v0.3+json",
"subject": "sha256:f04ffda0b1406b530a735ae8676c9d6fa527618e842cc66b1bc09ae4dbd44e0b"
}
{
"mediaType": "application/vnd.dev.sigstore.bundle.v0.3+json",
"verificationMaterial": [
"publicKey"
],
"keyHint": true,
"payloadType": "application/vnd.in-toto+json",
"signatures": 1
}
The subject is the image digest: that's the link. Inside the bundle, the signed payload is a DSSE envelope holding an in-toto statement (payloadType: application/vnd.in-toto+json) whose predicate type is https://sigstore.dev/cosign/sign/v1: cosign 3 expresses even a plain signature as a statement about the digest. The bundle identifies the key only by a hint (a hash of the public key); the verifier must already have the key, which is the point. With keyless signing the bundle carries a certificate and a transparency-log entry instead.
cosign tree
cosign tree lists everything attached to an image: signatures, attestations, SBOMs.
crane push /opt/samples/images/alpine-3.18.0.tar localhost:5000/shop/app:1.4.2 > /dev/null 2>&1
IMG=localhost:5000/shop/app@$(crane digest localhost:5000/shop/app:1.4.2)
SC=/opt/sigstore/offline-signing-config.json
cosign sign --key /opt/keys/cosign.key --signing-config $SC "$IMG" > /dev/null 2>&1
syft scan "$IMG" -q -o cyclonedx-json=sbom.cdx.json
cosign attest --key /opt/keys/cosign.key --signing-config $SC --type cyclonedx --predicate sbom.cdx.json "$IMG" > /dev/null 2>&1
cosign tree "$IMG" > tree.txt
head -1 tree.txt
tail -n +2 tree.txt | paste - - | sort | tr '\t' '\n' # cosign lists referrers in no fixed order; sort them📦 Supply Chain Security Related artifacts for an image: localhost:5000/shop/app@sha256:f04ffda0b1406b530a735ae8676c9d6fa527618e842cc66b1bc09ae4dbd44e0b
└── 🔗 https://cyclonedx.org/bom artifacts via OCI referrer: localhost:5000/shop/app@sha256:34fd4fcd3589e01488f31f23fb3f768d0651e86d5997343378306b8b3bbf9735
└── 🍒 sha256:2bb7e870e0d3fa35154cf59b4b224def97b701e388205201a834b654ed8189d6
└── 🔗 https://sigstore.dev/cosign/sign/v1 artifacts via OCI referrer: localhost:5000/shop/app@sha256:488ca43a7854286c87156c56e9cd911e16d5c1c8fbbdbd15a000413d4290e2ed
└── 🍒 sha256:08259e78bc4ae745e6da434f739e17fddf8b202e976e2336b58bcc70b4120958
Each 🔗 line is one kind of referrer (by predicate type), each 🍒 one stored bundle. Signing the same digest twice adds a second signature next to the first; verification passes if any signature satisfies the policy.
Moving signatures with the image
Signatures are tied to the digest and stored in one repository. Promoting an image without its referrers leaves the signatures behind:
crane push /opt/samples/images/alpine-3.18.0.tar localhost:5000/staging/app:1.4.2 > /dev/null 2>&1
D=$(crane digest localhost:5000/staging/app:1.4.2)
cosign sign --key /opt/keys/cosign.key --signing-config /opt/sigstore/offline-signing-config.json "localhost:5000/staging/app@$D" > /dev/null 2>&1
check() { cosign verify --key /opt/keys/cosign.pub --insecure-ignore-tlog "$1@$D" > /dev/null 2>&1 && echo "$1: signed" || echo "$1: NO signature"; }
crane copy localhost:5000/staging/app:1.4.2 localhost:5000/prod-a/app:1.4.2 > /dev/null 2>&1
oras cp -r --from-plain-http --to-plain-http localhost:5000/staging/app:1.4.2 localhost:5000/prod-b/app:1.4.2 > /dev/null
check localhost:5000/staging/app
check localhost:5000/prod-a/app
check localhost:5000/prod-b/applocalhost:5000/staging/app: signed
localhost:5000/prod-a/app: NO signature
localhost:5000/prod-b/app: signed
crane copy copied the image only; oras cp -r (recursive) copied the image and every referrer, so the signature verifies in the new repository with no re-signing.
Older layouts you will meet
cosign 1.x and 2.x stored signatures differently by default, and plenty of registries still contain them:
| Layout | Tag / mechanism | Written by |
|---|---|---|
| signature tag | sha256-<digest>.sig (an image whose layers are signature payloads) |
cosign 1/2 default |
| attestation tag | sha256-<digest>.att |
cosign 1/2 attest |
| SBOM tag | sha256-<digest>.sbom |
cosign attach sbom (deprecated) |
| OCI referrers + Sigstore bundle | referrers API, or the sha256-<digest> index tag |
cosign 3 default, Notation, oras |
cosign 3 still verifies the old .sig layout. If a policy engine or registry UI shows no signatures for a cosign-3-signed image, check whether it understands referrers.
Test yourself
On a registry without the OCI referrers API, how does a client find cosign 3 signatures for digest D?
- Through a Rekor lookup only
- Through a tag named after the digest (
sha256-<hex>) holding an index of referrers - In the image config
- In the image's labels
You crane copy a signed image to another repository and cosign verify fails there with 'no signatures found'. Why?
- The digest changed
- Signatures are stored as referrers in the source repository and weren't copied
- The key expired
- crane corrupts images
What does the subject field of a signature manifest contain?
- The signer's email
- The digest of the image being signed
- The tag
- The public key