Repository navigation
feat(kms): judge the SEV-SNP TCB against per-CPUID minimums from the auth API - #1627
Merged
Merged
Conversation
kvinwang
force-pushed
the
feat/onchain-snp-tcb-requirements
branch
2 times, most recently
from
November 19, 2026 11:25
38802aa to
aa914a4
Compare
kvinwang
force-pushed
the
feat/onchain-snp-tcb-requirements
branch
2 times, most recently
from
November 19, 2026 15:02
a23f6d7 to
01b3511
Compare
kvinwang
force-pushed
the
feat/onchain-snp-tcb-requirements
branch
from
November 19, 2026 15:25
01b3511 to
152c09d
Compare
Signed-off-by: Kevin Wang <wy721@qq.com>
Signed-off-by: Kevin Wang <wy721@qq.com>
…auth API Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
force-pushed
the
feat/onchain-snp-tcb-requirements
branch
from
November 19, 2026 15:52
152c09d to
7b62da8
Compare
This was referenced Nov 19, 2026
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
AMD publishes no TCB status for SEV-SNP, so #1621 judges a report against the AMD bulletins listed in
sev_snp_tcb_requirements. Two things are wrong with that list, which no release has shipped:kms.toml: governance cannot see or change it, and every KMS has to be configured with the same one.0xDEon Milan but0x47on Milan-X, and0x56on Genoa but0x1Bon Bergamo/Siena. Amilanentry either rejects a patched Milan-X or checks nothing on Milan.Fix
Governance publishes one minimum TCB per CPU, and the KMS reads the list from its auth API, as a JSON string it parses itself, like Intel's TCB info.
[{"cpuid":"00a00f11","bootloader":0,"tee":0,"snp":27,"microcode":222}]DstackKms:setSevSnpTcbRequirements(string), thesevSnpTcbRequirements()getter, aSevSnpTcbRequirementsSetevent and aPolicyChangedentry that commits to the content.GET /sevSnpTcbRequirements, plus theSetSevSnpTcbRequirementsscript, which refuses malformed JSON.dstack-auth: the same route, fromsevSnpTcbRequirementsin its allowlist.kms.toml.Behavior change
dstack-verifiertakes the same per-CPUID entries in[[attestation.sev_snp_tcb_requirements]]. As before, its status is empty for a report it has no entry for.The contract takes one SEV-SNP string instead of a value per TEE platform: that is 326 bytes of
DstackKmsagainst 596, and both this PR and #1624 draw on the same headroom.nextDstackKmsDstackKmsV2Not in this PR:
dstack-verifierdoes not read the auth API, so its own list must still match the published one. Bulletins that signal a fix through a mitigation or platform-info bit (AMD-SB-3020, 3033, 3059) are not checked.Verification
forge clean && forge test --ffi: 118 passed, including the upgrade-safety validation.forge build --sizesgives the sizes above.bun run checkinauth-eth: 60 passed.cargo check --workspace --all-targets --all-featurespasses.cargo test -p sev-snp-qvl -p dstack-attest -p dstack-verifier -p dstack-kms -p dstack-auth -p mock-attestation -p dstack-tee-simulator --all-featurespasses.configured_tcb_requirements_judge_the_real_reportruns the real Milan fixture:UpToDateat its own TCB under00a00f11,OutOfDateone microcode SVN higher, and an empty status under Milan-X's00a00f12.tcbStatussent for authorization is the one judged against the published list; reverting either handler to the verifier's own status fails them. The certificate handler has no SEV-SNP handler test.sev_snp_tcb_is_judged_against_governances_requirementscovers a met minimum and an unmet one, and the refusals: another CPU's entry only, an empty list, a backend without the route, an unavailable backend and an unparsable list.Deploy.s.sol, set the list with the script (malformed JSON refused), read it back throughQuery.s.solandGET /sevSnpTcbRequirements.