Attestation: certificate validity and revocation checks differ per platform, and SEV-SNP has none
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- aws, gcp, rust
- 领域
- cryptography, security
调研方向
首先比较 sev-snp-qvl/src/lib.rs、nsm-qvl/src/verify.rs、tpm-qvl/src/verify.rs 和 dstack-attest/src/attestation.rs 中的 verifier 入口点,包括 nitro_verify 测试。首先确定每个平台预期的策略和时钟行为;完成的标准是策略已经确定并记录,选定的验证缺口已得到一致处理,并且过期或撤销行为由确定性测试覆盖。
由索引模型根据 Issue 内容生成。
描述
Summary
Temporal validation of attestation collateral differs by platform, and one platform has none at all. An expired VCEK verifies on AMD SEV-SNP exactly as a fresh one does; a revoked AWS Nitro certificate is never checked against a CRL because the production call site disables collateral; GCP TPM checks revocation only if a CRL happened to download. Only Intel TDX is complete.
None of this is written down anywhere, so a reader of one platform's path reasonably assumes the others behave the same way.
What each platform actually does
| Platform | Cert notBefore/notAfter |
Collateral expiry | Clock injectable | CRL |
|---|---|---|---|---|
| Intel TDX / GCP TDX | yes | yes (TCBInfo + QEIdentity nextUpdate) |
yes (now_secs) |
yes, ExpirationPolicy::Enforce, UnknownStatusPolicy::Deny |
| GCP TPM | yes | only when a CRL was downloaded | no | fail-open if the list is empty |
| AWS Nitro Enclave | yes (+1h doc freshness) | guard exists, unreachable in prod | yes | disabled at call site |
| AWS NitroTPM | yes (+1h doc freshness) | guard exists, unreachable in prod | yes | disabled at call site |
| AMD SEV-SNP | no | no | no | no |
Detail
AMD SEV-SNP — no temporal validation anywhere. Both chain branches in sev-snp-qvl/src/lib.rs:540-553 are signature-only:
- external-root branch,
verify_x509_chain(lib.rs:572-595): checksis_ca(), issuer/subject linkage, three signatures. NoValidityaccess exists in the file. - default branch:
sev6.0.0'sVerifiableimpls bottom out atX509::verify(&key)(sev-6.0.0/src/certs/snp/cert.rs:81-100), which is a signature check.
QuoteVerifier::verify (lib.rs:118-133) takes no clock argument, so a caller cannot supply one either. AMD's /vcek/v1/{product}/crl is never fetched. Observed on real collateral: a VCEK is issued with a 7-year window (ASK/ARK run to 2045), so nothing expires soon — but nothing would be noticed if it did, and revocation is permanently invisible.
AWS Nitro Enclave and NitroTPM — revocation disabled by the caller, not by the library. nsm-qvl bails when a certificate has CRL distribution points but no CRL was supplied (nsm-qvl/src/verify.rs:196-202). That guard sits after the let Some(collateral) = collateral else { ... return Ok(()) } early return at verify.rs:184-195, and dstack passes None:
// dstack-attest/src/attestation.rs:2461
// CRL fetch is unreliable (e.g. 403 from S3), so keep it disabled here by default.
let verified_report = verifier
.aws_nitro_enclave
.verify(&nsm_quote.nsm_quote, None, now)
Same for NitroTPM at attestation.rs:1830-1832. The reason given is real — AWS's S3 CRL endpoint returns 403 — but the result is that a fail-closed guard reads as active while never running.
GCP TPM — fail-open on an empty CRL set. tpm-qvl/src/verify.rs:609 gates all revocation checking on if !collateral.crls.is_empty(), and the else branch verifies with None revocation options. Unlike nsm-qvl there is no bail when a chain advertises CRL distribution points but none were downloaded: collateral.rs:94-105 continues past certs without a CRL DP, and download_first_available_crl only fails when every URL for a cert fails. Certificate dates are checked (verify.rs:591-594, 640-667).
The now parameter is mostly decorative. AttestationV1::verify_with_time / DstackQuote::verify_with_time accept a now, but it reaches only nsm-qvl. TDX hardcodes SystemTime::now() inside verify_tdx_quote (attestation.rs:181-188); GCP TPM and SEV-SNP have no hook at all. Every production path passes None; the only non-None caller is dstack-attest/tests/nitro_verify.rs:47. Verifying a quote as-of a past instant is therefore impossible for three of five platforms, which also makes deterministic tests of expiry behaviour impossible to write.
Operator-supplied root CAs are not date-validated either. validate_x509_certificate (attestation.rs:205-222) parses the DER, rejects trailing bytes, and asserts is_ca(). Nothing looks at the validity window.
Why it is worth fixing
Individually each of these is arguably defensible — SNP's rollback protection comes from the TCB fields in the report rather than from certificate expiry, and AWS's CRL endpoint really is unreliable. Collectively they mean the answer to "does dstack reject stale or revoked attestation collateral?" is "depends which platform, and not in a way the code makes visible."
The gap also compounds with caching. Pointing [core.attestation.urls] amd_kds at a caching mirror is a reasonable way to survive a KDS outage, but because nothing checks dates or revocation on that path, an arbitrarily old cached VCEK is indistinguishable from a fresh one.
Suggested direction
Not a fix proposal, just what seems worth deciding:
- Decide and document the intended policy per platform, including where fail-open is deliberate. Today the intent is only inferable from what the code omits.
- Thread one clock through every verifier.
nowalready exists in the public API; making it reach all five platforms costs little and makes expiry testable. - Add certificate validity checks to
sev-snp-qvl, or record explicitly why the report's TCB fields make them redundant. - Re-examine the Nitro CRL call site. If S3 403s make CRLs impractical, a comment at the call site is weaker than a typed "revocation not checked" signal that surfaces in
VerifiedReport. - Consider surfacing what was checked in the verification result, so a caller can tell a fully-validated chain from a signature-only one.
Found while testing 0.6.0-rc0 on real TDX and SEV-SNP hardware. Happy to take any of these if there is a preferred direction.
- 主要语言
- Rust
- 星标
- 555
- 派生
- 97
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 195
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Dstack-TEE/dstack 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
Dstack-TEE/dstack#1384 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
Dstack-TEE/dstack#1301 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
Dstack-TEE/dstack#1300 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
Dstack-TEE/dstack#1299 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
Dstack-TEE/dstack#1298 ·
维护者通常 1 天内回复
查看 Dstack-TEE/dstack 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
zcashlabs/thus-spoke-zakura#153 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
topgrade-rs/topgrade#2395 ·
维护者通常 1 天内回复
-
app bug windows-os
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
editor good first issue
难度 2/5 1-3 小时 新手友好度 65/100
funnyboy-roks/inq#54 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复