Skip to content
Compliance engineering: CRA and AI Act on Kubernetes · Chapter 18 of 20 Appendix A: Cheat sheet

Appendix A: Cheat sheet

What this appendix is for: looking things up when you know what you want to do but have forgotten the syntax. It explains nothing new. The days in the right-hand column lead to the chapters in which each command appears with all its options and a real output. All commands run on werk1.

You replace placeholders in angle brackets with your values. In the lab:

  • <image> is werk1:5000/bewerbungslotse, <version> for example 1.1.2.
  • <digest> is the digest of an image, that is sha256: and 64 hexadecimal characters. You find it in the file that podman push --digestfile wrote (~/kurs/<day>/digest-<version>).
  • <ns> is lotse, for the reproduced customer nord.
  • <clusterip> is the ClusterIP of the Service lotse, in the lab 10.43.146.193.
  • The private signing key is in $HOME/geheim/beispielwerk.key, the public one in ~/lotse/beispielwerk.pub, the admin password in $HOME/geheim/admin-passwort.

Which obligation, which file in the repository

The table follows doku/README.md, the table of contents of the technical documentation (state on Day 16). All paths are relative to ~/lotse.

Obligation Reference File Day
Intended purpose, versions, support period Annex VII, points 1(a), 1(b) and 4 CRA; Article 13(8) CRA PRODUKT.md, chart/Chart.yaml 1, 9
Parts list Annex I, Part II, point 1 CRA; Annex VII, point 8 CRA sbom/bewerbungslotse-<version>.cdx.json, ….spdx.json 2, 6
Assess and remediate vulnerabilities Annex I, Part I, point 2(a), Part II, points 2 and 3 CRA SCHWACHSTELLEN.md, scans/ 3, 6, 14
Prove “not affected”, share information Annex I, Part II, point 6 CRA vex/bewerbungslotse-<version>.openvex.json 4, 14, 16
Secure default settings Annex I, Part I, point 2(b) CRA chart/values.yaml, chart/templates/ 5
Secure distribution of updates Annex I, Part II, point 7 CRA beispielwerk.pub (the signatures are attached to the image) 6
Coordinated disclosure, contact address Annex I, Part II, points 5 and 6 CRA; Article 13(17) CRA SECURITY.md, security.txt 7
Information about fixed vulnerabilities Annex I, Part II, point 4 CRA csaf/bw-sa-2026-001.json, csaf/bw-sa-2026-002.json 7, 8, 16
Table of contents of the technical documentation Annex VII CRA; Annex IV AI Act doku/README.md 9, 14, 16
Architecture, production and monitoring Annex VII, points 2(a) and 2(c) CRA doku/aufbau.md 9
Cybersecurity risk assessment Article 13(3) CRA; Annex VII, point 3 CRA doku/risikobewertung.md 9, 11, 12
Test reports Annex VII, point 6 CRA doku/pruefberichte/1.0.2/ with SHA256SUMS; for 1.1.2 scans/grype-vex-1.1.2.json 9, 16
Information for users Annex II CRA chart/README.md, chart/templates/NOTES.txt 9
EU declaration of conformity (one for the CRA and the AI Act) Article 28 CRA; Article 47(3) AI Act doku/eu-konformitaetserklaerung-1.1.2.md (ENTWURF, draft) 9, 16
Type plate as an attestation (an idea of the course, not an obligation) – doku/typschild-1.0.2.json 9
AI classification, roles, deadlines Article 6(2) and Annex III, point 4(a) AI Act doku/ki-einstufung.md 10
Automatic logs, retention Article 12, Article 19(1), Article 26(6) AI Act values lotse.protokoll.* in chart/values.yaml, chart/templates/protokoll-aufraeumen.yaml 11
Test set and test bench Article 10(6), Article 15 AI Act pruefung/pruefmenge.jsonl, pruefung/paare-g3.jsonl, pruefung/pruefstand.py, pruefung/ergebnisse/ 13, 14, 16
AI test report Annex IV, points 2(g) and 3 AI Act doku/ki-pruefbericht.md 13, 14, 16
Instructions for use Article 13 AI Act doku/betriebsanleitung.md 14
Post-market monitoring Article 72 AI Act; Annex IV, point 9 doku/marktbeobachtung.md 14
Risk management system Article 9 AI Act; Annex IV, point 5 doku/risikomanagement-ki.md 16
Changes over the life cycle Annex IV, point 6 AI Act git log, tags v1.0.0 to v1.1.2 1–16

