3.4.2.7. Encrypting Data in Transit & At Rest (KMS, CloudHSM, ACM)
3.4.2.7. Encrypting Data in Transit & At Rest (KMS, CloudHSM, ACM)
Encryption is non-negotiable for compliance frameworks (SOC 2, HIPAA, PCI DSS). AWS provides encryption at every layer.
At-rest encryption across services:
| Service | Default Encryption | Customer-Managed KMS |
|---|---|---|
| S3 | SSE-S3 (default since Jan 2023) | SSE-KMS with a customer managed key |
| EBS | AES-256 (account-level default) | Customer managed key per volume |
| RDS | AES-256 with KMS | Customer managed key at creation (can't enable later) |
| DynamoDB | AWS owned key (free) | Customer managed key for audit trail |
| Lambda env vars | AWS managed key | Customer managed key for custom encryption |
KMS vs. CloudHSM:
- KMS: Multi-tenant, managed. Best for most use cases. FIPS 140-2 Level 2.
- CloudHSM: Single-tenant hardware. Required for FIPS 140-2 Level 3 compliance. You manage the HSM cluster.
In-transit encryption:
- ALB/NLB → TLS termination with ACM certificates
- Service-to-service → TLS (SDK default), VPC endpoints (private network)
- Database connections → RDS/Aurora support TLS; enforce with
require_sslparameter - S3 → enforce HTTPS with a bucket-policy
Denyons3:*whenaws:SecureTransportisfalse, listing both the bucket ARN and the/*object ARN
# Enforce TLS on RDS connections
aws rds modify-db-parameter-group \
--db-parameter-group-name prod-params \
--parameters "ParameterName=rds.force_ssl,ParameterValue=1,ApplyMethod=pending-reboot"
Exam Trap: RDS encryption must be enabled at creation time — you cannot encrypt an existing unencrypted RDS instance. To encrypt an existing instance: create a snapshot → copy the snapshot with encryption enabled → restore from the encrypted snapshot. If the exam describes migrating an unencrypted database to encrypted, this is the required workflow.