An Amazon EC2 instance in a private subnet needs to download security patches from an external repository over HTTPS (TCP port 443). The subnet's custom network access control list (NACL) has a rule that allows outbound TCP traffic on port 443 to any destination. However, the connection attempts are timing out. Which modification to the custom NACL will allow the EC2 instance to successfully receive the patches?
- AConfigure an inbound rule permitting TCP traffic on port 443 from the repository's IP address.
- BAdjust the security group to permit inbound TCP traffic on ports 1024-65535 from the repository's IP address.
- Configure an inbound rule permitting TCP traffic on ports 1024-65535 from the repository's IP address.Answer
- DConfigure an outbound rule permitting TCP traffic on ports 1024-65535 to the repository's IP address.
Answer
Configure an inbound rule permitting TCP traffic on ports 1024-65535 from the repository's IP address.
The correct configuration is to configure an inbound rule permitting TCP traffic on ports 1024-65535. Network Access Control Lists (NACLs) are stateless, meaning that allowing outbound traffic does not automatically allow the corresponding return traffic. When the EC2 instance initiates a connection to the external repository on port 443, the repository sends the response back to the instance's ephemeral ports, which typically range from 1024 to 65535. Therefore, an inbound rule covering these ephemeral ports is required to allow the response traffic through the NACL.
Step-by-Step Solution
Key Concept
NACLs are stateless firewalls that control traffic at the subnet level, requiring explicit rules for both inbound and outbound traffic, including ephemeral ports for return traffic.