Not in the repository: notification files under Article 14 CRA and Article 73 AI Act are kept in ~/meldungen/ (mode 700), archives for the authority in ~/archiv/ (mode 700). They contain evidence of an incident and do not belong in a repository that you pass on to customers (Day 7, 8, 9, 15).

Parts list with Syft

Command Purpose Day
syft version check the version 2
~/.syft.yaml with registry: and insecure-use-http: true (for Grype ~/.grype.yaml) allow the registry over HTTP, in the lab only 2, 4
syft scan registry:<image>:<version> parts list as a table, directly from the registry 2
syft scan registry:<image>@<digest> --source-name bewerbungslotse --source-version <version> -o cyclonedx-json=$HOME/lotse/sbom/bewerbungslotse-<version>.cdx.json -o spdx-json=$HOME/lotse/sbom/bewerbungslotse-<version>.spdx.json parts list in two formats, with product name and version 2, 6, 12, 14, 16
syft scan dir:$HOME/lotse --exclude ./sbom only the order form (requirements.txt), not the image – see B4 2
trivy image --image-src remote --insecure --format cyclonedx --output <file> <image>:<version> cross-check with Trivy 2
jq '.components \| length' <file> count the entries of a CycloneDX file 2
jq '.components \| group_by(.type) \| map({typ: .[0].type, anzahl: length})' <file> entries by type 2
jq '.components[] \| select(.name == "<package>") \| {name, version, purl}' <file> look up one part 2
podman image inspect <image>:<version> --format "{{range .RootFS.Layers}}{{println .}}{{end}}" layers of an image 2
podman history <image>:<version> --format "{{.ID}} {{.Size}} {{.CreatedBy}}" which line created which layer 2

Vulnerabilities with Grype and Trivy

Command Purpose Day
grype db update / grype db status load the database, show its state 3
grype sbom:<parts-list> scan a parts list, table 3
grype sbom:<parts-list> -o json --file <target> result as a JSON file 3
grype registry:<image>@<digest> -o json --file <target> scan an image (needed for VEX) 4, 6, 12
jq -r '.descriptor.db.status.built' <grype.json> state of the Grype database in the report 9
jq '.matches \| group_by(.artifact.type) \| map({typ: .[0].artifact.type, anzahl: length})' <grype.json> findings by package type 6
jq '[.matches[] \| select(.artifact.type == "python")] \| group_by(.artifact.name) \| map({paket: .[0].artifact.name, ist: .[0].artifact.version, mindestens: (map(.vulnerability.fix.versions[0]) \| max_by(split(".") \| map(tonumber)))})' <grype.json> minimum version per Python package, versions compared as numbers – see B6 3
trivy sbom --format json --output <target> <parts-list> scan a parts list with Trivy (third-party parts list: see B5) 3
trivy image --image-src remote --insecure --no-progress --format json --output <target> <image>:<version> scan an image with Trivy 3
trivy config --quiet --helm-set lotse.adminPasswort=nurfuerdenscan --format json --output <file> . configuration scan including the chart; without --helm-set the chart is missing – see B9 5, 9
jq -r '.Results[] \| [.Target, .MisconfSummary.Failures] \| @tsv' <file> which files were checked, findings per file 5
curl -sSL -o kev.json https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json download the KEV catalog 3
jq -n --slurpfile kev kev.json --slurpfile scan <grype.json> '…' match the scan against the KEV catalog 3
curl -sS -o epss.json "https://api.first.org/data/v1/epss?cve=<CVE>,<CVE>" query EPSS scores 3

