Repository navigation
feat: load SEV-SNP TCB requirements from a JSON file in the verifier and the KMS - #1628
Merged
Merged
Conversation
kvinwang
force-pushed
the
feat/verifier-snp-tcb-json
branch
from
November 19, 2026 16:26
d2ec05d to
d555e21
Compare
Signed-off-by: Kevin Wang <wy721@qq.com>
…KMS's own list Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
force-pushed
the
feat/verifier-snp-tcb-json
branch
from
November 19, 2026 16:31
d555e21 to
6b0bd1f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since #1627 the KMS reads the minimum TCB of each SEV-SNP CPU from its auth API as one JSON list.
dstack-verifierjudges 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_filein 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-SNPtcb_statusstays empty, as before.[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
nextthose were refused. The docs say to write the file in the KMS's compose file, likekms.toml, so that it is part of the measurement governance allows.A compose file can carry the list inline:
Verification
cargo check --workspace --all-targets --all-featurespasses, andcargo test -p dstack-attest -p dstack-verifier -p dstack-kms -p sev-snp-qvl -p dstack-auth --all-featurespasses.sev_snp_tcb_requirements_are_read_and_checked_during_loadcovers a missing file, a valid list, an empty list and each rejected entry.sev_snp_tcb_is_judged_against_governances_requirementscovers 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 --verifyon the real Milan fixture (verifier/fixtures/sev-snp-attestation.json), with the file set through the environment variable:UpToDateunder a met minimum,OutOfDateunder an unmet one, notcb_statuswith only Milan-X's entry or no file, and exit 1 at startup for a malformed or missing file.kms.tomlanddstack-verifier.tomlparses 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 checkinauth-eth: 60 passed.[core.attestation] sev_snp_tcb_requirements_filethrough a running KMS; the KMS tests set the verifier's verdict directly.configsblock above reads the inline JSON at/sev-snp-tcb-requirements.json. The verifier image itself was not run under compose.