Interview Prep/Networking/Security: Firewalls, SGs, NACLs & VPN

Security group versus NACL: explain the differences.

BeginnerScenarioSecurity: Firewalls, SGs, NACLs & VPN
Answer

Situation read → One of the most common interview questions; the key is stateful versus stateless.

What I'd do →

  1. Security groups attach to ENIs, are stateful, support only allow rules and evaluate all rules together
  2. NACLs attach to subnets, are stateless, support allow and deny, and evaluate rules in number order
  3. With a NACL you must allow return traffic yourself, including ephemeral ports 1024-65535
  4. Use SGs for normal access control and NACLs as a coarse subnet-level backstop or to block a bad IP
  5. Inspect with aws ec2 describe-network-acls

Why → Statefulness means SG return traffic is automatic, while a NACL treats each packet independently.

Interview tip → Say NACLs are rarely the first tool; you use them for explicit denies.

All Networking questions Roadmap: Networking for DevOps

More on Security: Firewalls, SGs, NACLs & VPN