Overview
Control gates are checkpoints in your software supply chain that enforce specific policies and security checks. They ensure that only compliant artifacts and pieces of evidence progress through the pipeline, enhancing the overall security and integrity of your software delivery process. Control gates can be configured to evaluate various criteria, such as vulnerability scans, license compliance, code quality metrics, and more. By implementing control gates, organizations can automate the enforcement of security and compliance standards, reducing the risk of introducing vulnerabilities into production environments.Implementing Control and Quality Gates with Chainloop
In Chainloop, control gates are implemented through policies that are evaluated against pieces of evidence (materials), entire attestation documents, or stored compliance data. These policies serve as acceptance criteria for the organization to ingest those materials or to proceed with further steps in the software supply chain. If a control gate policy evaluation fails, the CLI commandchainloop attestation push will return a non-zero exit code but the attestation is still sent to Chainloop. This approach ensures that all activities are tracked, even those that do not meet compliance standards.
Configuring enforcement
Policies enforcement (gating) can be configured as a default for the organization and/or on a per policy basis.Organization default
Global policy enforcement can be set globally by organization administrators. This will affect to all products and contracts within the organization. Please refer to Policies section for further reference. By selecting this option you’ll be effectively blocking the pipeline workflow runs that do not meet the compliance standards.- Web UI
- CLI
To enable organization-wide control gates, navigate to the Organization Settings in the Chainloop Web UI (only available in paid plans) and set the “Policy Violation Strategy” to “Enforced”.

Fine-grained per policy
You can control gating on a per-policy basis by setting thegate property in the policy attachment in the contract. This allows for more granular control over specific products or services, and overrides the organization-wide setting.
Using control gates in your CI/CD pipeline
A typical use case for control gates is to enforce security checks before allowing an artifact to be promoted to production. For example, you might want to ensure that no critical vulnerabilities are present in the codebase before proceeding with a release. This will be usually done in the CI/CD pipeline, where thechainloop attestation push command is executed after running security scans and tests. If the control gate policies are not met, the pipeline can be configured to halt further steps, preventing non-compliant artifacts from being deployed.
chainloop attestation push command will return a non-zero exit code, indicating that the attestation did not pass the required checks. This mechanism helps prevent non-compliant artifacts from progressing through the CI/CD pipeline.

Bypassing Control Gates
While blocking pipelines with control gates is essential for maintaining security and compliance standards, there are situations where an exception can be granted. Option 1: Server-side requirement exception If the control gate is based on a compliance control (see example below), you can perform an exception for the requirement in the Chainloop UI to allow the gate to continue.
--exception-bypass-policy-check flag to handle these scenarios:
Chainloop provides the --exception-bypass-policy-check flag to handle these scenarios:

Examples
Example 1: check compliance requirements for my project
Chainloop provides a built-in policy calledcheck-compliance-requirement that can be used to check compliance requirements for a project. To use it, just attach it to a contract and set the gate flag to true.
In the example below, the contract is configured to check that the project version being attested meets the “no-vulnerabilities-high” and “sbom-compliance” compliance requirements defined in the builtin framework “Chainloop Best Practices”.


chainloop.project_compliance built-in function which is only available for paid plans.
