A company's backend application runs on Amazon EC2 instances inside a private subnet. The application is required to call a partner's external API endpoint at a static public IP address () using HTTPS. The private subnet is associated with a custom network ACL (NACL) that currently denies all inbound and outbound traffic. The security groups associated with the EC2 instances already allow all outbound HTTPS traffic.
Which configuration of rules must be added to the custom NACL to allow the EC2 instances to successfully establish connections to the external API?
- AAn outbound rule allowing traffic to destination on TCP port . No inbound rule is required because network ACLs automatically allow return traffic for established connections.
- BAn outbound rule allowing traffic to destination on TCP port , and an inbound rule allowing traffic from source on TCP port .
- An outbound rule allowing traffic to destination on TCP port , and an inbound rule allowing traffic from source on TCP ports .Answer
- DAn outbound rule allowing traffic to destination on TCP ports , and an inbound rule allowing traffic from source on TCP port .
Answer
An outbound rule allowing traffic to destination on TCP port , and an inbound rule allowing traffic from source on TCP ports .
The correct configuration requires allowing outbound traffic to the destination IP address on TCP port , because the EC2 instances are initiating HTTPS requests. Since network ACLs are stateless, they do not automatically track connections or allow return traffic. Therefore, an inbound rule is also required. This inbound rule must allow traffic from the partner's IP address (acting as the source) on TCP source port returning to the EC2 instances' ephemeral destination ports (TCP ).
Step-by-Step Solution
Key Concept
Stateless Network ACLs and Ephemeral Ports
Estimated Time:1m 30s