Security Groups vs Network ACLs: Stateful vs Stateless, and Which One SAA-C03 Wants
AWS Solutions Architect Associate · Trade-off

Security Groups vs Network ACLs: Which Firewall the Requirement Needs

A security group is a stateful, allow-only firewall attached to a resource such as an EC2 instance, so replies are let back in automatically. A network ACL is a stateless firewall on a whole subnet, with numbered allow and deny rules where the first match wins. Use security groups by default; use a network ACL when you must deny traffic or cover an entire subnet.

Last updated October 2026.

What they have in common

Both filter traffic by protocol, port and source or destination, and neither costs extra. They are layered: traffic entering a subnet passes the network ACL first, then the security group on the instance, and both must allow it. Neither changes where traffic goes; routing is the route table's job.

Their defaults differ. The default network ACL allows all traffic in and out, while a new security group allows no inbound traffic and all outbound. Out of the box, the security group is the one doing the filtering.

Security groups: stateful, allow-only, per resource

That last feature is why tier-to-tier rules belong in security groups. A network ACL can only name CIDR ranges.

Network ACLs: stateless, numbered, per subnet

Troubleshooting signal: requests reach the server but replies never return to the client. That is almost always a network ACL missing its outbound ephemeral-port rule. A security group cannot cause it, because security groups are stateful.

Side by side

 Security groupNetwork ACL
ScopeResource (network interface)Whole subnet
RulesAllow onlyAllow and deny
EvaluationAll rules, any allow passesLowest number first, first match wins
Return trafficAutomatic (stateful)Needs its own rule (stateless)
SourcesCIDRs, prefix lists, other security groupsCIDRs only

From the Amazon VPC user guide, checked 23 October 2026.

Which one the exam wants

Security group when...

The requirement is "only this tier may talk to that tier", names specific instances or databases, involves sources that change as things scale, or asks for least privilege without managing return ports.

Network ACL when...

You must deny something, such as a hostile IP range; one rule must cover every resource in a subnet; or you want a subnet-wide guardrail in case an instance launches with the wrong security group.

The classic pair of questions tests both directions. "App servers in an Auto Scaling group must reach the database, and IPs keep changing" is a security group that references the app tier's group. "Block 198.51.100.0/24 from every instance in the public subnets now" is a network ACL deny rule numbered below the 443 allow. A deny rule in a security group is never right: security groups cannot deny.

FAQ

What is the difference between a security group and a network ACL?

A security group is a stateful, allow-only firewall attached to a resource; a network ACL is a stateless firewall on a subnet with numbered allow and deny rules. Security groups let replies back in automatically, while a network ACL needs explicit rules for return traffic.

Can a security group deny traffic?

No. Security groups support allow rules only. To block a specific IP range, use a network ACL deny rule with a lower rule number than any allow rule it must override.

Why do network ACLs need ephemeral port rules?

Because network ACLs are stateless. The response to an allowed request goes back to a random high port on the client, and without an outbound rule covering that range the reply is dropped.

Which is evaluated first, the network ACL or the security group?

For inbound traffic, the subnet's network ACL is evaluated first, then the security group on the instance. Both must allow the traffic for it to arrive.

Learn it with the step-through diagrams

Chapter 10 of the Certified SAA-C03 course builds the tier chain and the ephemeral-port failure one step at a time, with two exam-style questions. Unit 1 is free.

Open Chapter 10 →