Lesson 2.1 · 12 min read
Enclaves versus confidential VMs
Two architectural approaches with very different TCBs and porting costs.
Two ways to draw the box
CPU TEEs fall into two broad families. Process-level enclaves (Intel SGX is the main example) protect a portion of a single application's address space. Confidential virtual machines (Intel TDX, AMD SEV-SNP, Arm CCA Realms) protect an entire VM, including its guest kernel, from the hypervisor and host.
| Process-level enclave | Confidential VM | |
|---|---|---|
| Unit of protection | Part of one process | A whole virtual machine |
| TCB size | Small: enclave code plus CPU | Larger: guest firmware, kernel, user space, plus CPU and its security firmware |
| Porting effort | High: partition the app, or use a library OS such as Gramine | Low: run existing OS images with a TEE-aware kernel |
| Interface to the host | Enclave calls in and out (ECALL/OCALL) | Virtual devices; I/O through shared, unencrypted pages |
| Examples | Intel SGX | Intel TDX, AMD SEV-SNP, Arm CCA Realms; also used by AWS, Azure and Google Cloud confidential VM offerings |
Key takeaways
- Enclaves minimise the TCB at the cost of re-architecting the application.
- Confidential VMs are easier to adopt but put an entire guest OS inside the TCB, which then needs hardening and measurement.
- In a confidential VM, I/O goes through shared memory that the host can see, so encrypt it at the application layer.