An operations team reports that a critical application running on Amazon EC2 instances in a private subnet is unable to retrieve data from an external API, though the API endpoint is verified as active. To investigate the issue, a SysOps Administrator enables VPC Flow Logs for the subnet. The flow logs reveal that outbound TCP traffic to the API on port 443 shows an action of ACCEPT, but the inbound return traffic from the API's IP address on TCP ports 1024–65535 shows an action of REJECT. Which of the following is the most likely cause of this behavior?
- The network ACL associated with the subnet has an inbound rule that does not allow return traffic on ephemeral ports.Cevap
- BThe security group associated with the EC2 instances lacks an inbound rule allowing return traffic from the API on the ephemeral port range.
- CThe subnet's route table lacks a route for a Gateway VPC Endpoint, causing the response traffic to be dropped when routed back to the instances.
- DThe IAM role used by the SysOps Administrator to enable the flow logs lacks the iam:PassRole permission.
Cevap
The network ACL associated with the subnet has an inbound rule that does not allow return traffic on ephemeral ports.
The correct answer is correct because network access control lists (NACLs) are stateless. Consequently, when an EC2 instance initiates an outbound connection, the return traffic is treated as a separate connection and must be explicitly allowed by the inbound NACL rules. Since the return traffic from the API uses ephemeral ports (1024–65535), the inbound NACL must allow this port range. If it does not, the traffic will be blocked and recorded as REJECT in the VPC Flow Logs.
Adım Adım Çözüm
Anahtar Kavram
Stateless behavior of Network ACLs compared to stateful Security Groups in VPC Flow Logs