VEX with vexctl

Command Purpose Day
vexctl version check the version 4
vexctl list justification permitted justifications for not_affected 4
vexctl create --product="pkg:oci/bewerbungslotse@<digest>?repository_url=werk1:5000/bewerbungslotse" --subcomponents="<purl>" --vuln="<GHSA-…>" --status="not_affected" --justification="<justification>" --impact-statement="<text>" --author="<who>" --file=<file> create a statement 4
grype registry:<image>@<digest> --vex <vex> -o json --file <target> scan an image with VEX 4, 9, 14, 16
jq '(.matches \| length), (.ignoredMatches \| length)' <result> visible and hidden findings 4, 6
jq -r '.statements[0].products[0]["@id"]' <vex> which digest the VEX speaks for – see B28 16
trivy image --image-src remote --insecure --no-progress --quiet --scanners vuln --vex <vex> --show-suppressed --format json --output <target> <image>:<version> cross-check with Trivy 4

Three rules from the course: The part (--subcomponents) is the binary package from the scan result, not the source package (B7). For Python vulnerabilities, put the GHSA as name and the CVE as aliases; then Grype and Trivy both understand the statement (Day 4). A new image means a new VEX with the new digest in every statement (B28).

Signature and attestation with Cosign

All commands use --allow-http-registry because the lab registry doesn’t speak TLS. Without Rekor and a timestamp service you need --insecure-ignore-tlog when verifying; Cosign then warns every time (Day 6).

Command Purpose Day
cosign version check the version 6
cosign generate-key-pair --output-key-prefix beispielwerk generate a key pair 6
cosign signing-config create --out ~/lotse/signing-config.json signing configuration without public services 6
podman push --digestfile ~/kurs/<day>/digest-<version> <image>:<version> push and record the digest 6, 7, 11
cosign sign --key $HOME/geheim/beispielwerk.key --signing-config $HOME/lotse/signing-config.json --allow-http-registry --yes <image>@<digest> sign an image by digest 6, 7, 12, 14, 16
cosign verify --key ~/lotse/beispielwerk.pub --insecure-ignore-tlog --allow-http-registry <image>@<digest> verify a signature (JSON); readable with -o text 6, 7, 12, 14, 16
cosign attest --key $HOME/geheim/beispielwerk.key --signing-config $HOME/lotse/signing-config.json --allow-http-registry --yes --type cyclonedx --predicate $HOME/lotse/sbom/bewerbungslotse-<version>.cdx.json <image>@<digest> attach the parts list 6, 7, 12, 14, 16
cosign attest … --type openvex --predicate $HOME/lotse/vex/bewerbungslotse-<version>.openvex.json <image>@<digest> attach the VEX 6, 7, 14, 16
cosign attest … --type https://beispielwerk.example/typschild/v1 --predicate $HOME/lotse/doku/typschild-1.0.2.json <image>@<digest> attach your own type plate 9
cosign verify-attestation --key ~/lotse/beispielwerk.pub --insecure-ignore-tlog --allow-http-registry --type <type> <image>@<digest> > <file> verify and save an attestation 6, 9
jq -r '.payload \| @base64d \| fromjson \| .predicate.metadata.component.name + " " + .predicate.metadata.component.version' <file> read the content of a parts-list attestation 6
cosign tree --allow-http-registry <image>@<digest> signature and attachments of an image 6, 7, 12, 14, 16

Reading error messages: no signatures found means “not this image”, not “forged” (B12). no matching attestations means: no attestation of this type is attached to the image (B13).

The Bewerbungslotse with Helm and kubectl

