Bitzu

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

Single choice

Which VPC firewall feature operates at the subnet level?

  1. Security group
  2. Network ACL
  3. IAM policy
  4. 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.

Select all that apply

Which statements describe security groups?

  1. Return traffic is allowed automatically
  2. They contain allow rules only
  3. Rules are checked in ascending number order
  4. They apply to a whole subnet automatically
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More CLF-C02 topics in this module