AWS Encryption Strategies: Protecting Data at Rest and in Transit
Developing encryption strategies for data at rest and data in transit
AWS Encryption Strategies: Protecting Data at Rest and in Transit
This study guide covers the architectural patterns and service integrations required to develop robust encryption strategies on AWS, as required for the SAP-C02 Professional exam.
Learning Objectives
After studying this guide, you should be able to:
- Design a data classification system to drive security requirements.
- Differentiate between encryption at rest and encryption in transit across major AWS services.
- Evaluate the trade-offs between shared HSMs, CloudHSM, and External Key Store (XKS).
- Implement PII discovery and monitoring using Amazon Macie.
- Select the appropriate S3 encryption method (SSE-S3, SSE-KMS, SSE-C) based on compliance needs.
Key Terms & Glossary
- PII (Personally Identifiable Information): Any data that can be used to identify a specific individual (e.g., SSN, email, phone number).
- KMS (Key Management Service): A managed service that makes it easy for you to create and control the cryptographic keys used to protect your data.
- HSM (Hardware Security Module): A physical computing device that safeguards and manages digital keys and performs encryption/decryption functions.
- SSE (Server-Side Encryption): Data is encrypted by the AWS service at the destination before it is written to disk.
- TLS (Transport Layer Security): The cryptographic protocol used to secure communications over a computer network (encryption in transit).
- FIPS 140-2 Level 3: A US government computer security standard used to approve cryptographic modules; AWS HSMs are validated at this level.
The "Big Idea"
Security in AWS is a layered approach where Data Classification acts as the foundation. You cannot protect what you don't understand. Once data is categorized by sensitivity, encryption serves as the primary technical control to ensure that even if physical storage or network traffic is compromised, the data remains unreadable without authorized access to the cryptographic keys managed via AWS KMS.
Formula / Concept Box
| Concept | Application / Rule |
|---|---|
| S3 Encryption Default | All S3 buckets now have SSE-S3 enabled by default. |
| S3 Bucket Keys | Reduces SSE-KMS costs by decreasing the request traffic from S3 to KMS. |
| HYOK (Hold Your Own Key) | Achieved via AWS External Key Store (XKS) for extreme compliance requirements. |
| FIPS Validation | AWS shared and dedicated HSMs are validated at FIPS 140-2 Level 3. |
Hierarchical Outline
- I. Data Classification (The First Step)
- Identification: Determining ownership, sensitivity, and PII presence.
- Automated Discovery: Using Amazon Macie for S3 buckets to find sensitive data patterns.
- Tagging: Implementing Attribute-Based Access Control (ABAC) using project or team tags to manage access.
- II. Protecting Data at Rest
- AWS KMS: Centralized key lifecycle management (generation, rotation, deletion).
- Storage Services:
- S3: Options include SSE-S3 (managed keys) and SSE-KMS (customer keys).
- EBS/RDS: Integrated with KMS for volume and instance encryption.
- Snowball Edge: Automatic 256-bit encryption for data on physical devices.
- III. Protecting Data in Transit
- SSL/TLS: The standard for most AWS API calls and web traffic.
- AWS DataSync: Uses TLS ciphers depending on the endpoint type.
- S3 Transfer Acceleration: Combines SSL/TLS with the AWS global network for speed and security.
- IV. Key Management Infrastructure
- Shared HSMs: Managed by AWS, shared among customers (standard KMS).
- CloudHSM: Dedicated, single-tenant HSM instances for full control.
- External Key Store (XKS): Keys reside on-premises; AWS KMS requests encryption/decryption from your hardware.
Visual Anchors
Data Protection Workflow
Encryption at Rest Architecture
\begin{tikzpicture}[node distance=2cm] \draw[thick] (0,0) rectangle (2,1.5) node[pos=.5] {\begin{tabular}{c} Client \ Application \end{tabular}}; \draw[->, thick] (2,0.75) -- (4,0.75) node[midway, above] {Unencrypted Data}; \draw[thick] (4,0) rectangle (6,1.5) node[pos=.5] {\begin{tabular}{c} AWS Service \ (e.g. S3) \end{tabular}}; \draw[<->, thick] (5,1.5) -- (5,3) node[midway, right] {KMS Request}; \draw[thick] (4,3) rectangle (6,4.5) node[pos=.5] {AWS KMS}; \draw[->, thick] (6,0.75) -- (8,0.75) node[midway, above] {Encrypted Data}; \draw[thick] (8,-0.5) rectangle (10,2) node[pos=.5, rotate=90] {Storage Media}; \node at (5,-1) {\textbf{Server-Side Encryption (SSE) Process}}; \end{tikzpicture}
Definition-Example Pairs
- Term: Anonymization
- Definition: The process of removing PII from a dataset so that the individuals whom the data describe remain anonymous.
- Example: A healthcare company replaces patient names and SSNs with unique UUIDs before sending the dataset to an analytics team for trend research.
- Term: Hold Your Own Key (HYOK)
- Definition: A security model where the encryption keys are stored and managed entirely outside of the cloud provider's perimeter.
- Example: A bank in a highly regulated jurisdiction uses AWS KMS XKS to ensure that their keys never leave their physical on-premises vault, even while using AWS S3.
Worked Examples
Example 1: Selecting S3 Encryption for Compliance
Scenario: A financial firm must encrypt all data in S3. They need an audit trail of every time a key is used and the ability to rotate keys annually. Solution: Use SSE-KMS.
- Step 1: Create a Customer Managed Key (CMK) in AWS KMS.
- Step 2: Enable annual rotation in the KMS console.
- Step 3: Set the S3 bucket policy to require
aws:kmsas the encryption header. - Result: All access is logged in AWS CloudTrail, providing the required audit trail.
Example 2: Discovering Leaked PII
Scenario: An administrator suspects that employees are accidentally uploading spreadsheets containing credit card numbers to a public S3 bucket. Solution: Enable Amazon Macie.
- Step 1: Enable Macie and point it at the specific S3 buckets.
- Step 2: Configure a "Sensitive Data Discovery Job".
- Step 3: Review findings in the Macie Dashboard or set up an EventBridge rule to trigger a Lambda function that automatically sets the bucket to private upon discovery of PII.
Checkpoint Questions
- Which service would you use to automatically identify Social Security Numbers stored in an S3 bucket?
- What is the main difference between SSE-S3 and SSE-KMS in terms of management?
- Why might a company choose AWS CloudHSM over the standard AWS KMS shared fleet?
- True or False: DataSync automatically encrypts data at rest on the destination file system.
- Which FIPS 140-2 level are AWS HSMs validated at?
▶Click for Answers
- Amazon Macie.
- SSE-S3 uses keys managed by S3; SSE-KMS uses keys managed by KMS, providing audit trails and rotation control.
- For dedicated single-tenant hardware control or specific compliance requirements (like PKCS#11/JCE/CNG).
- False. DataSync handles encryption in transit, but at-rest encryption depends on the destination service (e.g., S3 or EFS settings).
- Level 3.
Muddy Points & Cross-Refs
- KMS vs. CloudHSM: Students often confuse these. KMS is a multi-tenant service using a shared fleet of HSMs. CloudHSM is a single-tenant physical HSM you manage yourself. Use KMS for 95% of use cases; use CloudHSM only for specific regulatory requirements or legacy application support.
- Latency in XKS: External Key Store (XKS) introduces significant latency because every encryption/decryption request must travel over the internet or Direct Connect to your data center. This should be a "last resort" for compliance.
- See Also: Chapter 1 for ABAC details and Chapter 5 for Security Requirements.
Comparison Tables
HSM Flavor Comparison
| Feature | Shared HSM (KMS) | CloudHSM | External Key Store (XKS) |
|---|---|---|---|
| Tenancy | Multi-tenant | Single-tenant | Customer-owned |
| Control | AWS Managed | Customer Managed | Full Customer Control |
| Availability | Built-in redundancy | User manages clusters | User manages external infra |
| Cost | Low (Pay-per-use) | High (Hourly instance) | High (Infra + KMS fee) |
| Key Storage | Inside AWS | Inside AWS | Outside AWS (On-prem) |
Encryption in Transit Comparison
| Tool | Primary Mechanism | Use Case |
|---|---|---|
| SSL/TLS | Standard Encryption | Web traffic, API calls, S3 access |
| DataSync | TLS Ciphers | Large scale data migration |
| Storage Gateway | SSL/TLS | Hybrid cloud storage access |
| S3 Transfer Accel. | SSL/TLS over Edge | Faster, secure global uploads |