Get TDX Quote
Generate an Intel TDX attestation quote with custom report data. This endpoint implements TLS channel binding using EKM (Exported Keying Material) as defined in RFC 5705.
Endpoint
Authentication
Requires X-TLS-EKM-Channel-Binding header with HMAC-signed EKM value.
The EKM header format is {ekm_hex}:{hmac_hex} where:
ekm_hex: 64-character hex string (32 bytes) of the TLS Exported Keying Material
hmac_hex: 64-character HMAC-SHA256 signature of the EKM value
The HMAC is computed as: HMAC-SHA256(ekm_hex, EKM_SHARED_SECRET)
Request Parameters
64-character hexadecimal string (32 bytes). Provides freshness to the attestation quote. Must be a valid hex string.
Request Body
{
"nonce_hex": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"
}
Response
Whether the quote generation succeeded
TDX quote object from dstack_sdk containing the raw attestation data
Trusted Computing Base (TCB) information for quote verification
Unix timestamp (in seconds) when the quote was generated
Type of quote generated (always “tdx” for Intel TDX)
Error message if quote generation failed
Error Responses
400 Bad Request
- Missing or invalid
nonce_hex (must be exactly 64 hex characters)
- Missing EKM header
403 Forbidden
- Invalid EKM header HMAC signature
500 Internal Server Error
- Dstack client not initialized
- Failed to obtain TDX quote or TCB info
- EKM_SHARED_SECRET not configured
Report Data Computation
The report_data field in the TDX quote is computed as:
report_data = SHA512(nonce_hex + ekm_hex)
This binds the attestation to both:
- The specific nonce (freshness)
- The TLS session via EKM (channel binding)
Clients must verify that the same nonce and EKM were used when validating the quote.
Example
curl -X POST https://your-attestation-service.com/tdx_quote \
-H "Content-Type: application/json" \
-H "X-TLS-EKM-Channel-Binding: a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456:8f3a2b1c4d5e6f7890123456789abcdef01234567890abcdef1234567890abcd" \
-d '{
"nonce_hex": "deadbeef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
}'
Success Response
{
"success": true,
"quote": {
// GetQuoteResponse object from dstack_sdk
// Contains raw TDX quote bytes and metadata
},
"tcb_info": {
// TcbInfoV05x object with TCB level information
// Used for verifying the quote
},
"timestamp": "1709654400",
"quote_type": "tdx"
}
Security Considerations
EKM Channel Binding: The EKM header must be forwarded by a TLS-terminating proxy (e.g., Nginx) running inside the same TEE as the attestation service. The proxy and service must share the EKM_SHARED_SECRET to prevent header forgery.
Development Mode: In non-TEE environments, the service falls back to using the EKM_SHARED_SECRET environment variable. The secret must be at least 32 characters long.
Implementation Details
The service uses the dstack_sdk to interact with Intel TDX hardware. The quote generation happens asynchronously, with both the quote and TCB info fetched concurrently for optimal performance.
Source: cvm/attestation-service/attestation_service.py:182-263