Which statement correctly describes the main difference between Security Groups and Network ACLs (NACLs) in AWS?
Think about where each one applies and whether they remember previous traffic.
Security Groups are stateful and attached to instances, meaning they remember traffic and automatically allow return traffic. NACLs are stateless and apply to subnets, so return traffic must be explicitly allowed.
You want to protect a public subnet in your VPC from unwanted inbound traffic but allow all outbound traffic. Which AWS feature should you configure primarily to block unwanted inbound traffic efficiently?
Consider which feature applies at the subnet level and can block traffic before it reaches instances.
NACLs operate at the subnet level and can block unwanted inbound traffic before it reaches instances. Security Groups control traffic at the instance level but cannot block traffic before it reaches the subnet.
You have a NACL that allows inbound HTTP (port 80) traffic but does not explicitly allow outbound HTTP traffic. What will happen when a client tries to access a web server in the subnet?
Remember that NACLs are stateless and require explicit rules for both inbound and outbound traffic.
NACLs do not remember traffic state, so if outbound HTTP traffic is not allowed explicitly, the return traffic will be blocked, causing the client to not receive responses.
Which approach best follows AWS security best practices for controlling traffic to instances in a public subnet?
Think about defense in depth and where each control is applied.
Best practice is to use NACLs as a coarse filter at the subnet level and Security Groups as fine-grained controls at the instance level, providing layered security.
You have a Security Group that allows inbound SSH (port 22) from anywhere and a NACL that denies inbound SSH from all IPs. What will be the result when you try to SSH into an instance in that subnet?
Consider the order in which AWS processes NACLs and Security Groups.
NACLs are evaluated before Security Groups. If a NACL denies traffic, it is blocked before reaching the instance, regardless of Security Group rules.