Encrypting Data in Transit and at Rest
This lesson explains how encryption protects data in transit and at rest, the managed services AWS provides for keys and certificates, and the customer's part in deciding how to use them.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish encryption in transit from encryption at rest.
- Distinguish AWS KMS, AWS CloudHSM and AWS Certificate Manager.
- Explain the customer's responsibility for encryption under the shared responsibility model.
In transit and at rest
Data needs protection in two situations. Encryption in transit protects data while it moves across a network, for example between a user's browser and a website, so it cannot be read if it is intercepted. It uses TLS, the protocol behind HTTPS. Encryption at rest protects data while it is stored, for example in S3 or on an EBS volume, so it cannot be read if the storage is accessed without permission. It uses encryption keys, which on AWS are usually managed by AWS KMS. The following table summarises the two.
In transit or at rest?
Key and certificate services
Encryption depends on keys and certificates, and several services manage them. AWS Key Management Service (KMS) creates and controls encryption keys. It is integrated with services such as S3, EBS, RDS and DynamoDB, so turning on encryption is often a single setting, and every use of a key is recorded in CloudTrail. AWS CloudHSM provides dedicated hardware security modules used only by one customer, for organisations whose compliance rules require it.
AWS Certificate Manager (ACM) provides free public TLS certificates for load balancers and CloudFront, and renews them automatically, so HTTPS websites do not break when a certificate expires. AWS Secrets Manager encrypts stored secrets with KMS and rotates them. The following table summarises the services.
| Service | What it does |
|---|---|
| AWS Key Management Service (KMS) | Create, manage and control encryption keys; integrated with S3, EBS, RDS, DynamoDB and more, so encryption is often one setting; logs key use in CloudTrail |
| AWS CloudHSM | Dedicated, single-tenant hardware security modules for strict compliance |
| AWS Certificate Manager (ACM) | Free public TLS/SSL certificates for ELB and CloudFront, renewed automatically |
| AWS Secrets Manager | Encrypts secrets with KMS and rotates them |
Keys and certificates
Who decides
Many services now encrypt at rest by default, including new S3 objects. Under the shared responsibility model, the customer chooses whether and how to encrypt their data and who may use the keys.
Protecting data from end to end
A medical records website must protect patient data both while it travels and while it is stored:
| Where | Protection | Service |
|---|---|---|
| Browser to website | HTTPS (TLS) with a free certificate that renews itself | AWS Certificate Manager on the load balancer |
| Files in storage | Encryption at rest with a key the company controls | Amazon S3 with AWS KMS |
| Database | Encryption at rest | Amazon RDS with AWS KMS |
| Database password used by the application | Stored encrypted and rotated | AWS Secrets Manager |
| Who used the encryption keys | A log of every key use | AWS CloudTrail |
Encryption is usually a single setting on each service. Under the shared responsibility model, choosing to turn it on, and deciding who may use the keys, is the customer's decision.
Which service creates and manages encryption keys used by other AWS services?
Show answer
AWS Key Management Service (AWS KMS).
Exam Tips
Remember for the exam
- To create and manage encryption keys, use AWS KMS.
- Free public TLS certificates with automatic renewal come from AWS Certificate Manager.
- Dedicated, single-tenant hardware security modules are provided by CloudHSM.
- HTTPS is encryption in transit using TLS.
- Customers decide how to encrypt their data, under the shared responsibility model.