Skip to content

Scan registry images from CI

Supply › Image registry and Reproducible builds are filled by untrust registry scan, run in your CI against a trust policy you keep in the console. The scan resolves each image to its digest and checks that it is signed by a trusted identity, deployed by digest rather than a mutable tag, and, for enclave images, recomputes to the measurement your key policy expects.

Connecting a registry so that untrust pulls and scans your images itself is not available yet.

What you need

  • A registered pipeline on GitHub Actions or GitLab CI; see Scan code and IaC in CI.
  • The cosign binary in the CI job (on PATH, or named by UNTRUST_COSIGN) to verify OCI signatures.
  • Read access, from the CI job, to the registries and buckets that hold your artifacts.

1. Build the trust policy

The trust policy lists the images to check, the signers you trust, how fresh a verification must be, and the measurement each enclave image must recompute to. It lives on Supply › Image registry › Trust policy.

To fill it without typing references, an administrator uses the Discovery tab:

  1. Choose List images. untrust lists recent image tags in Amazon ECR, Artifact Registry and Azure Container Registry through your verified cloud connections. It reads repository and image metadata only.
  2. Select the images to track and choose Propose policy revision. Each pick is pinned to the digest shown.
  3. On the Trust policy tab, review the waiting revision and choose Apply revision N.

A proposal trusts nothing until an administrator applies it, and CI keeps fetching the last applied revision until then. Every change is a new, audited revision.

2. Allow the pipeline to send registry results

A new pipeline binding accepts build and IaC receipts only. An administrator widens it to accept registry evidence; see Allow more kinds of evidence.

3. Add the scan to your pipeline

The Trust policy tab shows, for each active pipeline binding, the exact command with Copy command. It fetches the applied policy with the job's OIDC identity:

untrust registry scan --policy-url https://app.untrustsecurity.com/v1/ci-policy/<org>/<binding> \
  --github-oidc --output .untrust/registry.json

Then send the report with the pipeline's identity:

python -m untrust.enterprise_ci_client --endpoint "$UNTRUST_SUBMIT_ENDPOINT" --github-oidc \
  --registry .untrust/registry.json

On GitLab, omit --github-oidc; the client reads the token from UNTRUST_CI_ID_TOKEN.

The scan exits 0 when every artifact verified, 1 on a confirmed failure and 2 when an artifact could not be assessed. Treat 2 as a failure. Each report names the policy sha256 it ran under.

4. Optional: pin measurements and watch for changes

  • untrust registry pins prints a Nitro KMS key policy condition, or a Confidential Space WIF condition, that admits only the verified images. See Registry scan.
  • untrust registry detect reads registry audit logs for moved tags, unsigned pushes and similar changes. Run it on a schedule; see Schedule detection runs.

Upload a report by hand

Writers can also choose Upload registry report on Image registry and pick a file that untrust registry scan --output wrote. An artifact delivered this way is marked Submitted · by a signed-in user (not pipeline-authenticated), and it cannot make a policy or compliance control pass.