Command Purpose Day
helm lint ~/lotse/chart --set lotse.adminPasswort=x check the chart; since 1.0.1-rc1 it does not render without a password 5, 9
helm upgrade lotse ~/lotse/chart -n lotse --set-file lotse.adminPasswort=$HOME/geheim/admin-passwort --wait --timeout 5m roll out the chart state, password from a file 5–16
helm upgrade … --set lotse.image=<image>:<rc> test a pre-release without changing the chart – see B18 10
helm upgrade … --set lotse.protokoll.zugriffe=false switch off the access log (opt-out) 11
helm upgrade … --reset-values reset to the chart’s factory settings 5
helm upgrade … --set lotse.service.typ=NodePort --dry-run=client --hide-secret view the NOTES without changing anything – see B17 9
helm upgrade lotse ~/lotse/chart -n lotse --force-conflicts resolve a field conflict with kubectl set – see B3 1
helm install lotse ~/nord/chart --namespace nord --create-namespace --set-file lotse.adminPasswort=$HOME/geheim/admin-passwort --set lotse.service.typ=NodePort --set lotse.service.nodePort=30081 --wait --timeout 10m reproduce the customer’s state 8, 15
helm rollback lotse <revision> -n lotse --wait --timeout 5m go back to an earlier revision 6
helm list -n lotse / helm history lotse -n lotse --max 4 revisions; APP VERSION is only appVersion from the chart 1, 10
helm get values lotse -n lotse --all all computed values 1
helm template lotse ~/lotse/chart --set lotse.adminPasswort=x --show-only templates/<file> view one manifest (not NOTES.txt) 9, 11
helm show readme ~/lotse/chart read the user information 9
kubectl -n lotse get deploy lotse -o jsonpath="{.spec.template.spec.containers[0].image}{\"\n\"}" which image is really running 10
curl -s http://<clusterip>:8080/gesund version and AI state from the service itself 10, 12
kubectl -n lotse rollout restart deploy/lotse / kubectl -n lotse rollout status deploy/lotse --timeout=120s restart the pod (empties /tmp and the logs – B20, B23) 11, 13
kubectl -n lotse scale deploy/lotse --replicas=0 terminate all pods – not a safe state 12
curl -s -u admin -X POST -H "Content-Type: application/json" --data @kurs/12/stopp.json http://<clusterip>:8080/api/admin/stopp pull the stop button (weiter.json releases it) 12
curl -s -u admin -X POST -H "Content-Type: application/json" --data @<inspection-card> http://<clusterip>:8080/api/bewerbungen/<number>/entscheidung decide as a human 12, 15
curl -s -u admin -o <file> http://<clusterip>:8080/api/admin/export export all application files 10
kubectl -n lotse exec deploy/ollama -- ollama show qwen3:4b-instruct size, quantisation, licence of the model 1, 10
kubectl -n lotse exec deploy/ollama -- ollama ps is the model loaded? (cold start, B2) 0
kubectl -n lotse port-forward deploy/ollama 11434:11434 tunnel to the model, local only 10
kubectl -n lotse create job --from=cronjob/lotse-protokoll-aufraeumen <run> run the deletion job once right away 11

Security advisory (CSAF)

Command Purpose Day
csaf_validator --version check the version 7
csaf_validator ~/lotse/csaf/bw-sa-2026-001.json then echo $? check the advisory against the schema, read the exit code 7, 8, 16
jq ".document.tracking.version, .document.tracking.revision_history[-1].number" <csaf> compare the version and the last revision – see B15 8

Reading the exit code of csaf_validator: It is made up of bits. In the lab, 4 only means “no remote validator specified” and is normal for a valid document. 6 = 2 + 4: the schema is violated, and the document must not be published (B14). The file name must be the tracking.id in lower case with .json.

Event log with jq

The log is in the pod at /daten/protokoll/ereignisse-<YYYY-MM>.jsonl, one JSON line per event. Fields: zeit, ereignis, system, plus, depending on the type, akte, modell, dauer_ms, passung, abweichung, stopp, anzahl. Always calculate values from the file, never from kubectl logs (B20, B25).

