Two Kinds of Encryption
| Type | Protects | Examples |
|---|---|---|
| At rest | Data stored on disks and in services | S3 encryption, EBS encryption, RDS encryption, DynamoDB encryption |
| In transit | Data moving across a network | HTTPS/TLS, VPN, TLS to RDS |
AWS KMS: Key Management Service
AWS KMS creates and controls encryption keys and is integrated with most AWS services. Keys never leave KMS in plain form, and every use is logged in CloudTrail.
| Key type | Who manages | Cost | Notes |
|---|---|---|---|
| AWS owned keys | AWS (hidden) | Free | Used by default in some services. You cannot see or audit them |
AWS managed keys (aws/s3, aws/ebs) | AWS creates, you can view | Free per key, small usage charge | Rotated automatically on a schedule set by AWS. Cannot change policy |
| Customer managed keys (CMK) | You | Monthly per key plus requests | Own key policy, enable/disable, rotation, cross-account use, deletion with waiting period |
| Imported key material / custom key store (CloudHSM) | You | Higher | Strict compliance needs |
| Key kind | Description |
|---|---|
| Symmetric (AES-256) | One key encrypts and decrypts. Default. Most AWS services use this. Data never leaves KMS if you call Encrypt directly (up to 4 KB) |
| Asymmetric (RSA, ECC) | Public/private pair. For signing or encrypting outside AWS |
| HMAC keys | Generate and verify message authentication codes |
| Multi-Region keys | Same key material replicated in several Regions, so you can decrypt in another Region without re-encrypting |
Key Policies and Grants
- The key policy is the main access control for a KMS key. Without the root statement, IAM policies cannot grant access to it
- A caller needs permission in the key policy (or IAM policy) and often permission on the service (for example S3 plus KMS)
- Grants give temporary, delegated use of a key (used by services like EBS and RDS)
- Key rotation: enable automatic yearly rotation for customer managed symmetric keys; the key ID and alias stay the same
Envelope Encryption
KMS directly encrypts only small data (up to 4 KB). For large data AWS uses envelope encryption: a data key encrypts the data, and the KMS key encrypts the data key.
S3 Encryption Choices
| Option | Key managed by | Notes |
|---|---|---|
| SSE-S3 | S3 (AES-256) | Default for all new objects. No extra cost |
| SSE-KMS | KMS key | Audit trail in CloudTrail, key policy control. Request costs and KMS quotas apply (use S3 Bucket Keys to reduce them) |
| DSSE-KMS | KMS, two layers | Dual-layer for strict requirements |
| SSE-C | You send the key with each request | AWS does not store the key |
| Client-side encryption | You, before upload | AWS never sees plain data |
Encrypt EBS, RDS and Others
- EBS: turn on encryption by default per Region. Snapshots of encrypted volumes are encrypted. To encrypt an existing volume: snapshot, copy with encryption, create a new volume
- RDS: choose encryption when creating the database. You cannot encrypt an existing unencrypted instance directly: snapshot, copy encrypted, restore
- DynamoDB, SQS, SNS, EFS, Redshift: encryption options built in
AWS Secrets Manager
Secrets Manager stores passwords, API keys and database credentials, encrypted with KMS, fetched at runtime by an IAM role. Its main feature is automatic rotation, especially for RDS.
Parameter Store vs Secrets Manager
| Feature | SSM Parameter Store | Secrets Manager |
|---|---|---|
| Purpose | Configuration values and simple secrets | Secrets with lifecycle |
| Cost | Standard parameters are free | Per secret per month plus API calls |
| Automatic rotation | No (do it yourself) | Yes, built-in for RDS and others |
| Encryption | Optional SecureString with KMS | Always with KMS |
| Cross-Region replication | No | Yes |
| Value size | 4 KB standard, 8 KB advanced | Up to 64 KB |
AWS Certificate Manager (ACM)
ACM issues and renews public TLS certificates for free when used with integrated services: ELB, CloudFront, API Gateway. You cannot install ACM public certificates directly on an EC2 instance.
- Validate by DNS (a CNAME record in Route 53, preferred, enables auto-renew) or by email
- **CloudFront needs the certificate in
us-east-1**. A load balancer needs it in its own Region - Use ACM Private CA for internal certificates
CloudHSM
- A dedicated hardware security module in your VPC, FIPS 140-2 Level 3, you manage keys and users, AWS cannot see them
- Use when rules demand sole control of keys. Otherwise KMS is simpler and cheaper
- Can back a KMS custom key store
Data Protection Checklist
- Encrypt by default: S3, EBS, RDS, DynamoDB, EFS, SQS
- TLS everywhere: require HTTPS, redirect HTTP, modern TLS policy on load balancers
- Customer managed KMS keys for sensitive data, with tight key policies and rotation
- No secrets in code, AMIs, environment variables in plain text, or Git. Use Secrets Manager or Parameter Store
- Use Macie to find sensitive data in S3, Object Lock for immutability
- Control key deletion: use a waiting period and alarms on
ScheduleKeyDeletion - Backups are encrypted too
Practice Tasks
- Create a customer managed key and an alias, enable rotation, and encrypt a small file with the CLI
- Set a bucket to use SSE-KMS with Bucket Keys and test upload from a role that does not have
kms:GenerateDataKey - Store a database secret in Secrets Manager and read it from a Lambda or EC2 role
- Request an ACM certificate with DNS validation and attach it to a load balancer listener
- Turn on EBS encryption by default
Conclusion
Encrypt at rest and in transit. KMS manages keys with key policies and envelope encryption, Secrets Manager stores and rotates secrets, Parameter Store holds configuration, and ACM gives free TLS certificates for ELB, CloudFront and API Gateway. Never put secrets in code, and use roles to read them.

