Skip to content

feat: load SEV-SNP TCB requirements from a JSON file in the verifier and the KMS - #1628

Merged
kvinwang merged 3 commits into
nextfrom
feat/verifier-snp-tcb-json
Nov 20, 2026
Merged

kvinwang merged 3 commits into
nextfrom
feat/verifier-snp-tcb-json

Conversation

@kvinwang

@kvinwang kvinwang commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Since #1627 the KMS reads the minimum TCB of each SEV-SNP CPU from its auth API as one JSON list. dstack-verifier judges against the same minimums but takes them as [[attestation.sev_snp_tcb_requirements]] tables in its TOML config, so the list has to be rewritten by hand in a second format, and a container deployment needs a config file mounted for it. The KMS ignores those tables once an auth API is configured, so an operator cannot cover a CPU governance has not listed yet.

Fix

sev_snp_tcb_requirements_file in the attestation config names a JSON file holding the list exactly as governance publishes it. It is read at startup, and a file that does not parse stops the process. The TOML tables are gone; no release has shipped them.

  • dstack-verifier ([attestation]): judges against the file. Without one, or for a CPU it does not list, the SEV-SNP tcb_status stays empty, as before.
  • KMS ([core.attestation]): the published list takes precedence. The file decides only for a CPU the published list has no entry for, and cannot raise or lower a published minimum. An empty published list is no longer an error by itself; the KMS still refuses a request when the auth API does not answer, and when neither list has an entry for the report's CPU.

Governance does not see the file, so a KMS that carries one vouches by itself for the CPUs governance leaves out, its own included, and for another stepping of a CPU governance lists. On next those were refused. The docs say to write the file in the KMS's compose file, like kms.toml, so that it is part of the measurement governance allows.

A compose file can carry the list inline:

services:
  dstack-verifier:
    image: ghcr.io/dstack-tee/dstack-verifier:latest
    environment:
      DSTACK_VERIFIER_ATTESTATION__SEV_SNP_TCB_REQUIREMENTS_FILE: /sev-snp-tcb-requirements.json
    configs:
      - sev-snp-tcb-requirements.json

configs:
  sev-snp-tcb-requirements.json:
    content: |
      [{"cpuid": "00a00f11", "bootloader": 0, "tee": 0, "snp": 27, "microcode": 222}]

Verification

  • cargo check --workspace --all-targets --all-features passes, and cargo test -p dstack-attest -p dstack-verifier -p dstack-kms -p sev-snp-qvl -p dstack-auth --all-features passes.
  • sev_snp_tcb_requirements_are_read_and_checked_during_load covers a missing file, a valid list, an empty list and each rejected entry.
  • sev_snp_tcb_is_judged_against_governances_requirements covers the precedence: the KMS's own verdict stands when governance lists nothing or only another CPU, and gives way, in both directions, when governance lists the CPU. The auth API failing still fails the request whatever the KMS lists.
  • dstack-verifier --verify on the real Milan fixture (verifier/fixtures/sev-snp-attestation.json), with the file set through the environment variable: UpToDate under a met minimum, OutOfDate under an unmet one, no tcb_status with only Milan-X's entry or no file, and exit 1 at startup for a malformed or missing file.
  • The commented key in kms.toml and dstack-verifier.toml parses under [core.attestation] and [attestation] when uncommented in place, and the verifier judges the fixture from a config file that sets it.
  • forge clean && forge test --ffi: 118 passed (a NatSpec line changed). bun run check in auth-eth: 60 passed.
  • Not covered: no test loads [core.attestation] sev_snp_tcb_requirements_file through a running KMS; the KMS tests set the verifier's verdict directly.
  • Docker Compose v5.1.4: a service with the configs block above reads the inline JSON at /sev-snp-tcb-requirements.json. The verifier image itself was not run under compose.

@kvinwang
kvinwang force-pushed the feat/verifier-snp-tcb-json branch from d2ec05d to d555e21 Compare November 19, 2026 16:26
@kvinwang kvinwang changed the title feat(verifier): load SEV-SNP TCB requirements from a JSON file feat: load SEV-SNP TCB requirements from a JSON file in the verifier and the KMS Nov 19, 2026
Signed-off-by: Kevin Wang <wy721@qq.com>
…KMS's own list

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang force-pushed the feat/verifier-snp-tcb-json branch from d555e21 to 6b0bd1f Compare November 19, 2026 16:31
@kvinwang
kvinwang enabled auto-merge November 20, 2026 12:44
@kvinwang
kvinwang merged commit 7220775 into next Nov 20, 2026
25 checks passed
@kvinwang
kvinwang deleted the feat/verifier-snp-tcb-json branch November 20, 2026 12:51
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