A company runs a data processing application on Amazon EC2 instances in a private subnet (CIDR ) of a VPC. The application needs to download datasets from an Amazon S3 bucket in the same AWS Region using an S3 Gateway Endpoint. Additionally, the application must upload logs to an external partner's HTTPS service hosted at the static IP address . The EC2 instances initiate all connections using ephemeral ports ().
A solutions architect must configure the VPC security groups and Network Access Control Lists (NACLs) to enforce the principle of least privilege.
Which combination of actions will allow the required traffic while restricting all other access? (Select TWO.)
- Configure the security group attached to the EC2 instances with outbound rules that allow TCP traffic on port 443 to the Amazon S3 prefix list and to .Answer
- BConfigure the security group attached to the EC2 instances with outbound rules allowing TCP traffic on port 443 to the Amazon S3 prefix list and , and inbound rules allowing TCP traffic on ports from both destinations.
- Configure the subnet NACL with outbound rules allowing TCP traffic on port 443 to and , and inbound rules allowing TCP traffic on ports from and .Answer
- DConfigure the subnet NACL with outbound rules allowing TCP traffic on port 443 to and the Amazon S3 prefix list, and inbound rules allowing TCP traffic on ports from both destinations.
- EConfigure the private subnet's route table with a default route () pointing to the S3 Gateway Endpoint to route both S3 and external HTTPS traffic.
Answer
Configure the security group with outbound rules allowing TCP traffic on port 443 to the S3 prefix list and the partner's IP, and configure the subnet NACL with outbound rules to those destinations on port 443 and inbound rules allowing return traffic on ephemeral ports (using for S3 since NACLs do not support prefix lists).
The correct combination requires understanding stateful vs. stateless traffic filtering and the platform limitations of NACLs and Security Groups. First, the option configuring the security group with outbound rules to the S3 prefix list and the partner's IP on port 443 is correct because security groups are stateful and automatically allow return traffic on ephemeral ports. Second, the option configuring the subnet NACL with outbound rules on port 443 to the partner IP and , along with inbound rules on ephemeral ports, is correct because NACLs are stateless and do not support VPC prefix lists.
Step-by-Step Solution
Key Concept
Stateful vs. Stateless network filtering and resource limitations within VPC security structures.
Estimated Time:2m 0s