Comparison lab
Security groups vs network ACLs
Security groups remember connections; subnet ACLs check both directions.
Picture the difference
Packet → subnet boundary (network ACL) → network interface (security group); only the security group tracks the connection
| Option | What it does | Exam clue | When not to use it |
|---|---|---|---|
| Security groups | Use stateful, allow-only filtering on resources or their network interfaces. | stateful, allow rules, network interface, security group reference | There is no explicit deny rule in a security group. Multiple attached groups combine their allows rather than restricting one another. |
| Network access control lists | Apply stateless allow and deny rules at the subnet boundary. | stateless, subnet, ordered rules, explicit deny, ephemeral ports | Allowing inbound traffic does not automatically allow its response. A network ACL is not a per-instance control. |
Decision tree
- Set allow-only rules on a resource network interface with automatic return traffic Security groups
- 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.