AWSCloud Visual Academy

Comparison lab

Security groups vs network ACLs

Security groups remember connections; subnet ACLs check both directions.

All comparisons

Picture the difference

Packet → subnet boundary (network ACL) → network interface (security group); only the security group tracks the connection

OptionWhat it doesExam clueWhen not to use it
Security groupsUse stateful, allow-only filtering on resources or their network interfaces.stateful, allow rules, network interface, security group referenceThere is no explicit deny rule in a security group. Multiple attached groups combine their allows rather than restricting one another.
Network access control listsApply stateless allow and deny rules at the subnet boundary.stateless, subnet, ordered rules, explicit deny, ephemeral portsAllowing inbound traffic does not automatically allow its response. A network ACL is not a per-instance control.

Decision tree

  1. Set allow-only rules on a resource network interface with automatic return traffic Security groups
  2. Apply numbered allow and deny rules at the subnet boundary in both directions Network access control lists

If none of these clues fit, check the exact requirement before choosing.