What is bootchain verification
Bootchain verification ensures that a TEE is running the exact firmware, operating system, and application configuration you expect. It works by comparing cryptographic measurements captured during boot against known-good reference values.Bootchain measurements are hardware-specific. The same software stack produces different measurements on machines with different CPU counts, memory sizes, or GPU configurations.
TDX measurement registers
Intel TDX uses measurement registers to record the boot chain and runtime state:MRTD (Measurement Register of Trust Domain)
MRTD measures the initial TD configuration established before the TD starts executing:- TD firmware (TDVF)
- Initial memory layout
- CPU and memory configuration
- Virtual firmware configuration
RTMR registers (Runtime Measurement Registers)
TDX provides four runtime measurement registers (RTMR0-RTMR3) that are extended during boot and runtime:RTMR0
Measures the bootloader and early boot components:- Boot loader (GRUB, systemd-boot, etc.)
- Boot configuration
- Kernel command line
RTMR1
Measures the kernel and initial ramdisk:- Linux kernel image
- initramfs
- Kernel modules loaded during early boot
RTMR2
Measures the operating system and system configuration:- Root filesystem
- System services
- OS configuration files
RTMR3
Measures runtime application state:- Application containers and images
- Application configuration
- TLS certificate binding events
RTMR3 is special because it is extended at runtime with an event log. The client replays the event log to verify RTMR3 and extract the certificate binding.
Measurement verification
Atlas performs bootchain verification by comparing quote measurements against expected values:Expected bootchain configuration
You provide expected measurements in your policy:Verification process
- Quote retrieval - Client requests a TDX quote from the server
- Quote validation - Verify the quote’s cryptographic signature
- MRTD verification - Compare
quote.mrtdagainstexpected_bootchain.mrtd - RTMR0 verification - Compare
quote.rtmr0againstexpected_bootchain.rtmr0 - RTMR1 verification - Compare
quote.rtmr1againstexpected_bootchain.rtmr1 - RTMR2 verification - Compare
quote.rtmr2againstexpected_bootchain.rtmr2 - RTMR3 verification - Replay the event log and verify the computed value matches
quote.rtmr3
BootchainMismatch error.
Event log replay
RTMR3 verification requires replaying the event log:Event log structure
The event log contains ordered entries for runtime events:Replay process
- Start with an initial RTMR3 value (usually zeros)
- For each event in order:
- Hash the event data
- Extend RTMR3:
rtmr3 = SHA384(rtmr3 || event_hash)
- Verify the final computed RTMR3 matches the value in the quote
The event log must be replayed in exact order. Reordering events produces a different final measurement.
Certificate binding verification
During event log replay, Atlas locates the TLS certificate binding event:- Find the event with type
tls_cert_binding - Extract the certificate public key hash from the event
- Compute the hash of the server’s TLS certificate
- Verify that
event.cert_hash == SHA256(server_cert.pubkey)
Computing bootchain measurements
Bootchain measurements depend on hardware configuration and must be computed for your specific deployment.Why measurements vary
The same software stack produces different measurements when:- CPU count changes
- Memory size changes
- GPU configuration changes
- BIOS settings change
- Boot order changes
Measurement computation process
- Deploy your workload in the target TEE environment
- Extract measurements from a quote generated by that environment
- Record measurements as your expected bootchain values
- Use those values in your verification policy
For detailed instructions on computing bootchain measurements, see the source repository’s BOOTCHAIN-VERIFICATION.md file.
Runtime verification policy
Atlas provides flexible runtime verification configuration:Full verification (production)
All runtime fields are required:Development mode (relaxed verification)
For testing, useDstackTdxPolicy::dev() which:
- Accepts more TCB statuses
- Disables bootchain verification
- Disables OS image hash verification
- Disables app configuration verification
- Still verifies the TEE attestation signature and session binding
Development mode should never be used in production. It skips critical security checks.
Error handling
Bootchain verification can fail with specific errors:- Deployment uses different hardware configuration than measurement source
- Software stack has been updated
- Boot configuration changed
- Using measurements from a different deployment