SAA-C03 ยท Network security in the VPC
Security groups versus network ACLs
Stateful instance-level security groups versus stateless subnet-level network ACLs, allow and deny rules, rule ordering and referencing security groups.
Key points
- Security group: on instances (network interfaces), allow only, stateful (return traffic automatic), all rules evaluated together, can reference other security groups.
- Network ACL: on subnets, allow and deny, stateless (return traffic, usually ephemeral ports, needs a rule), lowest number first, first match wins.
- One network ACL per subnet.
- Security groups: main control; network ACLs: coarse guard rails, e.g. denying a bad address range.
Source: https://docs.aws.amazon.com/vpc/latest/userguide/infrastructure-security.html
Practice questions
Which statement correctly describes security groups?
- They are stateless and support explicit deny rules
- They are stateful and support allow rules only
- They apply to whole subnets and are evaluated by rule number
- They are stateful and evaluate deny rules before allow rules
Show answer
Answer: B. They are stateful and support allow rules only
Security groups are stateful and contain allow rules only; anything not allowed is dropped. Deny rules, subnet-level scope and numbered rule order are all traits of network ACLs.
Which statements are true about network ACLs?
- They are stateless, so return traffic needs its own rule
- They can contain both allow and deny rules
- Rules are evaluated starting with the lowest rule number
- They are attached to individual network interfaces
- Rules can use a security group ID as the source
Show answer
Answer: A. They are stateless, so return traffic needs its own rule, B. They can contain both allow and deny rules, C. Rules are evaluated starting with the lowest rule number
Network ACLs are stateless, can allow or deny, and are evaluated from the lowest rule number with the first match applied. They are attached to subnets, not network interfaces, and referencing other security groups is a security group feature.
If a security group allows inbound HTTPS, you must also add an outbound rule so the responses can leave the instance.
Show answer
Answer: False
False. Security groups are stateful: responses to allowed inbound traffic are permitted automatically, whatever the outbound rules say. The separate return rule is needed in network ACLs, which are stateless.
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.
