An e-commerce company hosts its inventory application tier on Amazon EC2 instances inside a public subnet with CIDR block . The application connects to a MySQL database cluster running on EC2 instances in a private subnet with CIDR block . A solutions architect is configuring a new custom Network ACL for the private subnet. The architect adds an inbound rule to the Network ACL allowing TCP port from the public subnet CIDR block . The database security group already permits inbound traffic on port from the application instances. However, after applying the new Network ACL, database connections from the application tier fail. Which action will resolve this issue?
- AAdd an outbound rule to the database instances' security group that allows outbound TCP traffic to on port .
- Add an outbound rule to the private subnet's Network ACL that allows outbound TCP traffic to on ephemeral ports .Answer
- CChange the private subnet's Network ACL inbound rule to allow all traffic, and configure the database instances' security group as stateless to handle the return traffic dynamically.
- DAdd an outbound rule to the private subnet's Network ACL that allows outbound TCP traffic to on port .
Answer
Add an outbound rule to the private subnet's Network ACL that allows outbound TCP traffic to on ephemeral ports .
The correct answer is to add an outbound rule to the private subnet's Network ACL allowing traffic to the public subnet on ephemeral ports. Network ACLs are stateless network boundaries. When an inbound connection on port is allowed into the private subnet, the return traffic from the database to the application tier uses a high-numbered ephemeral destination port. Because Network ACLs do not automatically track session state, an outbound rule must explicitly permit this return traffic on ephemeral ports () for the connection to succeed.
Step-by-Step Solution
Key Concept
Network ACLs are stateless and require explicit outbound rules to permit return traffic. When a client connects to a server, the server responds to the client's ephemeral source port. Therefore, the stateless firewall protecting the server must allow outbound traffic to the client's IP address range on ephemeral ports ().