15 Recipe: attack the platform, then verify
| Field | Value |
|---|---|
| Tools | the kailash-integration-mlflow-attack probe pair (A-7 pairing instrument) ↔︎ mlflow (O-1 lab target) — the aspirational attack-tool name rides the os#210 registry |
| Section | Attack–defence pairs |
| Level | hard |
| Time | ~45 min (lab boot + probe pair + posture flip) |
| Layer/Category | ATTACK / A-7 + OPS / O-1 |
| Tags | pair, platform, mlflow, exp, owasp-llm02, owasp-llm10 |
15.1 Problem
The pairing thesis is Kailash’s core idea: deployment + attack in one declared environment. An MLflow tracking server ships the lab-default posture (services.kailash.mlflow on :5000, labReachable, no auth by declared design). The posture exposes experiment metadata, run data and model artefacts to anyone who reaches the port. The manifest maps this to OWASP LLM02 (sensitive information disclosure) and LLM10 (unrestricted consumption). The manifest also maps it to ATLAS AML.T0049/T0050. The task: demonstrate the exposure against the declared lab target. Then prove the hardened posture closes it. Both legs stay reproducible. A standing CI test asserts the pairing, independent of the lab session.
15.2 Solution
Kailash ships the lab target as a real manifest row (the O-1 service module). The attack instrument is the kailash-integration-mlflow-attack probe pair (tools/vm-integration-mlflow-attack.sh in the OS repo — verbatim MLflow API shapes). The shapes were live-probed on mlflow 3.x at the packages pin. The pair drives against the platform profile (the posture tests/integration-mlflow-attack.nix boots):
# 1. Boot the lab target in the documented acceptance posture
# (the shape from tests/integration-mlflow-attack.nix):
# services.ollama.host = "0.0.0.0";
# services.ollama.loadModels = [ "qwen2.5:0.5b" ];
# services.kailash.mlflow.labReachable = true;
# kailash.layers.attack.categories.a-07.enable = true;
# (a qemu user-net VM is an isolated lab segment; see
# [Boot a verified release image](../getting-started/first-image.html)
# for the target's build ref)
# 2. In-guest run (the instrument, inside the booted VM):
kailash-integration-mlflow-attack --seed
# ...or from the host against the qemu hostfwd ports:
kailash-integration-mlflow-attack \
--mlflow-url http://127.0.0.1:5101 \
--artifacts-url http://127.0.0.1:5102 --seedWhat the probe pair does: each stage’s verdict prints ATTEMPTED/ok/FAIL. Every stage’s raw response is echoed — never a fabricated PASS:
# stage 1 — TRACKING: the O-1 surface is UNAUTHENTICATED:
curl -fsS -X POST http://127.0.0.1:5000/api/2.0/mlflow/experiments/search \
-H 'Content-Type: application/json' -d '{"max_results":50}'
# -> 200 JSON with the experiments list, NO credentials presented
# stage 2 — BYPASS, seeded (the full unauthenticated write→read round trip):
curl -fsS -X POST http://127.0.0.1:5000/api/2.0/mlflow/runs/create \
-H 'Content-Type: application/json' \
-d '{"experiment_id": "0", "run_name": "MLFLOW_BYPASS_LIST"}'
# -> .run.info.run_id parsed from the response
curl -fsS -X PUT 'http://127.0.0.1:5000/api/2.0/mlflow-artifacts/artifacts/put?path=0%2F<run-id>%2Fartifacts%2Fka23-listing.txt' \
-F 'file=@<marker-file>'
# -> the marker artefact lands through the SAME unauthenticated store
curl -fsS 'http://127.0.0.1:5000/ajax-api/2.0/mlflow/artifacts/list?run_id=<run-id>&path='
# -> the artefact listing answers; write→read round trip provenThen the verification leg: flip the posture with a configuration change. Re-run the same probes:
# 3. Harden the lab target in the system configuration:
# services.kailash.mlflow.labReachable = false; # loopback-only
# + the module's auth posture options at the current release
# (read the module per release — never invented here), then:
sudo nixos-rebuild test
# 4. Re-run the same probe pair, same box:
kailash-integration-mlflow-attack --seed
# -> both probes FAIL: the auth gate is up; the surface is closedExpected output shape (abridged):
== KA-23 integration-mlflow-attack acceptance pair ==
tracking : http://127.0.0.1:5000
artifacts: http://127.0.0.1:5000 (seed: 1)
--- boot-wait: polling http://127.0.0.1:5000/health (window: 300s)
boot-wait: REACHABLE — /health: <body>
--- track: POST /api/2.0/mlflow/experiments/search (UNAUTH)
{"experiments": [...]}
track: ok — experiments/search answered unauthenticated (ML_METHOD_FLAG surface UP)
--- bypass(seed): POST /api/2.0/mlflow/runs/create (UNAUTH)
<create response with run_id>
--- bypass(seed): PUT /api/2.0/mlflow-artifacts/artifacts/put (UNAUTH multipart)
--- bypass: GET /ajax-api/2.0/mlflow/artifacts/list (UNAUTH)
{"files": [...]}
bypass: ok — the artefact listing answered unauthenticated
kailash-integration-mlflow-attack: BOTH probes ok (track + bypass listing)
15.3 Discussion
- Why the probe pair and not a bespoke exploit script: the paired attack manifest row was a PHANTOM. Its claimed kailash-os upstream repository was never created. The os#210 audit (2026-10-14) REMOVED it from the manifest entirely (kailash-os#210; the name rides the registry there). The probe pair runs the REAL protocol against the REAL target. The protocol: the two verbatim MLflow API recipes (unauthenticated tracking search + the
ajax-apiartefact listing with the--seedwrite→read round trip). So the acceptance is an executable, honest pairing NOW, with no invented tool anywhere. If a real A-7 tool ships later, it enters via the os#210 rebuild contract (built upstream first, manifest gate second). It then takes over. - The verdict discipline carries the evidence: every probe prints ATTEMPTED/ok/FAIL (never “PASS”) and echoes its verbatim output. With
--record, the verbatims land in a machine-validated JSON record (tests/vm-acceptance-mlflow-record.json). Its verifier leg fails CI on a hand-typed ok with nothing behind it. It applies the same no-invented-evidence rule this book runs on. - Why the posture flip is the verification: the lab posture (
labReachable = true) and the hardened posture are declared options on the SAME module. The hardened posture carries the loopback/auth options at the current pin. A diff of the two probe runs IS the evidence that a configuration change moved the surface — not folklore. The previous generation stays one reboot away (see Ride a release without breaking pinned tooling). - CI runs this pairing whether or not the lab does: hosted CI evals
integration-mlflow-attack.nix(never boots it — the no-VMs posture). The maintainer’s ONE interactive boot is recorded in the machine-validated record. A--recordrun should match that record. The lab session reproduces the CI assertion hands-on. - The exp gate still owns any future A-7 tool: a rebuilt A-7 tool re-enters via the os#210 rebuild contract. It installs only via the double-key lab gate (full walk: Gate lab-mode and exp-classified tools). The probe pair needs no gate — it drives curl/jq/python3 from the base system.
- Beyond MLflow: the A-7 platform-exploit pairing is aspirational-only right now (every pre-purge A-7 row was phantom-upstream and removed — names in the os#210 registry). The transferable pattern stays: lab target up → probes run → posture flip → same-seed re-run → diff as the evidence.
15.4 See also
- Serve a local model for scanning — the model-surface analog (O-4 target for A-2 scanners)
- Gate lab-mode and exp-classified tools — the exp gate walk
- The landed probe pair source (verbatim API recipes): https://github.com/kailash-os/kailash-os/blob/master/tools/vm-integration-mlflow-attack.sh
- The integration test that asserts the pairing: https://github.com/kailash-os/kailash-os/blob/master/tests/integration-mlflow-attack.nix
- The phantom-row provenance + registry: kailash-os#210
- Recipe directory
ref: mlflow 3.x pin + OS master test sources - verified 2026-10-14. the pre-purge paired attack row was phantom-upstream (removed 2026-10-14): kailash-os#210.