Skip to content

Commit 70b9174

Browse files
committed
Fix type -> name error in tutorial
1 parent 7d4432e commit 70b9174

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

docs.kosli.com/content/tutorials/evaluate_trails_with_opa.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ To follow this tutorial, you need to:
1818
* [Install Kosli CLI](/getting_started/install/).
1919
* [Get a Kosli API token](/getting_started/service-accounts/).
2020
* Set the `KOSLI_API_TOKEN` environment variable to your token:
21+
2122
```shell {.command}
2223
export KOSLI_API_TOKEN=<your-api-token>
2324
```
@@ -51,18 +52,18 @@ allow if {
5152

5253
Let's break down what this policy does:
5354

54-
- **`package policy`** — every evaluate policy must use the `policy` package.
55-
- **`import rego.v1`** — use Rego v1 syntax (the `if`/`contains` keywords).
56-
- **`default allow = false`** — trails are denied unless explicitly allowed.
57-
- **`violations`** — a set of messages describing why the policy failed. The rule iterates over trails, then over pull requests within the `pull-request` attestation, looking for PRs where `approvers` is empty.
58-
- **`allow`** — trails are allowed only when there are no violations.
55+
* **`package policy`** — every evaluate policy must use the `policy` package.
56+
* **`import rego.v1`** — use Rego v1 syntax (the `if`/`contains` keywords).
57+
* **`default allow = false`** — trails are denied unless explicitly allowed.
58+
* **`violations`** — a set of messages describing why the policy failed. The rule iterates over trails, then over pull requests within the `pull-request` attestation, looking for PRs where `approvers` is empty.
59+
* **`allow`** — trails are allowed only when there are no violations.
5960

6061
{{<hint info>}}
6162
**Policy contract** — these are Kosli-specific conventions, not OPA built-ins:
6263

63-
- **`package policy`** — required. Kosli queries `data.policy.*` to find your rules.
64-
- **`allow`** — required. Must evaluate to a **boolean**. Kosli exits with code 0 when `true`, code 1 when `false`.
65-
- **`violations`** — optional but recommended. Must be a **set of strings**, where each string is a human-readable reason the policy failed. Kosli displays these when `allow` is `false`.
64+
* **`package policy`** — required. Kosli queries `data.policy.*` to find your rules.
65+
* **`allow`** — required. Must evaluate to a **boolean**. Kosli exits with code 0 when `true`, code 1 when `false`.
66+
* **`violations`** — optional but recommended. Must be a **set of strings**, where each string is a human-readable reason the policy failed. Kosli displays these when `allow` is `false`.
6667
{{</hint>}}
6768

6869
## Step 3: Evaluate multiple trails
@@ -135,7 +136,7 @@ allow if {
135136
This policy iterates over every artifact in the trail, looks up its `snyk-container-scan` attestation, and checks whether any result has a non-zero `high_count`.
136137

137138
Use `--attestations` to enrich only the snyk data (faster than fetching all attestation details).
138-
The value uses the format `artifact-name.attestation-type` — here, `dashboard` is the artifact name and `snyk-container-scan` is the attestation type:
139+
The value uses the format `artifact-name.attestation-type` — here, `dashboard` is the artifact name and `snyk-container-scan` is the attestation name:
139140

140141
```shell {.command}
141142
kosli evaluate trail \
@@ -259,12 +260,12 @@ kosli attest generic \
259260

260261
This creates a generic attestation on the trail with:
261262

262-
- **`--compliant`** set based on whether the policy allowed or denied — read directly
263+
* **`--compliant`** set based on whether the policy allowed or denied — read directly
263264
from the JSON report rather than relying on the exit code, which avoids issues with
264265
`set -e` in CI environments like GitHub Actions
265-
- **`--attachments`** containing the Rego policy (for reproducibility) and the full
266+
* **`--attachments`** containing the Rego policy (for reproducibility) and the full
266267
JSON evaluation report (including the input data the policy evaluated)
267-
- **`--user-data`** containing the violations, which appear in the Kosli UI as
268+
* **`--user-data`** containing the violations, which appear in the Kosli UI as
268269
structured metadata on the attestation
269270

270271
{{<hint warning>}}

0 commit comments

Comments
 (0)