Bird
Raised Fist0
AWScloud~20 mins

Stateless behavior of NACLs in AWS - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
NACL Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Stateless Nature of NACLs

Network Access Control Lists (NACLs) in AWS are stateless. What does this mean for the traffic flow?

ANACLs automatically allow return traffic without explicit rules.
BNACLs block all traffic by default and cannot be modified.
CNACLs maintain session state to track connections.
DNACLs require explicit inbound and outbound rules for traffic to flow both ways.
Attempts:
2 left
💡 Hint

Think about how a stateless firewall treats incoming and outgoing packets separately.

service_behavior
intermediate
2:00remaining
Effect of Missing Outbound Rule in NACL

You have a NACL with an inbound rule allowing HTTP (port 80) traffic. There is no outbound rule allowing return traffic. What will happen when a client tries to access a web server behind this NACL?

AThe client will connect but will not receive any response.
BThe client will successfully connect and receive responses.
CThe client connection will be blocked at the inbound rule.
DThe NACL will automatically allow outbound return traffic.
Attempts:
2 left
💡 Hint

Remember that NACLs are stateless and require explicit outbound rules.

Configuration
advanced
2:00remaining
NACL Rules for Bidirectional SSH Access

You want to configure a NACL to allow SSH (port 22) access to an EC2 instance and allow the instance to respond back. Which set of rules correctly achieves this?

AInbound: Allow TCP port 22; Outbound: Allow TCP port 22
BInbound: Allow ephemeral ports (1024-65535); Outbound: Allow TCP port 22
CInbound: Allow TCP port 22; Outbound: Allow ephemeral ports (1024-65535)
DInbound: Allow all traffic; Outbound: Deny all traffic
Attempts:
2 left
💡 Hint

Think about how return traffic uses ephemeral ports.

security
advanced
2:00remaining
Security Implication of Stateless NACLs

What is a key security implication of NACLs being stateless compared to security groups which are stateful?

ANACLs require explicit rules for both directions, increasing rule complexity and risk of misconfiguration.
BNACLs automatically block all return traffic, increasing security.
CNACLs track connection state, reducing the need for outbound rules.
DNACLs cannot be used to block specific IP addresses.
Attempts:
2 left
💡 Hint

Consider how statelessness affects rule management.

Architecture
expert
2:00remaining
Designing a Highly Available NACL Setup

You need to design a highly available architecture using multiple subnets in different Availability Zones (AZs) with NACLs. Which statement about NACLs is true in this scenario?

AEach subnet must have a unique NACL; sharing NACLs across subnets is not allowed.
BA single NACL can be associated with multiple subnets across AZs to simplify management.
CNACLs are regional and automatically replicate rules across AZs.
DNACLs are stateful and automatically handle failover between AZs.
Attempts:
2 left
💡 Hint

Think about how NACLs associate with subnets and their scope.

Practice

(1/5)
1. What does it mean that Network ACLs (NACLs) are stateless in AWS?
easy
A. NACLs remember the state of connections to allow return traffic automatically
B. Each packet is checked independently without remembering previous packets
C. NACLs only filter traffic based on IP addresses, not ports
D. NACLs automatically block all inbound traffic by default

Solution

  1. Step 1: Understand the meaning of stateless

    Stateless means the system does not keep track of previous packets or connection states.
  2. Step 2: Apply this to NACLs

    NACLs evaluate each packet on its own, without remembering if it is part of an existing connection.
  3. Final Answer:

    Each packet is checked independently without remembering previous packets -> Option B
  4. Quick Check:

    Stateless means no memory of past packets = A [OK]
Hint: Stateless means no memory of past packets, check each separately [OK]
Common Mistakes:
  • Thinking NACLs remember connection states like security groups
  • Assuming NACLs allow return traffic automatically
  • Confusing stateless with blocking all traffic by default
2. Which of the following is the correct way to allow inbound HTTP traffic on port 80 using a NACL rule?
easy
A. Allow inbound traffic on port 80 with rule number 100, protocol TCP, action ALLOW
B. Allow inbound traffic on port 22 with rule number 100, protocol TCP, action ALLOW
C. Allow outbound traffic on port 80 with rule number 100, protocol TCP, action DENY
D. Allow inbound traffic on port 443 with rule number 100, protocol UDP, action ALLOW

