Both kinds are verified: key-based signatures (
cosign sign --key) against
the public keys a rule trusts, and keyless signatures (a short-lived Fulcio
certificate with a Rekor bundle, cosign sign with OIDC) against the Sigstore
public-good trust root and the signer identity a rule trusts. See
Keyless signers and Limits.Require a signed image
Add a rule withsigned_by to a policy. It holds the public keys you trust,
exactly as cosign writes them to cosign.pub:
- is about the image, not about findings. It cannot be combined with
min_severityor any other finding condition in the same rule; write those as a second rule, as above. - takes effect
failorwarn, and up to 10 keys. The image must be signed by any one of them. - does not apply to a scan of a repository, a filesystem or an SBOM, and says so in the verdict.
- accepts a PEM public key (
-----BEGIN PUBLIC KEY-----). Anything else, including a private key pasted by mistake, is refused when the version is created, and the error does not repeat what was pasted. ECDSA P-256, which is whatcosign generate-key-pairproduces, is the key type the tests use; RSA and Ed25519 keys go through the same library and have no test.
Scan after adding a key
A scan verifies against the keys trusted by the latest version of every policy in your organization at the moment it runs, whether or not the policy is enabled. So the order is: add the rule, scan the image, then request a verdict. A scan that ran before the key was added did not check it, and the rule fails with “this scan did not check the image against this rule’s keys; scan the image again”. Because disabled policies count, you can add a signature rule to a draft policy, scan, read the result on the scan, and enable the policy once it decides what you expect.What the rule decides
The rule passes in exactly one case: the scan verified a signature made by one of the rule’s keys. Everything else fails it (or warns, if that is its effect), including the cases where TRUSTIVAN could not tell:
A registry outage therefore blocks a gated build rather than letting an
unsigned image through. That is deliberate.
What a scan records
GET /api/v1/scans/{id} returns the check as signature_verification, and
the scan’s page in the dashboard shows it under Target → Image signature:
The field is absent when no check was made: the scan was of something other
than a container image, or it ran before this feature existed.
A key is identified by its
fingerprint, the SHA-256 of the public key, so
the same key is the same key however it was pasted.
How a signature is verified
For each signature next to the image, TRUSTIVAN checks two things, and both must hold:- one of your trusted keys verifies the signature over its signed payload;
- that payload names this image’s digest.
predicate_type is read from the signed statement.
A tag is resolved to a digest first, and for a multi-platform tag that is the
digest of the index. TRUSTIVAN looks for signatures on that digest and, when
the scanner reports a different digest for what it actually scanned and the
first has none, on that one too.
Attestations are reported, not enforced: no policy rule requires one.
Where the request goes
The check reads the same registry the scan pulled from, with the same stored registry credential, through the same guarded transport and registry policy. It makes a handful of small requests and is given 60 seconds; a registry that does not answer is recorded asunknown and the scan still succeeds with its findings.
Keyless signers
A signer insigned_by without public_key is a keyless identity: the OIDC
issuer, exactly, and a subject regular expression the certificate’s
identity (an email, or a URI such as a GitHub Actions workflow ref) must match
in full.
- the certificate chains to a Fulcio root in the embedded Sigstore trust root
(
sigstore/root-signing’strusted_root.json), at the time Rekor logged it; - the certificate’s key verifies the signature over the signed payload, and the payload names the image’s digest;
- the Rekor bundle’s signed entry timestamp verifies with a Rekor key from the trust root, and the logged entry is this signature, this certificate and this payload’s hash;
- the certificate’s OIDC issuer equals
issuerand its identity matchessubject.
"signer": "<identity> (<issuer>)") even when no rule trusts it, so you can
see who signed before writing the rule. Tested against
gcr.io/distroless/static’s real keyless signature
(keyless@distroless.iam.gserviceaccount.com, https://accounts.google.com),
and against tampered copies of it.
Limits
- Keyless: the certificate’s SCT is not checked, nor a Rekor inclusion proof; the signed entry timestamp is what is verified (as cosign does offline for this layout). The trust root is embedded: a Fulcio or Rekor key rotation needs a TRUSTIVAN release. A private Sigstore deployment is not supported.
- Signatures stored as OCI referrers in the Sigstore bundle format are not
found. cosign 3 writes that format by default. TRUSTIVAN reads the
sha256-<digest>.sigand.atttags that cosign 1 and 2 write, which cosign 3 writes only when its new bundle format is turned off. - No transparency-log check. A key-based signature is accepted on the key alone; TRUSTIVAN does not confirm a Rekor entry exists.
- No key expiry or revocation. A key is trusted for as long as a policy lists it. Remove it by adding a policy version without it, then rescan.
- Notation (Notary v2) signatures are not read.
- Checked at scan time only. A signature added after the scan is not seen until the next scan, and nothing re-verifies an image that is already running.
- What the tests cover. The verifier is tested against a local registry
with signatures it constructs, including a signature copied from another
image, a tampered payload and an untrusted key. A further test signs and
attests an image with the real
cosignbinary and verifies it; it runs only wherecosignis installed and is skipped, with that reason, elsewhere. It has not been exercised against every registry product.
Related
- Policies and verdicts
- Supply chain security: how TRUSTIVAN’s own images are signed
- GitHub Actions: the gate that enforces the verdict