Command Purpose Day
kubectl -n lotse exec deploy/lotse -- cat /daten/protokoll/ereignisse-2026-12.jsonl > <copy> fetch the file from the pod 11, 12, 14, 16
jq -c 'select(.akte == "<number>")' <copy> all events for one application file (information request under Article 86) 11
jq -s 'map(select(.ereignis == "export_abgelehnt")) \| length' <copy> count events of one type 11
jq -c 'select(.ereignis \| startswith("export")) \| {zeit, ereignis}' <copy> exports with time 11
jq -s 'group_by(.ereignis) \| map({ereignis: .[0].ereignis, anzahl: length})' -c <copy> events by type 14
jq -s 'map(select(.ereignis == "entscheidung")) \| {entscheidungen: length, abweichend: (map(select(.abweichung)) \| length)}' <copy> deviation rate (automation bias) 12, 14
jq -s 'map(select(.ereignis == "bewertung")) \| {bewertungen: length, langsamste_ms: (map(.dauer_ms) \| max)}' <copy> number and longest duration of the ratings 14
jq -c 'select(.ereignis == "bewertung" and .passung >= 4) \| {zeit, system, akte}' <copy> high scores, candidates for manipulation 14
jq -c 'select(.ereignis == "export") \| {zeit, ereignis, anzahl}' <copy> prove the deployer’s awareness 15
jq -c 'select(.system == "Bewerbungslotse 1.1.1" and .ereignis == "bewertung") \| {zeit, akte, passung}' <copy> ratings of one version 16
jq -R -c 'fromjson? \| select(.ereignis != null) \| .ereignis' <log> only the JSON lines from a mixed log 14

Checking texts for disguised characters (Day 16): jq -r .text <file> shows the text as a human sees it, jq -c '.text | explode | map(select(. > 127))' <file> the code points outside ASCII, printf '%x\n' <number> a code point as a hexadecimal number.

Test bench

Command Purpose Day
kubectl -n lotse get pod -l app=lotse name of the current pod 13
kubectl -n lotse cp ~/lotse/pruefung <pod>:/tmp/pruefung copy the test bench into the pod – again after every pod change (B23) 13, 14, 16
kubectl -n lotse exec deploy/lotse -- python /tmp/pruefung/pruefstand.py /tmp/pruefung/pruefmenge.jsonl > <result> have the test set rated 13, 14, 16
kubectl -n lotse exec deploy/lotse -- python /tmp/pruefung/pruefstand.py /tmp/pruefung/paare-g3.jsonl > <result> group pairs without the ceiling effect 13, 14
jq -s 'map(select(.gruppe == "basis")) \| map(if .erwartet == "geeignet" then .passung >= 4 else .passung <= 2 end) \| {faelle: length, treffer: (map(select(.)) \| length)}' <result> hit rate 13
jq -c 'select(.gruppe == "paar") \| {fall, passung}' <result> pairs side by side 13
jq -c 'select(.gruppe == "angriff") \| {fall, passung, verdacht}' <result> attacks and suspicion 14
jq -n --slurpfile alt <a> --slurpfile neu <b> '…' regression comparison of two runs 13, 14

In the course, a hit means: suitable with a fit ≥ 4, unsuitable with a fit ≤ 2 (Day 13).

Deadlines with date

werk1 runs in UTC. Calculate deadlines in UTC and write UTC before the plus sign (B27).

