An Amazon EC2 instance with private IP address is launched in a private subnet. The instance must make outbound HTTPS requests to an external API endpoint at . The SysOps Administrator has configured security groups and Network Access Control Lists (Network ACLs) for the subnet, but connection attempts from the instance to the API consistently time out. The administrator enables VPC Flow Logs and observes the following log records:
2 123456789012 eni-0a1b2c3d4e5f6g7h8 10.0.4.12 203.0.113.80 52345 443 6 1 40 1783900800 1783900860 ACCEPT OK
2 123456789012 eni-0a1b2c3d4e5f6g7h8 203.0.113.80 10.0.4.12 443 52345 6 1 40 1783900800 1783900860 REJECT OK
Which configuration adjustment will resolve this connectivity issue?
- Add an inbound rule to the subnet's Network ACL allowing TCP traffic from on ports .Answer
- BAdd an outbound rule to the subnet's Network ACL allowing TCP traffic to on ports , since stateless Network ACLs require ephemeral ports to be allowed in the outbound direction for outbound-initiated traffic.
- CModify the IAM policy of the SysOps Administrator to include `iam:PassRole` permissions for the flow logs delivery role, as the `REJECT` log action indicates that the logging service is unauthorized to publish records.
- DModify the log group retention configuration in Amazon CloudWatch Logs to prevent the logs from being expired, as the `REJECT` action indicates that the target log group is rejecting log streams due to retention limit exhaustion.
Answer
Add an inbound rule to the subnet's Network ACL allowing TCP traffic from on ports .
The correct option is to add an inbound rule to the subnet's Network ACL allowing TCP traffic from the external API on the ephemeral port range. This is because security groups are stateful and automatically permit return traffic. Network ACLs, however, are stateless and inspect inbound and outbound traffic separately. The VPC Flow Logs show that the outbound request was accepted, but the inbound response on the ephemeral port (52345) was rejected. Thus, the stateless Network ACL blocked the return path because it lacked an inbound rule for ephemeral ports.
Step-by-Step Solution
Key Concept
The stateless nature of Network ACLs requires explicit rules for both request and return paths, including dynamically allocated ephemeral ports for return traffic.
Estimated Time:3m 0s