Review ELB transport encryption

Check encryption for client and backend connections separately.

Description

Check the protocol on each side of the Classic Load Balancer. HTTP is unencrypted even on port 443. A TCP listener can also pass TLS through to a backend that terminates it.

Potential impact

Credentials and requests can be read or altered on any unencrypted segment.

Remediation

If TLS terminates at the ELB, set Protocol to HTTPS or SSL and attach a server certificate and TLS policy. For an encrypted backend, choose an InstanceProtocol and port the server supports and test both connections. Configure a backend authentication policy if the ELB must verify the backend certificate.

Examples

The excerpts omit the networking and TLS policies. Supply the actual server certificate ARN.

Before

yaml
Resources:
  MyLoadBalancer:
    Type: AWS::ElasticLoadBalancing::LoadBalancer
    Properties:
      Listeners:
        - InstancePort: "80"
          InstanceProtocol: HTTP
          LoadBalancerPort: "443"
          Protocol: HTTP

After

yaml
Resources:
  MyLoadBalancer:
    Type: AWS::ElasticLoadBalancing::LoadBalancer
    Properties:
      Listeners:
        - InstancePort: "80"
          InstanceProtocol: HTTPS
          LoadBalancerPort: "443"
          Protocol: HTTPS
          SSLCertificateId: arn:aws:iam::123456789012:server-certificate/my-server-certificate

The second listener uses HTTPS on both connections. Its InstancePort is still 80, so the backend must serve HTTPS there. Otherwise, set the port on which the backend accepts HTTPS.

References