Security Group vs NACL: which one filters what?

A security group is a stateful filter attached to a network interface; a network ACL is a stateless filter at the subnet boundary. The two layers complement each other rather than replace each other.

Compare by characteristic

CharacteristicSecurity groupNetwork ACL
Where it appliesThe network interface of a resource such as an EC2 instanceEvery subnet it is associated with
Connection stateStateful: return traffic is allowed automaticallyStateless: rules are needed for both directions
Rule typesAllow rules onlyBoth allow and deny rules
How rules are evaluatedAll rules are evaluatedRules are evaluated in number order and the first match applies

When to use which

Use security groups as the primary control for each application, for example letting only the web tier reach the database tier on the needed port. Add a network ACL when you must explicitly block an address range at the subnet level, because only network ACLs support deny rules. Because network ACLs are stateless, remember to allow the ephemeral ports used by return traffic.

  • A security group denies inbound traffic that is not explicitly allowed.
  • The default network ACL of a VPC allows all traffic; a newly created custom network ACL denies everything until you add rules.

Check your understanding

If a scenario says “block a specific IP address”, think network ACL because a deny rule is needed. If it says “only the application tier may connect to the database”, think security group, often referencing another security group as the source.

References

Use AWS documentation to check current features and limits. Cloud Quest is an independent learning project and does not guarantee exam outcomes.

Continue learning

Learn AWS and prepare for SAA-C03

Read the guide →

A practical SAA-C03 study roadmap

Read the guide →

Free AWS SAA-C03 practice questions

Read the guide →

Practice AWS concepts with simulated labs

Read the guide →

AWS glossary

Explore services and concepts →

Put your understanding into practice

Sign in to learn, review and save progress. Tool access depends on account status.

Sign in to learn