An organization is deploying a microservices-based application where a backend service runs on Amazon EC2 instances in a private subnet. An integration proxy instance in the public subnet of the same VPC needs to forward incoming customer requests to these backend instances. The company's security policy requires that the backend instances must not be allowed to initiate any outbound connections to the internet or other subnets, but they must be able to receive requests from the integration proxy and return the responses. Which configuration should a solutions architect implement to meet these security requirements?
- Associate a security group with the backend EC2 instances that allows inbound traffic from the integration proxy's security group, and remove all outbound rules from this security group.Answer
- BAssociate a Network ACL with the private subnet that allows inbound traffic from the public subnet, and remove all outbound rules from the Network ACL to prevent any outbound connection initiation.
- CAssociate a security group with the backend EC2 instances that allows inbound traffic from the integration proxy's security group, and associate an AWS WAF web ACL with the private subnet's route table to block outbound requests.
- DAssociate a security group with the backend EC2 instances that allows inbound traffic from the integration proxy's security group, and configure a Network ACL on the private subnet that denies all outbound traffic on ports to .
Answer
Associate a security group with the backend EC2 instances that allows inbound traffic from the integration proxy's security group, and remove all outbound rules from this security group.
The correct option correctly leverages the stateful nature of security groups. In a VPC, security groups are stateful, meaning any inbound traffic allowed by an inbound rule is automatically permitted to flow out as return traffic, bypassing outbound rules. By removing all outbound rules from the backend security group, the instances are blocked from initiating any outbound connections (e.g., to the internet or other resources), satisfying the security policy while still allowing the instances to respond to incoming requests from the integration proxy.
Step-by-Step Solution
Key Concept
Stateful vs Stateless VPC Security Controls