Skip to content

Verify NEAR's compose_manager_attestation - #1

Open
amiller wants to merge 1 commit into
tinfoil-direct-2026-11from
near-compose-manager-2026-11
Open

amiller wants to merge 1 commit into
tinfoil-direct-2026-11from
near-compose-manager-2026-11

Conversation

@amiller

@amiller amiller commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Stacked on tinfoil-direct-2026-11 (13rac1#242 upstream, which carries 13rac1#241 and 13rac1#239).

The compose that a NEAR model CVM's MRConfigID binds runs compose-manager, its launcher, certbot and an OpenTelemetry collector. compose-manager starts the inference proxy (model key, E2EE) and vLLM after boot from nearai/cvm-compose-files, so neither is in RTMR3 or MRConfigID. Their only record is compose_manager_attestation: compose-manager's action log and a second TDX quote from the same TD with REPORTDATA = sha256(canonical actions) || client nonce. teep passed it on as an unknown field (response_schema).

New enforced factors, neardirect and nearcloud, N/A elsewhere:

  • compose_manager_quote: chain, signature, debug off; MRTD, MRSEAM, MRCONFIGID, MROWNER, MROWNERCONFIG and RTMR0-3 equal to the instance quote (RTMR3 separates instances); REPORTDATA recomputed from the served actions and teep's nonce.
  • compose_manager_tcb: Intel PCS collateral, TCB UpToDate (online factor).
  • compose_manager_actions: every file_sha256 of a compose_up/compose_stage in the bound log is in compose_manager_compose_allow; every compose_manager_started image is in compose_manager_image_allow. Unknown actions, no compose_manager_started, or an empty allowlist fail. The failure detail lists the values to pin.

New policy keys compose_manager_compose_allow (32-byte hex) and compose_manager_image_allow (repo@sha256:<hex>), no defaults, kept by --update-config.

Tests: unit tests on both instances of a 2026-11-21 cloud-api.near.ai response (tampered log, dropped action, wrong nonce, the other instance's attestation, missing allowlist entries, unknown actions, strict decode); the Nov 13 neardirect and nearcloud fixtures now pass all three factors with pins read from their logs. go test ./..., go vet ./... and teeplint pass.

Live, 2026-11-21 ~06:00 UTC, attestation only (no API key, so e2ee_usable fails): nearcloud deepseek-ai/DeepSeek-V4.1-Flash-1017, both instances, and neardirect, pass all three factors with 22 compose hashes and 3 compose-manager images pinned.

Limits:

  • Any container in the TD with dstack.sock can get a quote over arbitrary REPORTDATA. The deployed DeepSeek file gives it to the privileged vllm-proxy-rs services. So the quote shows that code in the TD asserted this log, and the log is only as good as everything that has had that socket, including whatever a non-allowlisted file would have started.
  • compose-manager prunes entries older than seven days unless they anchor a deployed record.
  • teep does not fetch the pinned compose files or check the images they name.
  • The launcher's latest channel can swap compose-manager; the image allowlist has to accept it.
  • Pins are point-in-time: a redeploy or compose-manager restart fails the factor until re-pinned.
  • The fixtures' report.txt files predate the factors, so reverify prints a MISMATCH diff for them.

The compose that a NEAR model CVM's MRConfigID binds runs compose-manager,
its launcher, certbot and an OpenTelemetry collector. compose-manager starts
the inference proxy, which holds the model key and decrypts E2EE, and the
model server after boot, from files of nearai/cvm-compose-files. Neither is
in RTMR3 or MRConfigID. Their only record is compose_manager_attestation:
compose-manager's action log and a second TDX quote from the same TD whose
REPORTDATA is sha256(canonical actions) || client nonce. teep passed the
member on as an unknown field, so response_schema failed and nothing was
enforced about the software that sees the prompt.

Three enforced factors verify it for neardirect and nearcloud:

- compose_manager_quote: Intel chain, signature and debug bit of the
  quote; MRTD, MRSEAM, MRCONFIGID, MROWNER, MROWNERCONFIG and RTMR0-3 equal
  to the instance quote, so another instance's quote fails on RTMR3; and
  REPORTDATA recomputed from the served actions (keys sorted, compact, no
  HTML escaping) and teep's nonce.
- compose_manager_tcb: Intel PCS collateral, TCB UpToDate. Listed in
  OnlineFactors.
- compose_manager_actions: every file_sha256 of a compose_up or
  compose_stage in the bound log must be in compose_manager_compose_allow,
  and every compose_manager_started image in compose_manager_image_allow.
  compose_down, docker_restart, docker_clean and docker_evict start
  nothing; any other action, a log with no compose_manager_started, and an
  empty allowlist fail.

The rule covers every deployment the log reports, not only the running one:
whatever compose-manager started in the TD had its Docker socket. The new
policy keys have no defaults and survive --update-config. The factors are
not applicable to other formats; Venice serves the member too but is not
covered.

The decode is strict (unknown or duplicate members, null services and more
than 10,000 actions fail the factors, not the report), and moves from the
neardirect parser to attestation.VerifyComposeManager, which both teep
verify and teep serve call. Unit tests use both instances of a 2026-11-21
cloud-api.near.ai response, with a tampered log, a dropped action, a wrong
nonce, the other instance's attestation, and missing allowlist entries. The
captured neardirect and nearcloud fixtures now pass all three factors with
pins read from their logs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant