AWS in 1 Min · Episode 06

Security Groups vs Network ACLs

Two firewalls, two different jobs. Watch the one-minute video, then read the details.

David Gomez1:11 video · 2 min read

"A firewall is just a firewall." In AWS that is not true. Every VPC gives you two different firewalls, and they work in very different ways. Mix them up and you get one of two problems: traffic that mysteriously fails, or servers that are far more open than you think.

Security Groups: a bouncer at each server's door

A Security Group is attached to a resource, such as an EC2 instance, a load balancer or a database. It decides what can reach that one resource.

  • You only write allow rules. Anything you don't allow is denied.
  • It is stateful. If a request is allowed in, the reply is allowed back out automatically. You never write rules for return traffic.
  • A rule can point at another Security Group instead of an IP range. "The database accepts port 5432 from the app servers' group" stays correct even when the app servers change.

Network ACLs: a checkpoint at the subnet border

A Network ACL (NACL) is attached to a subnet. Every packet entering or leaving that subnet is checked, whatever server it is going to.

  • It has allow and deny rules, evaluated in number order. The first match wins.
  • It is stateless. The reply is checked as a separate packet, so you must also open the return traffic, usually the ephemeral ports 1024–65535.
  • The default NACL allows everything, which is why many teams never touch it.

Which one should you use?

In practice, Security Groups do most of the work. They are precise, easy to reason about, and they follow the resource.

Use a Network ACL for coarse rules across a whole subnet. A typical case is blocking a bad IP range during an incident. Another is adding a second layer that a single misconfigured Security Group can't bypass.

A common mistake is a custom NACL that allows port 443 inbound but forgets the outbound ephemeral ports. Connections open and then hang, and everyone blames the application.

Where AI fits

When a connection fails, the hard part is finding which rule is blocking it: a Security Group, a NACL, a route table or something else in between. AWS Reachability Analyzer traces the path between two resources and names the component that blocks it. The AWS assistant in the console (formerly Amazon Q Developer in the console) can then help you read the result and the rules involved in plain English. That turns a long troubleshooting session into a few minutes. One update: the separate Amazon Q network troubleshooting feature that used to work with Reachability Analyzer was removed in June 2025.

Quick recap

  • Security Groups protect resources, use allow rules only, and are stateful.
  • Network ACLs protect subnets, use allow and deny rules in order, and are stateless.
  • Start with Security Groups. Add NACLs for subnet-wide blocks and defense in depth.
AWS in 1 Min #06 · 1:11

Need an AWS expert on your team?

I'm David, an AWS expert and fractional cloud consultant. I work alongside your team to run your cloud and infrastructure: architecture, security, cost and day-to-day operations. You get senior AWS experience when you need it, without the cost of a full-time hire.

  • Architecture reviews and a clear plan for what to fix first
  • Security hardening: IAM, networking, audits
  • Lower AWS bills without slowing your team down
  • Hands-on help with AI workloads on AWS