Bitzu

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

Single choice

Which statement correctly describes security groups?

  1. They are stateless and support explicit deny rules
  2. They are stateful and support allow rules only
  3. They apply to whole subnets and are evaluated by rule number
  4. 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.

Select all that apply

Which statements are true about network ACLs?

  1. They are stateless, so return traffic needs its own rule
  2. They can contain both allow and deny rules
  3. Rules are evaluated starting with the lowest rule number
  4. They are attached to individual network interfaces
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More SAA-C03 topics in this module