Skip to Content
Asterrr's Handbook
3 · Infrastructure security

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.

VPCPrivate subnetsTLS + SNIinspectscertforwardTargetsALB HTTPSlistenerBrowserAWS WAF web ACLCertificates(SNI list)
WAF inspects requests at the ALB. The listener picks a certificate by SNI hostname, then forwards to private targets.

Certificates on a listener

ItemDetail
Default certificateExactly one per HTTPS listener. Used when the client sends no SNI hostname or nothing in the list matches
Certificate listExtra certificates for more domains. Enables SNI, which serves several certificates from one listener and one address
SNI smart selectionIf several certificates match, the ALB prefers ECDSA over RSA, then not expired, stronger hash, longer key, then validity period
No fallbackIf matching certificates exist but none is compatible with the client, the handshake fails. It does not fall back to the default
SAN or wildcardOne certificate can name many domains (Subject Alternative Name) or *.example.com. Wildcard covers one level
SourcesACM (recommended), ACM imports, IAM server certificates. ED25519 keys are not supported on ALB
PassthroughUse 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

FeatureDetail
AWS WAFAttach a web ACL to an ALB to filter by rules, rates, geo and managed rule groups
Security policyA 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 secrecyUse ECDHE cipher suites. Each session gets an ephemeral key discarded afterward, so a stolen long-term key cannot decrypt past traffic
Mutual TLSListener 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 authenticationListener pre-routing action to authenticate through an identity provider, or validate a JWT
Security groupsThe ALB has its own group. Targets should allow traffic only from it

Isolating a compromised target

Do this in order.

  1. Capture metadata and, if needed, take forensic snapshots before changing anything.
  2. If the instance is in an Auto Scaling group, detach it so the group does not replace or reuse it.
  3. Deregister it from the target group.
  4. 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.

Further reading

On this page