Skip to content

Commit 2310283

Browse files
committed
fix(attestation): reject other non-current TCB statuses
1 parent da464f7 commit 2310283

3 files changed

Lines changed: 34 additions & 10 deletions

File tree

docs/security/security-model.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ risk is already outside dstack's confidentiality/integrity guarantees.
297297

298298
### Out-of-date TCBs have a bounded grace period
299299

300-
dstack applies `dcap-qvl`'s quote policy after cryptographic verification. Platform and quoting-enclave TCB levels reported as `OutOfDate` are accepted for 15 days after the corresponding TCB level's publication date. Once that grace period expires, verification fails. `Revoked` TCBs are always rejected.
300+
dstack applies `dcap-qvl`'s quote policy after cryptographic verification. `UpToDate` is accepted, while platform and quoting-enclave TCB levels reported as `OutOfDate` are accepted for 15 days after the corresponding TCB level's publication date. Once that grace period expires, verification fails. All other TCB statuses, including `ConfigurationNeeded`, `SWHardeningNeeded`, and `Revoked`, are rejected.
301301

302-
Other non-current statuses (`ConfigurationNeeded`, `SWHardeningNeeded`, and their combinations) remain accepted and are surfaced in the verified report for downstream policy decisions. `validate_tcb` separately enforces hard invariants: debug mode must be off, and the SEAM/service-TD measurements must be well-formed.
302+
`validate_tcb` separately enforces hard invariants: debug mode must be off, and the SEAM/service-TD measurements must be well-formed.
303303

304304
### Development modes are auditable, not production-safe
305305

dstack/dstack-attest/src/attestation.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,7 @@ const TCB_OUT_OF_DATE_GRACE_PERIOD: Duration = Duration::from_secs(15 * 24 * 60
210210

211211
fn tdx_quote_policy(now: u64) -> QuotePolicy {
212212
QuotePolicy::strict(now)
213-
.allow_status(TcbStatus::SWHardeningNeeded)
214-
.allow_status(TcbStatus::ConfigurationNeeded)
215-
.allow_status(TcbStatus::ConfigurationAndSWHardeningNeeded)
216213
.allow_status(TcbStatus::OutOfDate)
217-
.allow_status(TcbStatus::OutOfDateConfigurationNeeded)
218214
.platform_grace_period(TCB_OUT_OF_DATE_GRACE_PERIOD)
219215
.qe_grace_period(TCB_OUT_OF_DATE_GRACE_PERIOD)
220216
.allow_dynamic_platform(true)
@@ -2515,6 +2511,22 @@ pub struct AppInfo {
25152511
mod tests {
25162512
use super::*;
25172513

2514+
#[test]
2515+
fn tdx_policy_accepts_only_up_to_date_and_out_of_date() {
2516+
let policy = tdx_quote_policy(0);
2517+
assert!(policy.is_status_acceptable(TcbStatus::UpToDate));
2518+
assert!(policy.is_status_acceptable(TcbStatus::OutOfDate));
2519+
for status in [
2520+
TcbStatus::OutOfDateConfigurationNeeded,
2521+
TcbStatus::ConfigurationAndSWHardeningNeeded,
2522+
TcbStatus::ConfigurationNeeded,
2523+
TcbStatus::SWHardeningNeeded,
2524+
TcbStatus::Revoked,
2525+
] {
2526+
assert!(!policy.is_status_acceptable(status));
2527+
}
2528+
}
2529+
25182530
#[test]
25192531
fn external_trust_anchor_requires_explicit_insecure_opt_in() {
25202532
let config = AttestationVerifierConfig {

dstack/local-key-provider/src/provider.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,7 @@ const TCB_OUT_OF_DATE_GRACE_PERIOD: Duration = Duration::from_secs(15 * 24 * 60
124124

125125
fn tdx_quote_policy(now: u64) -> QuotePolicy {
126126
QuotePolicy::strict(now)
127-
.allow_status(TcbStatus::SWHardeningNeeded)
128-
.allow_status(TcbStatus::ConfigurationNeeded)
129-
.allow_status(TcbStatus::ConfigurationAndSWHardeningNeeded)
130127
.allow_status(TcbStatus::OutOfDate)
131-
.allow_status(TcbStatus::OutOfDateConfigurationNeeded)
132128
.platform_grace_period(TCB_OUT_OF_DATE_GRACE_PERIOD)
133129
.qe_grace_period(TCB_OUT_OF_DATE_GRACE_PERIOD)
134130
.allow_dynamic_platform(true)
@@ -140,6 +136,22 @@ fn tdx_quote_policy(now: u64) -> QuotePolicy {
140136
mod tests {
141137
use super::*;
142138

139+
#[test]
140+
fn tdx_policy_accepts_only_up_to_date_and_out_of_date() {
141+
let policy = tdx_quote_policy(0);
142+
assert!(policy.is_status_acceptable(TcbStatus::UpToDate));
143+
assert!(policy.is_status_acceptable(TcbStatus::OutOfDate));
144+
for status in [
145+
TcbStatus::OutOfDateConfigurationNeeded,
146+
TcbStatus::ConfigurationAndSWHardeningNeeded,
147+
TcbStatus::ConfigurationNeeded,
148+
TcbStatus::SWHardeningNeeded,
149+
TcbStatus::Revoked,
150+
] {
151+
assert!(!policy.is_status_acceptable(status));
152+
}
153+
}
154+
143155
#[test]
144156
fn extracts_all_key_derivation_measurements_in_wire_order() {
145157
let quote = Quote::parse(include_bytes!("../../ra-tls/assets/tdx_quote")).unwrap();

0 commit comments

Comments
 (0)