cosign stores a signature as a separate artifact in the same registry, under the tag sha256-<digest>. verify looks for exactly that signature for the image's digest and checks it with the public key. If it is missing or the key doesn't match, verify fails.
Symptom
cosign verify --key cosign.pub --allow-http-registry --insecure-ignore-tlog \ $R:1.0 2>&1 | tail -1 error during command execution: no signatures found
In the course only the image behind the tag 1.0-min is signed, 1.0 is not.
Diagnosis
Check the registry for a signature tag sha256-<digest> for the image.
curl -s http://172.16.0.126:30500/v2/notes-api/tags/list; echo
{"name":"notes-api","tags":["1.0","1.0-min","sha256-890cf194a609df6ddfbacfe1691..."]}
Causes
no signatures foundThis image is not signed
The signature is attached to the digest, not to the tag. Another tag with another digest has no signature.
no matching attestationsWrong public key
The signature exists, but doesn't match the key given.
error during command execution: no matching attestations: failed to verify signature: could not verify envelope: accepted signatures do not match threshold, Found: 0, Expected 1
Fix
cosign sign --key cosign.key --signing-config signing-config.json \
--allow-http-registry --yes $I
Signing artifact...
Pushing signature to: 172.16.0.126:30500/notes-api
cosign verify --key cosign.pub --allow-http-registry --insecure-ignore-tlog \
$R:1.0-min 2>/dev/null | jq -c '.[0].critical.image'
{"docker-manifest-digest":"sha256:890cf194a609df6ddfbacfe1691362efcc87b00c48a2cb..."}
Don't: Using the older --tlog-upload=false. cosign 3 rejects it and points to the signing config.
CKS hands-on, day 14: allowed registries with a ValidatingAdmissionPolicy, digests, cosign, ImagePolicyWebhook and static analysis.
Go to day 14 →
FAQ
Does the API server check signatures itself?
No. In the cluster an admission webhook such as the Sigstore policy-controller or Kyverno enforces that.