Elastic Load Balancer Security
TLS termination, SNI and SAN certificates, forward secrecy, mutual TLS and WAF on an ALB, plus isolating a compromised target.
The decision: where does TLS terminate on the load balancer, and which control attaches there?
The load balancer is the secure front door. It terminates TLS with certificates from ACM or IAM, can authenticate users, and is the attachment point for AWS WAF. EC2 instances cannot attach WAF directly.
Certificates on a listener
| Item | Detail |
|---|---|
| Default certificate | Exactly one per HTTPS listener. Used when the client sends no SNI hostname or nothing in the list matches |
| Certificate list | Extra certificates for more domains. Enables SNI, which serves several certificates from one listener and one address |
| SNI smart selection | If several certificates match, the ALB prefers ECDSA over RSA, then not expired, stronger hash, longer key, then validity period |
| No fallback | If matching certificates exist but none is compatible with the client, the handshake fails. It does not fall back to the default |
| SAN or wildcard | One certificate can name many domains (Subject Alternative Name) or *.example.com. Wildcard covers one level |
| Sources | ACM (recommended), ACM imports, IAM server certificates. ED25519 keys are not supported on ALB |
| Passthrough | Use a Network Load Balancer or Classic Load Balancer with a TCP listener on 443 to pass encrypted traffic to targets undecrypted |
An imported certificate must be renewed by you. Certificates issued by ACM and deployed on the load balancer renew automatically.
Other security features
| Feature | Detail |
|---|---|
| AWS WAF | Attach a web ACL to an ALB to filter by rules, rates, geo and managed rule groups |
| Security policy | A named TLS policy picks protocols and ciphers. Choose a TLS 1.3 / 1.2 policy such as ELBSecurityPolicy-TLS13-1-2-2021-06 for modern clients |
| Forward secrecy | Use ECDHE cipher suites. Each session gets an ephemeral key discarded afterward, so a stolen long-term key cannot decrypt past traffic |
| Mutual TLS | Listener option. Passthrough (default) forwards client certs to targets. Verify with trust store validates them at the ALB, and rejects expired client certs unless you allow them |
| User authentication | Listener pre-routing action to authenticate through an identity provider, or validate a JWT |
| Security groups | The ALB has its own group. Targets should allow traffic only from it |
Isolating a compromised target
Do this in order.
- Capture metadata and, if needed, take forensic snapshots before changing anything.
- If the instance is in an Auto Scaling group, detach it so the group does not replace or reuse it.
- Deregister it from the target group.
- Replace its security group with a restrictive one that only allows the forensic team.
Exam signal
"Serve several HTTPS domains from one ALB" means SNI with multiple certificates. "Protect EC2 instances with WAF" means put an ALB in front, since EC2 cannot attach WAF.
Exam trap
Perfect forward secrecy is a cipher suite property, not a certificate property. Importing a new certificate does not enable it. Select a security policy that includes ECDHE suites.