Set Policies expectations
In the previous step, we created a contract that set the expectation of a container image and an optional SBOM. Our Compliance team now wants to verify that those comply with the company’s security and compliance criteria.
We introduce Policies, which are rules evaluated against materials and/or the whole attestation document.
See our Policies reference for more information.
Adding policies to the contract
Click on “Create contract”, and create a new contract with the name “qs-policies”, and with the following schema:
Click on “Create contract”, and create a new contract with the name “qs-policies”, and with the following schema:
TODO: add once we can host the contract schema in Mintlify
In this contract, we added two policies.
artifact-signed
policy checks that all OCI artifacts (container images and Helm Charts) are properly signed with Cosign or Notarysbom-version
checks that the provided SBOMs have a minimum version (CycloneDX 1.6 in this case)
Chainloop comes with a set of built-in policies, you can see them all in the “Policies” section:
You can also create custom policies tailored to your needs. For more information about authoring policies, see the TODO
Evaluating policies
Let’s create an attestation and add our materials to see how policies are evaluated:
Initialize an attestation
Add the container image
You’ll notice how Chainloop will evaluate automatically as part of providing the container image.
Add the SBOM
Push the attestation
We can confirm that the sbom-version
policy was evaluated successfully.
Policy evaluations are part of the attestation, and thus they are immutable and stored in Chainloop’s evidence store for the long term.
Inspecting policy evaluations
Now, the Chainloop platform gives us more insights into the status of the attestation. If we go to the workflow run view, besides the usual attestation and material information, we can now see the result of those policy evaluations.