CLF-C02 ยท Network services
Security groups vs network ACLs
Stateful security groups at the instance level versus stateless network ACLs at the subnet level, allow and deny rules, and Amazon Inspector network reachability.
Key points
- Security group: instance level, allow rules only, checks all rules, stateful (return traffic allowed automatically).
- Network ACL: subnet level, allow and deny rules, checks rules in number order until one matches, stateless (return traffic must be allowed explicitly).
- Security groups are the main control; NACLs add a coarse second layer.
- Amazon Inspector network reachability findings: EC2 ports open to paths such as an internet gateway.
Source: https://docs.aws.amazon.com/vpc/latest/userguide/infrastructure-security.html
Practice questions
Which VPC firewall feature operates at the subnet level?
- Security group
- Network ACL
- IAM policy
- Internet gateway
Show answer
Answer: B. Network ACL
A network ACL is associated with subnets and applies to every instance in them. A security group is attached at the instance level.
Which statements describe security groups?
- Return traffic is allowed automatically
- They contain allow rules only
- Rules are checked in ascending number order
- They apply to a whole subnet automatically
- They can explicitly deny one IP address
Show answer
Answer: A. Return traffic is allowed automatically, B. They contain allow rules only
Security groups are stateful, so replies to allowed traffic flow back automatically, and they contain allow rules only. Numbered rules evaluated in order, subnet-wide scope and explicit deny rules are all properties of network ACLs.
If a network ACL inbound rule lets a request in, the network ACL automatically lets the response back out.
Show answer
Answer: False
False. Network ACLs are stateless: return traffic must be allowed explicitly by an outbound rule. Automatic return traffic is a feature of stateful security groups.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
