A company runs a critical data ingestion service on Amazon EC2 instances in a private subnet (). The instances must download software updates from a specific external HTTPS endpoint at . The VPC routes internet-bound traffic from the private subnet through a NAT Gateway located in a public subnet. The company requires strict restriction of traffic at the private subnet boundary. A solutions architect is configuring the Network ACL (NACL) associated with the private subnet. Which configuration will allow the EC2 instances to successfully download the updates while maintaining the most secure posture?
- Configure an outbound NACL rule allowing TCP traffic to destination on port , and an inbound NACL rule allowing TCP traffic from source on ports -.Answer
- BConfigure an outbound NACL rule allowing TCP traffic to destination on port . No inbound rule is required because Network ACLs automatically track connections and allow return traffic.
- CConfigure an outbound NACL rule allowing TCP traffic to destination on ports -, and an inbound NACL rule allowing TCP traffic from source on port .
- DConfigure an outbound NACL rule allowing TCP traffic to the private IP address of the NAT Gateway on port , and an inbound NACL rule allowing TCP traffic from the private IP address of the NAT Gateway on ports -.
Answer
Configure an outbound NACL rule allowing TCP traffic to destination on port , and an inbound NACL rule allowing TCP traffic from source on ports -.
The correct configuration consists of an outbound NACL rule to TCP port 443 with the destination of the external server's IP address, and an inbound NACL rule from the external server's IP address targeting the ephemeral port range (1024-65535). Because Network ACLs (NACLs) are stateless, they do not track connection state, meaning separate rules must allow both the initial outgoing request and the incoming response. Additionally, since the NACL is evaluated at the private subnet boundary before the traffic reaches the NAT Gateway in the public subnet, the destination IP on the outbound rule must be the external server's public IP.
Step-by-Step Solution
Key Concept
Network ACLs (NACLs) act as stateless firewalls at the subnet level. Because they are stateless, any allowed outbound traffic must have a corresponding inbound rule to permit the return traffic, which typically targets the client's ephemeral port range (TCP 1024-65535). Furthermore, NACL rules are evaluated before NAT processing occurs, so they must target the final destination IP address.
Estimated Time:1m 30s