Lesson 1 of 5 Encryption in Transit and Certificates

Enforcing Encryption in Transit with TLS

This lesson explains how to require encryption in transit, making unencrypted or weakly encrypted connections impossible rather than merely offering TLS.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe load balancer listener settings for strong TLS.
  • Require TLS at the service level, such as with aws:SecureTransport in bucket policies.
  • Describe how traffic between the nodes of clusters and distributed systems is encrypted.

Load balancers

Load balancers are usually where client connections are encrypted, so their configuration determines the TLS versions and ciphers that clients can use. Old protocol versions, such as TLS 1.0 and 1.1, have known weaknesses and should not be accepted. A load balancer can also re-encrypt traffic to its targets, or pass encrypted traffic through, when encryption is required all the way to the application. The following list describes the relevant settings.

  • Security policies on HTTPS (ALB) and TLS (NLB) listeners set TLS versions and ciphers: allow only TLS 1.2 and 1.3; newer policies add post-quantum hybrid key exchange.
  • An ALB rule redirects HTTP to HTTPS.
  • End to end: HTTPS target groups re-encrypt to targets, or an NLB TCP listener passes TLS through.
True or false

TLS at the load balancer

Exam skills 5.1.1

Check how load balancers enforce TLS.

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

Service-level enforcement

Most services accept both encrypted and unencrypted connections unless configured otherwise, and each has its own setting to require TLS. For S3, a bucket policy denies any request where aws:SecureTransport is false, and can also deny requests where s3:TlsVersion is below 1.2. RDS and Aurora use the parameter rds.force_ssl for PostgreSQL and SQL Server, or require_secure_transport for MySQL, and Redshift uses require_ssl.

API Gateway and CloudFront set a minimum TLS version for clients. SNS and SQS use resource policies with the secure transport condition, and ElastiCache and OpenSearch have in-transit encryption options. The following table summarises the settings.

ServiceSetting
S3Bucket policy denies when aws:SecureTransport is false (and optionally s3:TlsVersion < 1.2)
RDS and Aurorards.force_ssl or require_secure_transport
Redshiftrequire_ssl
API Gateway, CloudFrontMinimum TLS version
SNS, SQSPolicies with secure transport conditions
ElastiCache, OpenSearchIn-transit encryption options

The following diagram shows the control that enforces TLS 1.2 or later at each tier of an application.

Enforcing TLS 1.2 or later at every tier. The bucket policy denies plain HTTP and any TLS version below 1.2, which no allow can override; the load balancer listener uses a TLS 1.3/1.2 security policy; and rds.force_ssl rejects unencrypted database connections.
The scenario is illustrative.
Match the pairs

Requiring TLS service by service

Exam skills 5.1.1

Match each service with the setting that requires encrypted connections.

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

Traffic between nodes

Encryption in transit is often required for all traffic, not only between clients and the application. Clusters and distributed systems exchange data between their own nodes, and that traffic may contain the same sensitive data. Some services encrypt it through configuration, others need TLS in the application or a service mesh, and some EC2 instance types encrypt it in hardware. The following list describes the options for several services.

  • EMR security configurations: TLS between cluster nodes.
  • SageMaker AI inter-container traffic encryption for distributed training.
  • EKS: mutual TLS through a service mesh, or TLS in the app.
  • Supported Nitro instances encrypt traffic between each other automatically (same VPC or peered VPCs in the Region), with no configuration or performance impact.
Match the pairs

Encrypting traffic between nodes

Exam skills 5.1.3

Match each platform with how traffic between its nodes is encrypted.

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

A bucket that refuses old TLS

A compliance standard requires TLS 1.2 or later for every access to customer data. The bucket policy denies any request over plain HTTP or an older TLS version, whoever makes it:

{
  "Version": "2012-10-17",
  "Statement": [
    { "Sid": "DenyInsecureTransport", "Effect": "Deny", "Principal": "*", "Action": "s3:*",
      "Resource": ["arn:aws:s3:::acme-customer-data", "arn:aws:s3:::acme-customer-data/*"],
      "Condition": { "Bool": { "aws:SecureTransport": "false" } } },
    { "Sid": "DenyOldTls", "Effect": "Deny", "Principal": "*", "Action": "s3:*",
      "Resource": ["arn:aws:s3:::acme-customer-data", "arn:aws:s3:::acme-customer-data/*"],
      "Condition": { "NumericLessThan": { "s3:TlsVersion": "1.2" } } }
  ]
}
aws elbv2 modify-listener --listener-arn $HTTPS_LISTENER --ssl-policy ELBSecurityPolicy-TLS13-1-2-2021-06
aws rds modify-db-parameter-group --db-parameter-group-name orders-pg \
  --parameters "ParameterName=rds.force_ssl,ParameterValue=1,ApplyMethod=immediate"

Because these are deny statements, no allow anywhere can override them. The same principle applies at every tier: the load balancer's security policy refuses old protocols, and the database parameter rejects unencrypted connections.

Check yourself

How can an ALB require at least TLS 1.2?

Show answer

By choosing a stricter security policy on its listener.

Exam Tips

Remember for the exam

  • To force HTTPS for all access to a bucket, deny requests where aws:SecureTransport is false.
  • For a minimum of TLS 1.2 on an ALB, choose a stricter security policy.
  • To encrypt traffic between EMR nodes, use a security configuration with in-transit encryption.
  • When database connections must use TLS, set rds.force_ssl or require_secure_transport.
  • For end-to-end TLS through an NLB, use a TCP listener that passes TLS through.