Lesson 3 of 4 AWS Security Services

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.

Encryption in transit
ProtectsData moving across networks
HowTLS (the protocol behind HTTPS)
Encryption at rest
ProtectsStored data
HowEncryption keys, mostly managed by KMS
Sort into groups

In transit or at rest?

Exam skills 2.2.4

Decide whether each protection is encryption in transit or at rest.

Log in to try this activity Interactive activities are free with an account.

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.

ServiceWhat 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 CloudHSMDedicated, 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 ManagerEncrypts secrets with KMS and rotates them
Scenario questions

Keys and certificates

Exam skills 2.2.4

Choose the key or certificate service for each requirement.

Log in to try this activity Interactive activities are free with an account.

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.

Worked example

Protecting data from end to end

A medical records website must protect patient data both while it travels and while it is stored:

WhereProtectionService
Browser to websiteHTTPS (TLS) with a free certificate that renews itselfAWS Certificate Manager on the load balancer
Files in storageEncryption at rest with a key the company controlsAmazon S3 with AWS KMS
DatabaseEncryption at restAmazon RDS with AWS KMS
Database password used by the applicationStored encrypted and rotatedAWS Secrets Manager
Who used the encryption keysA log of every key useAWS 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.

Check yourself

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.