You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with Chainloop [0.93.8](https://github.com/chainloop-dev/chainloop/releases/tag/v0.93.8), operators can attach policies to contracts.
6
9
These policies will be evaluated against the different materials and the statement metadata, if required. The result of the evaluation is informed as a list of possible violations and added to the attestation statement
7
10
before signing and sending it to Chainloop.
@@ -11,32 +14,15 @@ be used for building server side control gates.
11
14
12
15
### Policy specification
13
16
A policy can be defined in a YAML document, like this:
* (2) they can be optionally applied to a specific type of material (check [the documentation](./operator/contract#material-schema) for the supported types). If no type is specified, a material name will need to be provided explicitly in the contract.
39
-
* (3) they have a policy script that it's evaluated against the material (in this case a CycloneDX SBOM report). Currently, only [Rego](https://www.openpolicyagent.org/docs/latest/policy-language/#learning-rego) policies are supported.
23
+
* policies have a name (cyclonedx-licenses)
24
+
* they can be optionally applied to a specific type of material (check [the documentation](./operator/contract#material-schema) for the supported types). If no type is specified, a material name will need to be provided explicitly in the contract.
25
+
* they have a policy script that it's evaluated against the material (in this case a CycloneDX SBOM report). Currently, only [Rego](https://www.openpolicyagent.org/docs/latest/policy-language/#learning-rego) policies are supported.
40
26
41
27
Policy scripts could also be specified in a detached form:
42
28
```yaml
@@ -97,35 +83,12 @@ There are two ways to attach a policy to a contract:
97
83
are both equivalent. The advantage of having remote policies is that they can be easily reused, allowing organizations to create policy catalogs.
98
84
99
85
* If preferred, authors could create self-contained contracts **embedding policy specifications**. The main advantage of this method is that it ensures that the policy source cannot be changed, as it's stored and versioned within the contract:
In the example above, we can see that, when referenced by the `policy` attribute (1), a full policy can be embedded in the contract.
91
+
In the example above, we can see that, when referenced by the `policy` attribute (1), a full policy can be embedded in the contract.
129
92
130
93
### Rego scripts
131
94
Currently, policy scripts are assumed to be written in [Rego language](https://www.openpolicyagent.org/docs/latest/policy-language/#learning-rego). Other policy engines might be implemented in the future.
0 commit comments