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
31 changes: 31 additions & 0 deletions client_reference/kosli_create_attestation-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ These rules specify acceptable values for attestation data, e.g. `.age >= 21` or
When a custom attestation is reported, the provided data is evaluated according to the rules defined in its attestation-type.
All rules must return `true` for the evaluation to pass and the attestation to be determined compliant.

`--summary` defines one entry of the summary shown for attestations of this type, given as
`'NAME=EXPRESSION'` where the expression is a jq expression evaluated against the attestation data.
The flag can be repeated to add further entries, which are displayed in the order given, e.g.
`--summary "Critical=.critical_count" --summary "Tool=.scanner.name"`.
Each value is split on its first `=` only, so jq expressions containing `==` are unaffected.

`--summary-json` is an alternative to `--summary` for summaries that are easier to express as JSON,
given as a JSON array of `\{"name": ..., "expression": ...\}` entries, e.g.
`'[\{"name":"Critical","expression":".critical_count"\}]'`. The two summary flags cannot be combined.

Attestation types created without a summary fall back to the jq evaluation rules checklist.


## Flags
| Flag | Type | Description |
Expand All @@ -34,6 +46,8 @@ All rules must return `true` for the evaluation to pass and the attestation to b
| `-h`, `--help` | bool | help for attestation-type |
| `--jq` | stringArray | [optional] The attestation type evaluation JQ rules. |
| `-s`, `--schema` | string | [optional] Path to the attestation type schema in JSON Schema format. |
| `--summary` | stringArray | [optional] An attestation type summary entry, given as 'NAME=EXPRESSION'. Can be repeated. Cannot be used with `--summary-json`. |
| `--summary-json` | string | [optional] The attestation type summary, given as a JSON array of \{name, expression\} entries, e.g. '[\{"name":"Critical","expression":".critical_count"\}]'. Cannot be used with `--summary`. |


## Flags inherited from parent commands
Expand Down Expand Up @@ -77,6 +91,23 @@ kosli create attestation-type customTypeName
--schema person-schema.json
--jq ".age >= 18"
--jq ".age < 65"

```
</Accordion>
<Accordion title="create/update a custom attestation type with a summary">
```shell
kosli create attestation-type customTypeName
--schema scan-schema.json
--summary "Critical=.critical_count"
--summary "Tool=.scanner.name"

