AWS Security Group and NACL Practice
Unlimited AWS security group and network ACL practice. Each problem gives one request and the rules of the subnet's network ACL and the instance's security group: decide if the request gets through, if the reply gets back, and what decides it. A wrong answer names the slip, such as forgetting that a network ACL is stateless, so the reply needs a rule of its own.
Network ACL inbound
Network ACL outbound
Security group inbound
Security group outbound
1. The request
2. The reply
3. What decides it
Addresses and rules are invented. The instance has this one security group, and its subnet has this network ACL. The other end is outside the subnet. A rule's port range is the port the packet is going to.
AWS exam prep
The SAA-C03 exam guide lists designing VPC architectures with security components such as security groups and network ACLs. Start with the free real exam questions, then get the full pack.
SG and NACL FAQ
What is the difference between a security group and a network ACL?
A security group works at the instance level, has allow rules only, evaluates all of its rules before deciding, and is stateful: return traffic is allowed automatically. A network ACL works at the subnet level, has allow and deny rules, evaluates them in ascending order until one matches, and is stateless: return traffic must be explicitly allowed.
Why does the request get in but the reply never arrive?
Usually because of the network ACL. It is stateless, so a rule that allows inbound traffic does not allow the responses to it. The AWS guide says that for every rule you add, there must be an inbound or outbound rule that allows response traffic.
Which port does the reply go to?
The port the client sent the request from, called an ephemeral port. The client chooses it, and the range depends on its operating system: the AWS guide lists 32768 to 61000 for many Linux kernels, 49152 to 65535 for Windows Server 2008 and later, and 1024 to 65535 for a NAT gateway. To cover the different types of clients you can open 1024 to 65535. Each problem here states the port.
Do I need an outbound security group rule for the reply?
No. Security groups are stateful: responses to allowed inbound traffic are allowed to leave the instance, regardless of the outbound rules. In the same way, the response to a request the instance sent is allowed to reach it regardless of the inbound rules.
In what order are network ACL rules evaluated?
Starting with the lowest numbered rule. As soon as a rule matches the traffic it is applied, regardless of any higher numbered rule that might contradict it, and no further rules are evaluated.
Can a higher numbered deny rule override a lower numbered allow rule?
No. The first match is applied. If you want to deny some ports inside a wider range that you allow, the AWS guide says to give the deny rule a lower number than the rule that allows the wider range.
What does the * rule in a network ACL do?
Each network ACL has an inbound and an outbound rule whose rule number is an asterisk. If a packet does not match any of the numbered rules, the * rule denies it. You cannot delete it.
Can a security group deny traffic?
Not with a rule. You can specify allow rules, but not deny rules. Traffic that no rule allows does not get through: a new security group has no inbound rules, so no inbound traffic is allowed until you add some, and a security group with no outbound rules allows no outbound traffic.
Does a network ACL filter traffic between two instances in the same subnet?
No. Network ACL rules are evaluated when traffic enters and leaves the subnet, not as it is routed within a subnet. In this drill the other end is always outside the subnet.
What does the default network ACL allow?
Everything. A default network ACL is configured to allow all traffic to flow in and out of the subnets it is associated with: rule 100 allows all traffic in each direction, ahead of the * rule.
What if an instance has more than one security group?
The rules from each security group are aggregated to form a single set of rules that are used to determine whether to allow access. Every problem in this drill has one security group.
How do I check this on a real VPC?
Use Reachability Analyzer, a static configuration analysis tool from AWS. It gives hop by hop details of the path between two resources when they are reachable and identifies the blocking component otherwise, for example a missing network ACL rule.
Sources
- Amazon VPC User Guide, Control subnet traffic with network access control lists: inbound and outbound rules, numbered rules evaluated from the lowest number, the first match applied, evaluated when traffic enters and leaves the subnet, stateless.
- Amazon VPC User Guide, Network ACL rules: the parts of a rule (rule number, protocol, port range, source or destination, allow or deny) and giving a deny rule the lower number.
- Amazon VPC User Guide, Custom network ACLs for your VPC: the * rule, the example inbound and outbound rules, the rule that response traffic needs, and the Ephemeral ports section (the client chooses the port, the ranges by operating system, 1024 to 65535).
- Amazon VPC User Guide, Default network ACL for a VPC: the default rules.
- Amazon VPC User Guide, Control traffic to your AWS resources using security groups: stateful, responses allowed regardless of the rules of the other direction.
- Amazon VPC User Guide, Security group rules: allow rules only, no inbound traffic until a rule is added, the parts of a rule, the /32 prefix for one address, several security groups aggregated.
- Amazon VPC User Guide, Infrastructure security in Amazon VPC: the table that compares security groups and network ACLs.
- AWS Certified Solutions Architect Associate (SAA-C03) exam guide, Domain 1: Design Secure Architectures: "Designing VPC architectures with security components (for example, security groups, route tables, network ACLs, NAT gateways)".
- Checked 21 November 2026. The tool's own approach: problems are invented; every packet is TCP over IPv4; the instance has one security group and the other end is outside the subnet. IPv6, prefix lists, security group references and problems where both layers would block the same request are left out. When the request and the reply both pass, the drill asks for the network ACL rule that allows the reply. "SG inbound: no match" is the drill's wording for a security group in which no inbound rule matches. An independent re-solver (Python, a port table painted from the highest rule number down) agreed with the drill on 20,000 generated problems.
Checked 21 November 2026 against the Amazon VPC User Guide and the AWS SAA-C03 exam guide.
- DrillAWS IAM policy evaluation practiceDecide if a request is allowed or denied across identity policies, bucket policies, SCPs and permissions boundaries, and pick what decides it.
- DrillAWS route priority practiceTap the route a VPC route table, virtual private gateway or transit gateway uses for a packet.
- DrillAWS Lambda concurrency practiceWork out the concurrency a function needs, the most you can reserve and whether it is throttled.