This feature is only available on Chainloop’s platform paid plans.
Overview
Chainloop lets you manage compliance resources declaratively by defining them as YAML files and applying them via the CLI. This GitOps-friendly approach means you can:- Version-control resource definitions alongside your code
- Review changes through pull requests before they take effect
- Automate resource management in CI/CD pipelines
- Reproduce configurations across environments
apiVersion, kind, metadata, and spec fields. Apply operations are idempotent—if a resource with the same name already exists, it is updated; otherwise, a new one is created.
Supported Resources
For full details on each resource type, see Compliance Frameworks, Policies, Policy Groups, and Contracts.
Getting Started
Before you begin, make sure you have:- Chainloop CLI Enterprise Edition installed - see the CLI installation guide
- Authenticated to your organization - run
chainloop auth login
chainloop apply -f ./compliance/ - Chainloop resolves dependencies automatically. See Applying Resources at Scale.
Step 1 - Write a Policy
A policy contains the Rego rules that Chainloop evaluates against your attestation materials. Start by defining one that checks CycloneDX SBOMs for components missing license information. Createcyclonedx-licenses.yaml:
Step 2 - Group Policies Together
A policy group bundles related policies into a reusable unit. Let’s create one that groups thecyclonedx-licenses policy from Step 1 with another SBOM policy to form a complete SBOM quality check.
Create sbom-quality-group.yaml:
cyclonedx-licenses policy you just created alongside sbom-banned-licenses, a built-in policy that ships with Chainloop. The attestation section checks that an SBOM was included in the attestation; the materials section runs quality checks against the SBOM itself.
Apply and verify:
Step 3 - Define a Requirement
A requirement specifies what must be satisfied for compliance - which policies to evaluate, how often, and what manual evidence is needed. Let’s create one that enforces license compliance by referencing the policy from Step 1. Createlicense-compliance.yaml:
periodicity (how often a policy is re-evaluated, e.g. daily, weekly), sla (grace period in hours before failures affect the compliance score), group (to organize policies into groups where any member passing satisfies the group), and manual_proofs for evidence that can’t be automated (e.g., license review sign-offs). For the full schema, see Compliance Frameworks.
Apply and verify:
Step 4 - Build a Framework
A framework organizes requirements into a structured compliance program. You can group requirements into sections (and nested sub-sections) to model standards like CRA, SLSA, or your own internal policies. Let’s build one that includes the requirement from Step 3. Createbest-practices.yaml:
branch-protection, code-review) with the custom license-compliance requirement you created in Step 3. Chainloop ships with a library of built-in requirements and policies - your custom resources extend them.
Apply and verify:
Each requirement can only appear once in a framework - either at the root level or within a section, not both.
Step 5 - Tie It Together in a Contract
A contract defines the attestation expectations for a workflow - what materials to collect and which policies and policy groups to evaluate. This is where everything comes together: the contract references the policy group from Step 2, which in turn includes the policy from Step 1. Createexample-contract.yaml:
Applying Resources at Scale
The steps above apply resources one at a time. Thechainloop apply command can handle any resource type, including multi-document YAML files and entire directories:
When applying multiple resources, Chainloop processes them in dependency order: Policies, then Policy Groups, then Requirements, then Frameworks, then Contracts. Multi-document YAML files use
--- as the separator between resources.Inspecting and Exporting Resources
After applying resources, you can verify them, explore what’s deployed, and export definitions for backup or migration. Export a resource as reusable YAML with the--output schema flag - useful for bootstrapping new configurations, backing up resources, or migrating between organizations:
Automating with CI/CD
Store your YAML resource definitions in a git repository and apply them automatically whenever changes are merged. This ensures compliance configurations are always up to date and auditable. You’ll need an API token stored as a CI secret.- GitHub Actions
- GitLab CI
