Confidential Data Processing with AWS Nitro Enclaves - Encryption and Attestation in an Isolated Environment
Learn how to process sensitive data in the isolated environment of Nitro Enclaves, and control encryption key access through KMS integration and attestation.
Overview of Nitro Enclaves
Nitro Enclaves is a service that creates an isolated processing environment (enclave) within an EC2 instance. The enclave has dedicated CPU cores and memory, completely isolated from the host OS, other processes, and even administrators. It has no persistent storage or network interfaces, communicating with the host only through vsock.
KMS Integration and Attestation
At startup, the enclave generates a cryptographic attestation document (PCR values). The KMS condition key kms:RecipientAttestation:PCR0 verifies the enclave's image hash, providing decryption keys only to legitimate enclaves. For PII processing, encrypted personal information is sent to the enclave, where it retrieves the key from KMS, decrypts and processes the data, and returns only the results to the host. Plaintext PII is never exposed to the host OS.
Use Cases and Development
The primary use cases for Nitro Enclaves include PII processing (tokenization, encryption), secure use of encryption keys, multi-party computation, and DRM license verification. By decrypting and processing PII within the enclave and returning only results to the parent instance, no plaintext PII remains in the parent instance's memory or disk. Development uses the Nitro CLI to build enclave image files (EIF), following a workflow similar to Docker containers. Communication between the parent instance and enclave uses vsock (virtual socket), with the application defining the communication protocol. For those who want to systematically learn about confidential computing, related books (Amazon) can also be helpful.
Nitro Enclaves Pricing
Nitro Enclaves itself incurs no additional charges. The cost comes from splitting vCPU and memory from the parent instance to allocate to the enclave, so you need to appropriately size the parent instance. If you allocate 2 vCPUs and 4 GB of memory to the enclave, the parent instance's available resources are reduced accordingly. KMS requests with attestation are charged at the standard KMS rate (approximately $0.03 per 10,000 requests). Nitro Enclaves is available on Nitro-based instances (C5, M5, R5 and later).
Summary
Nitro Enclaves is a service for securely processing sensitive data in a completely isolated environment. KMS attestation ensures that only legitimate enclaves can access encryption keys, enabling PII tokenization and secure use of cryptographic keys. The enclave has dedicated CPU and memory, providing complete isolation that is inaccessible even from the parent instance.