A company runs an internal reporting application on Amazon EC2 instances in a private subnet. The application must connect to an external third-party API service on the internet to retrieve data daily over HTTPS (TCP port ). A solutions architect has already deployed a NAT Gateway in a public subnet and configured the private subnet's route table to route internet traffic () to the NAT Gateway. The company requires using a custom Network Access Control List (NACL) on the private subnet to restrict outbound traffic to only this API service, whose public IP address is . Which two configurations must be added to the custom NACL to allow this communication while maintaining the principle of least privilege? (Select TWO.)
- An outbound rule allowing TCP port to destination Answer
- An inbound rule allowing TCP ports from source Answer
- CAn inbound rule allowing TCP port from source
- DAn inbound rule allowing TCP port from the application security group (SG-APP-SG) as the source
- EAn outbound rule allowing TCP ports to destination
Answer
An outbound rule allowing TCP port to destination and an inbound rule allowing TCP ports from source
Because Network ACLs are stateless, they require explicit rules for both outbound request traffic and inbound response traffic. The outbound connection is initiated towards the external API's service port (TCP ), which requires an outbound rule allowing TCP port to the API's IP address . The return traffic from the API is destined for the client's ephemeral port range (), which requires an inbound rule allowing TCP ports from the API's IP address .
Step-by-Step Solution
Key Concept
Stateless nature of Network ACLs requiring explicit ephemeral port inbound rules for outbound connections