When TRUSTIVAN scans a container image it also looks for the cosign signatures and attestations published beside that image, verifies them against the public keys your policies trust, and records the result on the scan. A policy rule can then refuse an image that is not signed by one of those keys.
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 with signed_by to a policy. It holds the public keys you trust, exactly as cosign writes them to cosign.pub:
Creating a policy version needs a signed-in owner or admin; an API key cannot change a policy. In the dashboard, open the policy, choose New version, and turn on Require a cosign signature on the image on a rule: the editor clears the rule’s finding conditions and the ignore effect, and Add a keyless signer takes a name, the OIDC issuer (GitHub Actions, GitLab, Google and the Sigstore public issuer are offered) and the subject, either exactly (it is escaped into a pattern for you) or as a pattern. It checks a signer as the API does (below) before the version is sent, and a signature rule with no signer cannot be submitted. Public keys already on a rule are kept and can be removed there; adding one is done through the API. A signature rule:
  • is about the image, not about findings. It cannot be combined with min_severity or any other finding condition in the same rule; write those as a second rule, as above.
  • takes effect fail or warn, 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 what cosign generate-key-pair produces, 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:
  1. one of your trusted keys verifies the signature over its signed payload;
  2. that payload names this image’s digest.
The second check is what stops a genuine signature for one image being copied beside another. An attestation is verified the same way: the key must verify the envelope, and the statement inside must name this image’s digest. Its 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 as unknown and the scan still succeeds with its findings.

Keyless signers

A signer in signed_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.
A keyless signature is accepted when all of these hold:
  1. the certificate chains to a Fulcio root in the embedded Sigstore trust root (sigstore/root-signing’s trusted_root.json), at the time Rekor logged it;
  2. the certificate’s key verifies the signature over the signed payload, and the payload names the image’s digest;
  3. 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;
  4. the certificate’s OIDC issuer equals issuer and its identity matches subject.
The scan’s record names the verified signer ("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>.sig and .att tags 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 cosign binary and verifies it; it runs only where cosign is installed and is skipped, with that reason, elsewhere. It has not been exercised against every registry product.