Solution

  1. Step 1: Identify the correct port and protocol for HTTP

    HTTP uses TCP protocol on port 80.
  2. Step 2: Confirm the rule direction and action

    To allow inbound HTTP traffic, the rule must be inbound with action ALLOW.
  3. Final Answer:

    Allow inbound traffic on port 80 with rule number 100, protocol TCP, action ALLOW -> Option A
  4. Quick Check:

    Inbound TCP port 80 ALLOW = D [OK]
Hint: HTTP uses TCP port 80 inbound ALLOW rule [OK]
Common Mistakes:
  • Using wrong port number or protocol
  • Setting rule direction incorrectly
  • Using DENY action instead of ALLOW
3. Consider a NACL with the following rules:
Inbound Rule 100: ALLOW TCP port 80
Outbound Rule 100: DENY all traffic
What will happen when an instance in the subnet tries to send a response to an HTTP request?
medium
A. The response will be allowed because inbound is allowed
B. The response will be allowed because NACLs are stateful
C. The response will be blocked because outbound is denied
D. The response will be blocked because inbound denies it

Solution

  1. Step 1: Analyze inbound rule

    Inbound HTTP traffic on port 80 is allowed, so requests can reach the instance.
  2. Step 2: Analyze outbound rule

    Outbound rule denies all traffic, so responses from the instance are blocked.
  3. Final Answer:

    The response will be blocked because outbound is denied -> Option C
  4. Quick Check:

    Outbound DENY blocks response despite inbound ALLOW = B [OK]
Hint: Both inbound and outbound must allow traffic for two-way flow [OK]
Common Mistakes:
  • Assuming NACLs are stateful and allow return traffic automatically
  • Ignoring outbound rules when troubleshooting
  • Confusing inbound and outbound directions
4. You configured a NACL to allow inbound SSH (port 22) and outbound HTTP (port 80) traffic. However, SSH connections fail. What is the most likely cause?
medium
A. Outbound SSH traffic is not allowed in the NACL
B. Inbound HTTP traffic is not allowed in the NACL
C. NACLs are stateful and do not require outbound rules
D. Security groups block SSH traffic

Solution

  1. Step 1: Review NACL rules for SSH

    Inbound SSH (port 22) is allowed, but outbound SSH must also be allowed for return traffic.
  2. Step 2: Understand stateless nature of NACLs

    NACLs do not remember connection state, so both inbound and outbound rules must permit traffic.
  3. Final Answer:

    Outbound SSH traffic is not allowed in the NACL -> Option A
  4. Quick Check:

    Both directions must allow SSH for connection success = C [OK]
Hint: Allow both inbound and outbound for SSH due to stateless NACLs [OK]
Common Mistakes:
  • Assuming NACLs are stateful and outbound rules are unnecessary
  • Blaming security groups without checking NACLs
  • Ignoring outbound rules for return traffic
5. You want to allow a subnet to communicate with the internet using HTTP and HTTPS. Which NACL configuration correctly supports this stateless behavior?
hard
A. Allow all inbound and outbound traffic to simplify rules
B. Allow inbound TCP ports 80 and 443, allow outbound ephemeral ports 1024-65535
C. Allow inbound and outbound TCP ports 80 and 443 only
D. Allow inbound ephemeral ports 1024-65535, allow outbound TCP ports 80 and 443

Solution

  1. Step 1: Understand HTTP/HTTPS traffic flow

    Clients initiate outbound connections to ports 80 and 443; responses come back on ephemeral ports (1024-65535).
  2. Step 2: Configure NACL rules for stateless behavior

    Outbound rules must allow TCP ports 80 and 443; inbound rules must allow ephemeral ports for return traffic.
  3. Final Answer:

    Allow inbound ephemeral ports 1024-65535, allow outbound TCP ports 80 and 443 -> Option D
  4. Quick Check:

    Outbound to 80/443, inbound ephemeral ports for response = A [OK]
Hint: Allow outbound ports 80/443 and inbound ephemeral ports for return [OK]
Common Mistakes:
  • Allowing inbound ports 80/443 instead of ephemeral ports
  • Not allowing ephemeral ports inbound blocks responses
  • Allowing all traffic unnecessarily