"Allow the request, and the reply gets through." With a security group, yes. With a network ACL, no. A network ACL keeps no memory of the traffic it has seen, so the reply is checked as if it were a brand-new packet. Forget that, and connections open and then hang.
What a network ACL is
A network ACL (NACL) is a firewall at the subnet border. Every subnet is associated with exactly one, and one network ACL can serve several subnets. It checks traffic as it enters and leaves the subnet, not traffic between two servers inside the same subnet.
Stateless means each packet is judged alone, inbound and outbound. Allowing a request in does not allow the response out. That is the opposite of security groups, which are stateful.
Numbered rules, first match wins
A network ACL has an inbound list and an outbound list. Each rule has a number and either allows or denies.
- Rules are evaluated from the lowest number up.
- The first rule that matches is applied, and the rest are ignored.
- If nothing matches, a final rule marked with an asterisk denies the packet. You can't remove it.
Order therefore matters. A deny for a bad range must have a lower number than the allow it should override. AWS suggests numbering in steps, such as 100, 110, 120, so you can insert rules later.
Open the return traffic
For every rule you add, something must allow the response in the other direction. Responses don't go to port 443. They go to the client's ephemeral port, a temporary high port chosen by the client's operating system.
For a public web server that means:
- Inbound: allow TCP 443 from the internet.
- Outbound: allow TCP to the ephemeral ports, so replies can leave.
The exact range depends on the client. Many Linux kernels use 32768–61000, and Elastic Load Balancing and NAT gateways use 1024–65535. To cover all clients, AWS notes that you can open 1024–65535.
The classic mistake is a custom network ACL with a tidy inbound list and no outbound ephemeral rule. Everyone then blames the application.
Default and custom
- The default network ACL that comes with a VPC allows all inbound and outbound traffic. That's why many teams never notice it.
- A custom network ACL denies everything until you add rules.
There is also a quota: 20 rules per direction by default, adjustable up to 40. A network ACL is for a few broad rules, not long lists.
When to use one
Security groups do most of the work. A network ACL is a second layer, and it can do one thing a security group can't: deny. A single deny rule blocks an address range for every resource in the subnet, whatever their security groups say.
Where AI fits
AI crawlers and scrapers can hit a site hard enough to hurt it. If the traffic comes from a known address range, a network ACL deny rule on the public subnets stops it quickly.
It has limits. Crawlers change addresses, a network ACL only understands IP ranges and ports, and the rule quota is small. If your servers sit behind CloudFront, the subnet sees CloudFront's addresses, not the crawler's.
So pair it with AWS WAF Bot Control. It categorizes known AI bots and labels the requests, and you write rules to allow the bots you want and block or rate-limit the others.
Quick recap
- Network ACLs are stateless: every packet is checked alone, in and out.
- Rules run in number order, and the first match wins.
- Always open the return traffic, and use deny rules as a second layer, not as your only defence.