AWS Builder Center
Encrypting Data at Rest and in Transit on AWS

Encrypting Data at Rest and in Transit on AWS

The difference between encryption at rest and in transit, and how AWS handles both.

Series: AWS Security 30 Days, 30 Articles Challenge (31 articles)

  1. …
  2. 11
    Encrypting Data at Rest and in Transit on AWS This article
Welcome to Day 10 of the 30 Days AWS Security Challenge. Yesterday we covered KMS and how it manages encryption keys. Today we zoom out and look at the bigger picture: the two states your data lives in, at rest and in transit, and what encrypting each one actually means in practice.

Two States, Two Different Problems

Data spends its life either sitting somewhere, like in a database or a storage bucket, or moving somewhere, like between your application and a user's browser. These are called data at rest and data in transit, and each one needs its own kind of protection, because each one is vulnerable in a different way.
Data at rest is at risk if someone gains unauthorized access to the storage itself, like a stolen disk or an exposed backup. Data in transit is at risk if someone intercepts it while it travels across a network, sometimes called a man in the middle attack. Encrypting one does not automatically protect the other, which is why both need attention.

Encrypting Data at Rest

Data at rest encryption means data is scrambled while it is sitting in storage, using a key from KMS as we discussed yesterday. Even if someone somehow gained direct access to the underlying storage, without the key, what they would find is unreadable.
Most AWS storage services support this with a simple toggle:
  • S3: enable default encryption on the bucket, using either an AWS managed key or your own customer managed key
  • EBS volumes: enable encryption when creating the volume, and AWS handles the rest transparently
  • RDS databases: enable encryption at creation time, since some database engines don't allow adding it after the fact
  • DynamoDB: encrypted by default using an AWS owned key, with the option to switch to a customer managed key for more control
A useful habit is checking this box every time you create a new resource, rather than treating encryption as something to add later. For some services, like RDS, adding it later means recreating the resource entirely.

Encrypting Data in Transit

Data in transit encryption protects data while it moves between two points, like from a user's browser to your application, or between two services inside your own architecture. This is almost always done using TLS, the same technology behind the padlock icon in a web browser.
Some practical ways this shows up on AWS:
  • Enforcing HTTPS on anything public facing, like a load balancer or API Gateway endpoint, instead of allowing plain HTTP
  • Requiring TLS connections when applications connect to an RDS database, rather than allowing unencrypted connections
  • Using TLS for internal service to service communication, not just for traffic reaching the public internet
A common mistake is assuming that because traffic stays "inside AWS," it does not need encryption. Internal traffic can still be intercepted in certain scenarios, and enforcing TLS everywhere is a low cost habit that removes that risk entirely.

A Practical Example

Say you are running a web application behind an Application Load Balancer, backed by an RDS database. A solid baseline setup looks like this: the load balancer only accepts HTTPS connections using a certificate from AWS Certificate Manager (which we'll cover on Day 24), the RDS database has storage encryption enabled from creation, and the application enforces an SSL connection when talking to that database rather than allowing a fallback to plain text.
With that in place, data is protected both while it sits in the database and while it moves between every part of the system.

Checking Your Own Setup

A few places worth checking today: open S3 > your buckets and confirm default encryption is on, open RDS > your databases and check the encryption status, and review any load balancer listener rules to confirm HTTP requests are redirected to HTTPS rather than served directly.

Key Takeaways

  • Data at rest and data in transit face different risks and need separate protection
  • Encryption at rest protects stored data using a KMS key, and should be enabled at creation time where possible
  • Encryption in transit relies on TLS, protecting data as it moves across any network, including inside AWS
  • Don't assume internal AWS traffic is automatically safe without TLS
  • Build encryption into your setup from the start rather than treating it as something to bolt on later
Tomorrow we move from encrypting data to protecting the secrets that unlock it, like passwords and API keys, comparing AWS Secrets Manager against Parameter Store.

Series: AWS Security 30 Days, 30 Articles Challenge (31 articles)

  1. …
  2. 11
    Encrypting Data at Rest and in Transit on AWS This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article