```
</Accordion>
<Accordion title="create/update a custom attestation type with a summary given as JSON">
```shell
kosli create attestation-type customTypeName
--schema scan-schema.json
--summary-json '[{"name":"Critical","expression":".critical_count"},{"name":"Tool","expression":".scanner.name"}]'
```
</Accordion>
</AccordionGroup>
Expand Down
28 changes: 14 additions & 14 deletions client_reference/kosli_diff_snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,8 @@ kosli diff snapshots aws-beta aws-prod --output=json
```json
{
"snappish1": {
"snapshot_id": "aws-beta#8091",
"snapshot_id": "aws-beta#8099",
"artifacts": [
{
"fingerprint": "00fe296ec6514fc1eb8918abb5b338260c8e7003d3eb0a57b8ac08a01d27d747",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/languages-start-points:86ac11b@sha256:00fe296ec6514fc1eb8918abb5b338260c8e7003d3eb0a57b8ac08a01d27d747",
"most_recent_timestamp": 1786437915,
"flow": "languages-start-points-ci",
"commit_url": "https://github.com/cyber-dojo/languages-start-points/commit/86ac11b8ec4938b27dbf0cd5a481435d4f7c89c9",
"instance_count": 1
},
{
"fingerprint": "0f760ded7dc5144ede96da884c408f9b50bd2a239aa51137adb6c8a8d7bc7f36",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/nginx:6f922fe@sha256:0f760ded7dc5144ede96da884c408f9b50bd2a239aa51137adb6c8a8d7bc7f36",
Expand All @@ -85,11 +77,11 @@ kosli diff snapshots aws-beta aws-prod --output=json
"instance_count": 1
},
{
"fingerprint": "31d2fe8b39715c5f5d7911c2bf11debed373bf23ba4e0543cccc9b91f1c3fd1e",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/web:1226370@sha256:31d2fe8b39715c5f5d7911c2bf11debed373bf23ba4e0543cccc9b91f1c3fd1e",
"most_recent_timestamp": 1786439206,
"fingerprint": "38af9d053f174ae9068d84158c2a36dca16bf3c8c5d64b77608462aec6cdd714",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/web:670a1f1@sha256:38af9d053f174ae9068d84158c2a36dca16bf3c8c5d64b77608462aec6cdd714",
"most_recent_timestamp": 1787073596,
"flow": "web-ci",
"commit_url": "https://github.com/cyber-dojo/web/commit/1226370a2f6b636e7e255bebe1d026dd894887d0",
"commit_url": "https://github.com/cyber-dojo/web/commit/670a1f1d8ab52c1fb5823bb2e66b77c45e71aaa5",
"instance_count": 3
},
{
Expand All @@ -108,6 +100,14 @@ kosli diff snapshots aws-beta aws-prod --output=json
"commit_url": "https://github.com/cyber-dojo/exercises-start-points/commit/074353df2a7ea1ea386a78d16300ebac1dbe94fd",
"instance_count": 1
},
{
"fingerprint": "8e7fb4cfe9953032bde5488c656ad255e49adfdd5499df2dd795dd0d984842cc",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/languages-start-points:c893dbc@sha256:8e7fb4cfe9953032bde5488c656ad255e49adfdd5499df2dd795dd0d984842cc",
"most_recent_timestamp": 1787118467,
"flow": "languages-start-points-ci",
"commit_url": "https://github.com/cyber-dojo/languages-start-points/commit/c893dbc197ef1328b5b0bc5aacb923c9beaf9e7b",
"instance_count": 1
},
{
"fingerprint": "94e3568d1b87a42b836bafdf9f1a197e46f72b6a880477a19068c0d75b978e37",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/dashboard:0e7e5c9@sha256:94e3568d1b87a42b836bafdf9f1a197e46f72b6a880477a19068c0d75b978e37",
Expand Down Expand Up @@ -151,7 +151,7 @@ kosli diff snapshots aws-beta aws-prod --output=json
]
},
"snappish2": {
"snapshot_id": "aws-prod#5249",
"snapshot_id": "aws-prod#5253",
"artifacts": [
{
"fingerprint": "1342e060fb8af6c34d004e474544d1472b940250eb0084f206c3d7bf9d78e2b5",
Expand Down
6 changes: 3 additions & 3 deletions client_reference/kosli_get_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ kosli get environment aws-prod --output=json
"name": "aws-prod",
"type": "ECS",
"description": "The ECS cluster for production cyber-dojo",
"last_modified_at": 1787069338.5827048,
"last_reported_at": 1787069338.5827048,
"last_changed_at": 1787021218.5403302,
"last_modified_at": 1787150398.6166384,
"last_reported_at": 1787150398.6166384,
"last_changed_at": 1787107798.493415,
"state": true,
"include_scaling": false,
"tags": {
Expand Down
30 changes: 15 additions & 15 deletions client_reference/kosli_get_snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ kosli get snapshot aws-prod --output=json

```json
{
"index": 5249,
"index": 5253,
"is_latest": true,
"next_snapshot_timestamp": null,
"artifact_compliance_count": {
"true": 11,
"false": 0,
"null": 0
},
"timestamp": 1787021218.5403302,
"timestamp": 1787107798.493415,
"type": "ECS",
"compliant": true,
"html_url": "https://app.kosli.com/cyber-dojo/environments/aws-prod/snapshots/5249",
"html_url": "https://app.kosli.com/cyber-dojo/environments/aws-prod/snapshots/5253",
"artifacts": [
{
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/runner:85cac88@sha256:f3cdc22a599ddb789e7791389a5a58b43fd9c30d3af079aec392d5962d181096",
Expand Down Expand Up @@ -920,7 +920,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/f3cdc22a599ddb789e7791389a5a58b43fd9c30d3af079aec392d5962d181096?artifact_id=ab875660-aa6a-466c-b224-ec94bca3",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/f3cdc22a599ddb789e7791389a5a58b43fd9c30d3af079aec392d5962d181096?artifact_id=15359073-0c4f-45c4-9dc6-a91f5a0b",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact",
"deployment_diff": {
"diff_url": "https://github.com/cyber-dojo/snyk-scanning/compare/00c479764cb9eca038fdaaaef108672d0bb0ed26...10203d5d23f93844726f204390cf3d5ca8d5c913",
Expand Down Expand Up @@ -1754,7 +1754,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/ff871c3c8f4b5cfb60012bed1cd7f020b20f17fdabc2db0d8a5c77e75518fce0?artifact_id=4028a69a-8f9a-4855-9716-f1fc77c9",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/ff871c3c8f4b5cfb60012bed1cd7f020b20f17fdabc2db0d8a5c77e75518fce0?artifact_id=88a6a058-3b14-4e58-941d-cbaaff7e",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact",
"deployment_diff": null,
"commit_lead_time": -176881.0,
Expand All @@ -1775,7 +1775,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-beta-per-artifact/artifacts/ff871c3c8f4b5cfb60012bed1cd7f020b20f17fdabc2db0d8a5c77e75518fce0?artifact_id=e5d56e7c-c459-4cb4-8004-387e9ea3",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-beta-per-artifact/artifacts/ff871c3c8f4b5cfb60012bed1cd7f020b20f17fdabc2db0d8a5c77e75518fce0?artifact_id=a128c065-b310-4f1e-b927-65ee9702",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-beta-per-artifact",
"deployment_diff": null,
"commit_lead_time": -176881.0,
Expand Down Expand Up @@ -2632,7 +2632,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/6f394e0dccb59b852fa52ffa114fde8452280054c84de05b0627b1b0f18657bd?artifact_id=6edd9e01-0c2e-48b4-98a6-10da27d1",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/6f394e0dccb59b852fa52ffa114fde8452280054c84de05b0627b1b0f18657bd?artifact_id=9d213801-fb65-4435-aa44-8eec7607",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact",
"deployment_diff": {
"diff_url": "https://github.com/cyber-dojo/snyk-scanning/compare/00c479764cb9eca038fdaaaef108672d0bb0ed26...10203d5d23f93844726f204390cf3d5ca8d5c913",
Expand Down Expand Up @@ -3497,7 +3497,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/adb922d738b50876f1cd13f5a998ade341abfd64b3561d0889264399c33c528b?artifact_id=68c91d43-921c-4024-a9c2-94fb5101",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/adb922d738b50876f1cd13f5a998ade341abfd64b3561d0889264399c33c528b?artifact_id=34fe2ea0-cc82-4a41-9751-5ca5b935",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact",
"deployment_diff": {
"diff_url": "https://github.com/cyber-dojo/snyk-scanning/compare/7172cc22125f480a9f12127edb481a4d84aabea3...10203d5d23f93844726f204390cf3d5ca8d5c913",
Expand Down Expand Up @@ -4362,7 +4362,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/31a4c3abc3ccef33397ed1d84496a08d94ca9d6f9d0df44b6a72aba9743bc8ac?artifact_id=690b4ddd-ace2-4b7d-9471-12b200ec",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/31a4c3abc3ccef33397ed1d84496a08d94ca9d6f9d0df44b6a72aba9743bc8ac?artifact_id=125b24cc-3621-4637-a67a-290d5667",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact",
"deployment_diff": {
"diff_url": "https://github.com/cyber-dojo/snyk-scanning/compare/00c479764cb9eca038fdaaaef108672d0bb0ed26...10203d5d23f93844726f204390cf3d5ca8d5c913",
Expand Down Expand Up @@ -5227,7 +5227,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/2ec004d6e7c2668ff407b4384d6b4c62f92d9606ae18447c5fb326211921bc6a?artifact_id=3cf28177-22a0-448e-8041-517eb434",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/2ec004d6e7c2668ff407b4384d6b4c62f92d9606ae18447c5fb326211921bc6a?artifact_id=5a3e5426-60c8-41b5-a6a6-3ae4622a",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact",
"deployment_diff": {
"diff_url": "https://github.com/cyber-dojo/snyk-scanning/compare/00c479764cb9eca038fdaaaef108672d0bb0ed26...10203d5d23f93844726f204390cf3d5ca8d5c913",
Expand Down Expand Up @@ -6092,7 +6092,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/1342e060fb8af6c34d004e474544d1472b940250eb0084f206c3d7bf9d78e2b5?artifact_id=57054d48-c200-4d8f-b566-d51d2a3d",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/1342e060fb8af6c34d004e474544d1472b940250eb0084f206c3d7bf9d78e2b5?artifact_id=50027d44-5ef3-46fc-b026-af87c9f5",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact",
"deployment_diff": {
"diff_url": "https://github.com/cyber-dojo/snyk-scanning/compare/00c479764cb9eca038fdaaaef108672d0bb0ed26...10203d5d23f93844726f204390cf3d5ca8d5c913",
Expand Down Expand Up @@ -6957,7 +6957,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/adf2596645ae3fe9b711849a2e9aae3a65173b270963e3214b9c7ea00b03c1cb?artifact_id=8950ac80-e8f9-49b8-b910-00050d53",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/adf2596645ae3fe9b711849a2e9aae3a65173b270963e3214b9c7ea00b03c1cb?artifact_id=f7e64e04-f253-483f-bc9b-3e9545f7",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact",
"deployment_diff": {
"diff_url": "https://github.com/cyber-dojo/snyk-scanning/compare/00c479764cb9eca038fdaaaef108672d0bb0ed26...10203d5d23f93844726f204390cf3d5ca8d5c913",
Expand Down Expand Up @@ -7822,7 +7822,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/b70ff1f9493f5d4205e0e95e565b3fc4d909de237b10e490b250671d0d6895cf?artifact_id=d9ae3fe8-6c0e-43dc-92c5-167a742c",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/b70ff1f9493f5d4205e0e95e565b3fc4d909de237b10e490b250671d0d6895cf?artifact_id=efec6b2c-db0c-41cb-ad08-aad538f8",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact",
"deployment_diff": {
"diff_url": "https://github.com/cyber-dojo/snyk-scanning/compare/00c479764cb9eca038fdaaaef108672d0bb0ed26...10203d5d23f93844726f204390cf3d5ca8d5c913",
Expand Down Expand Up @@ -8687,7 +8687,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/c7b7fd69d904329f9264e111bd3dc63cf98724cce567bae719e79a171e6925ea?artifact_id=d28229df-bd00-4604-9dbd-c16495e1",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/c7b7fd69d904329f9264e111bd3dc63cf98724cce567bae719e79a171e6925ea?artifact_id=84b1346f-0ba1-4444-9026-ed25d0dc",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact",
"deployment_diff": {
"diff_url": "https://github.com/cyber-dojo/snyk-scanning/compare/00c479764cb9eca038fdaaaef108672d0bb0ed26...10203d5d23f93844726f204390cf3d5ca8d5c913",
Expand Down Expand Up @@ -9552,7 +9552,7 @@ kosli get snapshot aws-prod --output=json
"timestamp": 1786602393.0,
"url": "https://github.com/cyber-dojo/snyk-scanning/commit/10203d5d23f93844726f204390cf3d5ca8d5c913"
},
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/8e965dda26af2d2e68032c25d68e792c85e0c7bd9814862de231bc4c6e935b81?artifact_id=fd2e72e8-e9eb-449f-a9cd-11e9bc6e",
"html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact/artifacts/8e965dda26af2d2e68032c25d68e792c85e0c7bd9814862de231bc4c6e935b81?artifact_id=7e65d24a-4909-4c84-b63f-c39581db",
"flow_html_url": "https://app.kosli.com/cyber-dojo/flows/snyk-aws-prod-per-artifact",
"deployment_diff": {
"diff_url": "https://github.com/cyber-dojo/snyk-scanning/compare/00c479764cb9eca038fdaaaef108672d0bb0ed26...10203d5d23f93844726f204390cf3d5ca8d5c913",
Expand Down
Loading