Skip to main content
This feature is only available on Chainloop’s platform paid plans.
Chainloop policies usually evaluate what a build sends. The Wiz integration adds what runs now. Each hour, Chainloop reads from Wiz the container images that run in your Kubernetes clusters, container services, and functions. It finds the project versions that attested the digest of each image, and attests the list of running images on each of those project versions. The image-age and end-of-life policies check that list. A framework requirement such as “no running image is older than 90 days” then passes or fails on the images that run now, with no scheduled job in your repositories.

How It Works

  1. Snapshot. Each hour, Chainloop reads the running images from Wiz, inside the selection of the connection. A snapshot includes the images of Kubernetes deployments, daemon sets, stateful sets, jobs, and pods, and of container services and functions.
  2. Match. For each image digest, Chainloop finds the project versions that attested that exact digest. An image that no project version attested gets no attestation.
  3. Attest. Each project version with a running image gets one attestation that lists all its running images. The attestation goes into the wiz-running-images workflow of its project. Chainloop creates this workflow before the first attestation in the project.
  4. Evaluate. The policies of the shared contract evaluate each attestation. Framework requirements use the results as they use any other policy result.
  5. Clear. When the images of a failing project version stop running, Chainloop attests an empty list for it. An empty list passes, so the project version passes.
Chainloop attests a project version again when its running images or their build times change, and at least every 24 hours while it runs. A change of location alone does not make a new attestation, because jobs and pods get new names at each run.
Chainloop acts only on a complete snapshot. When Wiz returns an error, a request times out, or the digest lookup fails, the snapshot is incomplete. Chainloop then attests nothing and clears nothing, so the results stay as the last complete snapshot left them.

Prerequisites

  • The Org Admin or Owner role in Chainloop. See Roles and Permissions.
  • A plan with built-in workflows. Without them, Chainloop refuses the connection with the message “Wiz connections are not included in this organization’s plan”.
  • Project versions that attested the container images they build. Chainloop matches the exact image digest, for example from a CONTAINER_IMAGE material.

Connect Wiz

An organization has one Wiz connection.

Step 1: Create a Wiz Service Account

  1. In the Wiz portal, create a service account with the read:resources scope. Chainloop needs no other scope.
  2. Copy the client ID and the client secret of the service account.
  3. Copy the API endpoint of your tenant: open the user menu, then Tenant Info. The endpoint has the form https://api.<data-center>.app.wiz.io/graphql.
Chainloop accepts only an HTTPS endpoint in one of the three Wiz environments: app.wiz.io, gov.wiz.io, and app.wiz.us. It sends the client secret only to the OAuth host of that environment (auth.app.wiz.io, auth.gov.wiz.io, or auth.app.wiz.us), and the token only to the endpoint.

Step 2: Register the Connection

  1. Go to the Integrations page, select Wiz, and click Connect.
The Wiz integration panel with no connections yet and the Connect button
  1. Enter a Name, and optionally a Description.
  2. Enter the Endpoint, the Client Id, and the Client Secret of the service account.
  3. Click Register.
The Add Registration form for Wiz with the Name, Description, Endpoint, Client Id, and Client Secret fields
Chainloop checks the endpoint and the service account before it saves the connection. It refuses a wrong client secret, an endpoint outside the Wiz environments, or a service account without the read:resources scope, and the message names the cause. The first snapshot starts within 10 minutes after you save the connection.
A self-hosted installation with restricted egress must allow HTTPS from the backend workers to the API host and the OAuth host of your Wiz environment.

Narrow the Selection

By default, a snapshot includes every container image that runs in a workload that the service account can see. To narrow it, open the Wiz connection and use the Selection section:
  • Cloud accounts: the filter applies to every workload.
  • Clusters: the filter applies only to Kubernetes workloads.
Leave a list empty to include all that the service account can see, then click Save Selection. A change applies from the next snapshot. Only org admins see and change the selection.
The Selection section of the Wiz connection with one cloud account and two clusters selected
The lists of cloud accounts and clusters come from the latest complete snapshot, and the section shows its time. A new cloud account or cluster appears in the lists after the next complete snapshot. Before the first complete snapshot, the lists are empty and you cannot change the selection.
The selection says which workloads count as running. When you narrow it, a failing project version whose images run only outside the selection stops running for Chainloop, and it passes at the next complete snapshot.

Check the Connection Status

Open the Wiz connection on the Integrations page. The Latest snapshot section shows the time and the state of the latest snapshot, and when the next snapshot starts.
The Latest snapshot section of the Wiz connection with a complete snapshot and its image counts
When the latest snapshot is complete, the connection also shows three image counts. Each count is a number of image digests.
  • Images read: the running images in the snapshot.
  • Matched a project version: the running images that a project version attested.
  • No match: the running images that no project version attested. They get no attestation.
Use the counts to check your selection, and how many of your running images Chainloop knows. Org admins and org viewers see the counts. Org members and contributors do not, because the counts cover all the projects of the organization.

The Wiz Workflow

Chainloop creates the wiz-running-images workflow in a project when one of its project versions first runs an image. The workflow comes from the built-in Wiz Running Images template, which the template catalog does not show. Only the Wiz integration attests into it: it has no CI pipeline and no scan task. Each attestation holds one EVIDENCE material named running-images, with the evidence ID CHAINLOOP_WIZ_RUNNING_IMAGES. The material lists the running images of the project version at the snapshot time:
  • build_time is the Wiz build time of the image. It is missing when Wiz has no build time for the image.
  • A location is a cluster, a namespace, and a workload, or a cloud account (cloud_account) and a container service or a function.
  • An attestation that clears a failing project version has an empty images list.

Policies and Contract

All the Wiz workflows of an organization share one contract, chainloop-wiz-running-images. It runs two built-in policies on the running-images material: Both policies fail an image that has no Wiz build time, with the reason “no build time”. Both policies pass an empty list, because no image runs. The two policies count the age differently. With both limits at 90 days, an image that is 90 days and 23 hours old passes image-age (90 whole days) and fails end-of-life. A change to the shared contract applies from the next attestation of each project version, at most 24 hours later. For the same reason, an image can pass the limit up to 24 hours before its result fails.

Use the Results in a Framework Requirement

Add the image-age or end-of-life policy to a project-scoped framework requirement, as you do for any other policy. The policy evaluations of the Wiz workflow then match the requirement through Requirements Auto-Matching:
The requirement passes or fails on each project version, and on each product version that includes it. A project version that never ran has no Wiz attestation, so the requirement stays pending on it.

Example: One Project Version over Time

The image-age policy has a limit of 90 days. Project version v1.2 runs images A and B.

Limitations

  • An organization has one Wiz connection. Products and projects have no Wiz settings of their own.
  • Chainloop attests only the images that a project version attested, by exact digest. The other images appear only in the No match count.
  • An image that Wiz finds only on a virtual machine or a scale-set node is not a running image.
  • Wiz has no build time for some images, for example some images from GitHub Container Registry. Both policies fail these images with the reason “no build time”.
  • When released versions are immutable, Chainloop cannot attest on them, so released versions get no Wiz results.