Confidential Computing - Isolating and Protecting Data in Use with AWS Nitro Enclaves

Learn about isolated processing of sensitive data using AWS Nitro Enclaves. Covers cryptographic attestation, KMS integration, and use cases for PII processing and encryption key management.

The Need for Confidential Computing

In traditional security models, data protection has been achieved through encryption at rest and in transit. However, when processing data, it must be decrypted and loaded into memory, making this "data in use" a target for attacks. Vulnerabilities in the OS or hypervisor, memory dumps, and side-channel attacks can lead to data-in-use leakage. AWS Nitro Enclaves, available on Nitro-based EC2 instances (C5, M5, R5 and later), is a confidential computing service that creates fully isolated virtual machines (Enclaves) within an EC2 instance, executing sensitive data processing in an environment inaccessible from outside. Enclaves are completely isolated from the parent instance by the Nitro Hypervisor, with no network connectivity, persistent storage, SSH access, or external memory access. No one, including AWS operators, can access data inside the Enclave.

How Enclaves Work and Attestation

An Enclave is created by partitioning a portion of the parent EC2 instance's vCPUs (up to half of the parent) and memory. Communication with the parent instance is limited to vsock (virtual socket) only; TCP/IP networking cannot be used. Applications are deployed to the Enclave as Docker images and launched with the Nitro CLI. Cryptographic attestation is a mechanism for verifying Enclave integrity. When an Enclave starts, the Nitro Hypervisor generates an attestation document containing hash values of the Enclave's image (code, configuration). This document is signed by the AWS Nitro Attestation PKI, cryptographically proving that the Enclave has not been tampered with. KMS can verify the attestation document and apply encryption key policies that allow decryption only by a specific Enclave image.

Use Cases and KMS Integration

The primary use case for Nitro Enclaves is PII (Personally Identifiable Information) processing. By processing medical data, financial data, and personal identification information within the Enclave and returning only aggregated results to the parent instance, you eliminate the risk of raw data leakage. For encryption key management, keys are generated and used within the Enclave as an alternative to CloudHSM, ensuring keys never leave the Enclave. With KMS integration, you set the Enclave's image hash (PCR values) as conditions in KMS key policies. This ensures that KMS keys can only be used by a specific Enclave running specific code, making KMS key access impossible even if the parent instance is compromised. For multi-party computation, multiple organizations can send their data to the Enclave, perform joint computation within the Enclave, and return only the results. There are no additional charges; only the EC2 instance pricing applies. For comprehensive learning on Nitro Enclaves best practices, refer to technical books (Amazon).

Nitro Enclaves Pricing

Nitro Enclaves itself incurs no additional charges. The cost is that the parent instance's resources are reduced by the vCPUs and memory allocated to the Enclave. For example, if you allocate 2 vCPUs and 8 GB to an Enclave on an m5.2xlarge (8 vCPU, 32 GB), the parent instance operates with 6 vCPUs and 24 GB. If you need to select a larger instance for the Enclave, the difference in instance pricing is the effective cost. KMS key charges ($1/month per key) used with KMS integration also apply.

Summary - Nitro Enclaves Usage Guidelines

AWS Nitro Enclaves is a confidential computing service that fully isolates and protects data in use. Its key strengths are isolation by the Nitro Hypervisor, cryptographic attestation, and encryption key protection through KMS integration. It is suitable for use cases where protection of data in use is required by regulations or security policies, such as PII processing, encryption key management, and multi-party computation. Available at no additional charge, it can be adopted by adding Enclaves to existing EC2 workloads.