Lesson 2 of 3 Encryption in Transit and Secrets Management

Enforcing Encryption in Transit at Each Hop

This lesson explains how encryption in transit is configured, and often enforced, at each hop from client to edge, load balancer, target, data store and AWS APIs.

Learning outcomes

After completing this lesson, you will be able to:

  • Configure TLS on load balancers and CloudFront.
  • Require TLS with policies and parameters.
  • Explain encryption for private and hybrid connections.

Load balancers and CloudFront

An ALB terminates HTTPS on its listener with an ACM certificate and a security policy that defines allowed TLS versions and ciphers; choose a policy that supports TLS 1.2 and 1.3 only, such as ELBSecurityPolicy-TLS13-1-2-2021-06, or a FIPS or post-quantum variant when required. An HTTP listener with a redirect action to HTTPS ensures clients use TLS. Traffic from the ALB to targets can use HTTPS target groups for end-to-end encryption. An NLB can terminate TLS with a TLS listener or pass it through with a TCP listener so the targets terminate it. CloudFront's viewer protocol policy (Redirect HTTP to HTTPS or HTTPS only) protects the viewer connection, the origin protocol policy protects the origin connection, and a minimum TLS version is set on the distribution.

Requiring TLS with policies and parameters

Several services can reject unencrypted connections. An S3 bucket policy denies requests where aws:SecureTransport is false, and can require a minimum TLS version with s3:TlsVersion. RDS for PostgreSQL uses the parameter rds.force_ssl=1, RDS for MySQL require_secure_transport=ON and SQL Server rds.force_ssl; clients need the RDS certificate authority bundle, and certificate authority rotations require updating client trust stores. ElastiCache supports in-transit encryption chosen at creation (or enabled on existing Valkey and Redis OSS clusters), and EFS mounts with the tls option through amazon-efs-utils. SQS and SNS can deny non-TLS requests with aws:SecureTransport conditions.

{
  "Sid": "DenyInsecureTransport",
  "Effect": "Deny",
  "Principal": "*",
  "Action": "s3:*",
  "Resource": ["arn:aws:s3:::acme-data", "arn:aws:s3:::acme-data/*"],
  "Condition": {"Bool": {"aws:SecureTransport": "false"}}
}

The following diagram shows each control refusing a plain connection.

Making services reject unencrypted connections. An S3 bucket policy denies requests where aws:SecureTransport is false and can require a minimum TLS version. RDS parameters such as rds.force_ssl for PostgreSQL and require_secure_transport for MySQL refuse plain connections, and clients need the current RDS certificate authority bundle.
After a CA rotation, clients with an outdated bundle fail even though TLS is in use.
Match the pairs

Requiring TLS

Exam skills 4.2.3

Match each service with the setting that requires encrypted connections.

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

Private and hybrid connections

Traffic between VPCs over peering or Transit Gateway inside AWS is encrypted at the physical layer between AWS facilities on supported instance types, but applications should still use TLS for sensitive data. Site-to-Site VPN and Client VPN encrypt traffic with IPsec and TLS respectively. The following table summarises the enforcement points.

HopEnforcement
Browser to CloudFrontViewer protocol policy HTTPS only or redirect; minimum TLS version
CloudFront to originOrigin protocol policy HTTPS only
Client to ALBHTTPS listener, TLS 1.2+ security policy, HTTP-to-HTTPS redirect
ALB to targetHTTPS target group
Application to S3Bucket policy aws:SecureTransport and s3:TlsVersion
Application to RDSrds.force_ssl / require_secure_transport and CA bundle
On premises to VPCSite-to-Site VPN (IPsec) or Client VPN (TLS)
Worked example

Failing database connections after a CA rotation

After an RDS certificate authority update, several Java applications fail to connect with PKIX path building failed, while others work. The failing applications pin the old RDS root certificate in their trust stores. The team downloads the current RDS global CA bundle, updates the trust stores through the deployment process, and adds a reminder to check AWS Health events for future CA expiry notices. Disabling TLS would have restored connectivity but violated the requirement to encrypt in transit.

Check yourself

Which policy condition denies unencrypted requests to an S3 bucket?

Show answer

aws:SecureTransport set to false in a Deny statement.

Exam Tips

Remember for the exam

  • Use HTTPS listeners with TLS 1.2+ security policies and redirect HTTP to HTTPS.
  • Deny aws:SecureTransport false in S3, SQS and SNS policies.
  • Force TLS on RDS with rds.force_ssl or require_secure_transport; clients need the CA bundle.
  • CloudFront has separate viewer and origin protocol policies.