Command Purpose Day
date -u +%FT%TZ record the point of awareness 8, 15
date -u -d "<YYYY-MM-DD> <hh:mm:ss> UTC + 24 hours" +%FT%TZ early warning notification under Article 14(2)(a) CRA 8, 15
date -u -d "<YYYY-MM-DD> <hh:mm:ss> UTC + 72 hours" +%FT%TZ vulnerability notification under Article 14(2)(b) CRA 8, 15
git -C ~/lotse log -1 --format=%cI <tag> point in time from which the correction was available 15
date -u -d "<YYYY-MM-DD> <hh:mm:ss> UTC + 14 days" +%FT%TZ final report under Article 14(2)(c) CRA 15
date -u -d "<YYYY-MM-DD> <hh:mm:ss> UTC + 15 days" +%FT%TZ report under Article 73(2) AI Act 15
date -u -d "<YYYY-MM-DD> <hh:mm:ss> UTC + 2 days" +%FT%TZ widespread infringement, Article 73(3) AI Act 15
date -u -d "<YYYY-MM-DD> <hh:mm:ss> +0100 15 days" +%FT%TZ calculate a deadline from German winter time 15
TZ=Europe/Berlin date -d "<YYYY-MM-DD> <hh:mm:ss> UTC" show a deadline in local time 15
date -d "<YYYY-MM-DD> + 10 years" +%F retention of the technical documentation (Article 13(13) CRA) 9
date -u -d "<YYYY-MM-DD> - 210 days" +%F cut-off date for deleting old logs 11

Securing evidence

Command Purpose Day
mkdir -m 700 ~/meldungen/<case> notification file only for you 7, 8, 15
kubectl -n <ns> exec deploy/lotse -- cat /daten/<number>.json > ~/meldungen/<case>/<file> secure an application file from the pod 15
kubectl -n <ns> exec deploy/lotse -- cat /daten/protokoll/ereignisse-2026-12.jsonl > ~/meldungen/<case>/<file> secure the event log 15
kubectl -n <ns> cp <pod>:/daten/<number>.json <target> copy a file from the pod 8
kubectl -n <ns> exec deploy/lotse -- ls -l --time-style=full-iso /daten /daten/anlagen timestamps with seconds 8
kubectl -n <ns> exec deploy/lotse -- tail -c 3 <file> the last bytes (the forgery ended with a line break) 8
kubectl -n <ns> logs deploy/lotse --since 5m access log of the last few minutes 8
kubectl -n <ns> set env deploy/lotse GUNICORN_CMD_ARGS='--access-logfile -' switch on the access log (in the chart from 1.1.0-rc2) 8
sha256sum <files> > SHA256SUMS checksums as a seal 8, 9, 15
sha256sum -c SHA256SUMS check the seal 9, 15
git -C ~/lotse archive --format=tar.gz --prefix=<folder>/ -o <file> <tag> <paths> reproducible archive for the authority 9

The source address in the access log is the last hop before the pod, not necessarily the attacker (B16).

Notifications

The course sends nothing to real authorities or platforms. Every notification is created as a file in ~/meldungen/.

File What Reference Day
BW-2026-001.md notification file of the researcher’s report “kiesel” Annex I, Part II, point 5 CRA 7
art14-2026-001/01-fruehwarnung.md early warning notification, actively exploited vulnerability Article 14(2)(a) CRA 8
art14-2026-001/02-schwachstellenmeldung.md vulnerability notification Article 14(2)(b) CRA 8
art14-2026-001/03-abschlussbericht.md final report Article 14(2)(c) CRA 8
2026-002/00-bewertung.md assessment: vulnerability? incident? which deadlines? Article 3, point 42 CRA; Article 3, point 49 AI Act 15
2026-002/01-cra-fruehwarnung.md early warning notification under the CRA Article 14(2)(a) CRA 15
2026-002/02-ai-act-erstbericht.md initial report, may be incomplete Article 73(2) and (5) AI Act 15
2026-002/03-cra-abschlussbericht.md final report under the CRA Article 14(2)(c) CRA 16
BW-2026-004.md notification file of the second researcher’s report Annex I, Part II, point 5 CRA 16

In addition, every incident file contains the secured evidence (application file, event log, log) and its SHA256SUMS.

Contents

More