Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions getting_started/attestations.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ All `kosli attest` commands support flags for attaching additional data. These f
|------|-------------|---------|
| `--user-data` | All evidence attest commands | Attach structured JSON metadata that is stored and visible alongside the attestation in the Kosli UI |
| `--attachments` | All evidence attest commands | Upload files or directories to the Evidence Vault as compressed archives for later download |
| `--attestation-data` | `attest custom` only | Provide the JSON payload that the custom type's jq rules evaluate to determine compliance |
| `--attestation-data` | `attest custom` only | Provide the JSON or YAML file that the custom type's jq rules evaluate to determine compliance |
| `--annotate` | All evidence attest commands | Attach `key=value` annotations that are displayed as a label/value pair on the attestation in the Kosli UI |

### When to use which
Expand Down Expand Up @@ -205,12 +205,20 @@ kosli attest generic \
--attachments scan-report.html,scan-config.yml
```

Use **`--attestation-data`** on `kosli attest custom` to provide the JSON data that the custom
Use **`--attestation-data`** on `kosli attest custom` to provide the data that the custom
attestation type's jq expression evaluates. This is what determines the compliance status of the
attestation. See the [Custom](#custom) attestation type below for details.

The `--attestation-data` JSON payload sent to Kosli is limited to 1 MB; larger payloads fail with a
400 error. For larger reports, distill the data you need into a summary and attach the full document
The file can be JSON or YAML. The CLI picks the format from the file extension: it converts a
`.yaml` or `.yml` file to JSON before sending it, and reads any other file as JSON. YAML reads an
unquoted number with a leading zero as octal (`0644` becomes `420`) and drops trailing zeros from
decimals (`1.10` becomes `1.1`), so quote version-like values and codes (`"1.10"`, `"0123"`)
Comment on lines +213 to +215

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved — this now names both causes (octal leading zero and dropped trailing zeros on decimals), matching the suggested wording. Closing this thread.

to keep them as written. A YAML file with several documents needs `--attestation-data-as-list`,
which sends the documents as a JSON list. See
[`kosli attest custom`](/client_reference/kosli_attest_custom) for the full conversion rules.

The `--attestation-data` JSON payload sent to Kosli is limited to 1 MB, measured after any YAML
conversion; larger payloads fail with a 400 error. For larger reports, distill the data you need into a summary and attach the full document
separately — see [Attesting large documents](/tutorials/attest_large_documents).

```shell
Expand Down
2 changes: 2 additions & 0 deletions tutorials/attest_custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Prepare a JSON file with the data you want to attest. Save it as `coverage.json`

In every example below, this `coverage.json` is the value of `--attestation-data`.

`--attestation-data` also accepts a `.yaml` or `.yml` file, which the CLI converts to JSON before sending it.

## 2. Report the attestation

A custom attestation can be bound to either a **trail** or an **artifact**. Pick the option that matches what you want to attest about.
Expand Down
Loading