Interview Prep/AWS/VPC and Networking

What is the difference between a security group and a network ACL, and when would you touch NACLs?

BeginnerScenarioVPC and Networking
Answer

Situation read → SGs are stateful and attach to ENIs; NACLs are stateless and attach to subnets.

What I'd do →

  1. Default to SGs for all allow rules
  2. Use NACLs for coarse subnet-wide denies such as blocking a hostile CIDR
  3. Remember NACL rules need both inbound and outbound with ephemeral ports 1024-65535
  4. Inspect: aws ec2 describe-network-acls --filters Name=vpc-id,Values=vpc-0abc

Why → SG rules are allow-only, NACLs support explicit deny and are evaluated in rule-number order.

Interview tip → State the "stateful vs stateless" contrast first.

aws All AWS questions Roadmap: AWS core services

More on VPC and Networking