How to associate load balancer with ACL in AWS

access-control-listamazon-web-servicesload balancing

I read this http://docs.aws.amazon.com/waf/latest/developerguide/web-acl.html

I read that ACL can be associated with a cloudfront as well as with load balancer.

I could find the tutorial for cloudfront http://docs.aws.amazon.com/waf/latest/developerguide/tutorials-rate-based-blocking.html

But i am unable to find any tutorial for associating ACL with load balancer.
Nor i could find any option on AWS console UI for the same.

Any help.

Best Answer

Load balancers need subnets to run, you can set up NACL's at the subnet level for each subnet that ELB is provisioned with. But if you're already using AWS WAF in front of your ALB why do you need to setup NACL at that level? If you're using Cloudfront in front of the ALB's you can setup your ALB security groups to only be accessabile from Cloudfront IP address ranges using this aws labs code

  • Your VPC automatically comes with a modifiable default network ACL. By default, it allows all inbound and outbound IPv4 traffic and, if applicable, IPv6 traffic.

  • You can create a custom network ACL and associate it with a subnet. By default, each custom network ACL denies all inbound and outbound traffic until you add rules.

  • Each subnet in your VPC must be associated with a network ACL. If you don't explicitly associate a subnet with a network ACL, the subnet is automatically associated with the default network ACL.

  • You can associate a network ACL with multiple subnets; however, a subnet can be associated with only one network ACL at a time. When you associate a network ACL with a subnet, the previous association is removed.

  • A network ACL contains a numbered list of rules that we evaluate in order, starting with the lowest numbered rule, to determine whether traffic is allowed in or out of any subnet associated with the network ACL. The highest number that you can use for a rule is 32766. We recommend that you start by creating rules with rule numbers that are multiples of 100, so that you can insert new rules where you need to later on.

  • A network ACL has separate inbound and outbound rules, and each rule can either allow or deny traffic.

  • Network ACLs are stateless; responses to allowed inbound traffic are subject to the rules for outbound traffic (and vice versa).

http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html