A logistics company is deploying a two-tier application in a new VPC. The web tier consists of Amazon EC2 instances in a public subnet () behind an Application Load Balancer. The database tier consists of Amazon RDS MySQL instances in a private subnet (). The security team requires that the database subnet be isolated such that it only receives database connections from the web tier. Additionally, they must ensure the return traffic from the database can reach the web tier, while preventing any other egress traffic.
Which combination of Security Group and Network Access Control List (NACL) configurations meets these security requirements?
- AAssociate a security group with the database instances that allows inbound TCP port traffic from the public subnet CIDR block (). Configure the database subnet Network ACL (NACL) to allow inbound TCP port traffic from the web servers' security group, and allow outbound TCP traffic on ephemeral ports to the public subnet CIDR block ().
- BAssociate a security group with the database instances that allows inbound TCP port traffic from the web servers' security group. Configure the database subnet Network ACL (NACL) to allow inbound TCP port traffic from the public subnet CIDR block (), and set the outbound Network ACL rules to deny all outbound traffic to prevent unauthorized database egress.
- Associate a security group with the database instances that allows inbound TCP port traffic from the web servers' security group. Configure the database subnet Network ACL (NACL) to allow inbound TCP port traffic from the public subnet CIDR block (), and allow outbound TCP traffic on ephemeral ports to the public subnet CIDR block ().Answer
- DAssociate a security group with the database instances that allows inbound TCP port traffic from the web servers' security group, and outbound TCP traffic on ephemeral ports to the web servers' security group. Configure the database subnet Network ACL (NACL) to allow inbound TCP port traffic from the public subnet CIDR block (), but configure no outbound rules in the Network ACL.
Answer
Associate a security group with the database instances that allows inbound TCP port 3306 traffic from the web servers' security group. Configure the database subnet Network ACL (NACL) to allow inbound TCP port 3306 traffic from the public subnet CIDR block (10.0.1.0/24), and allow outbound TCP traffic on ephemeral ports 1024-65535 to the public subnet CIDR block (10.0.1.0/24).
The correct answer provides the necessary stateful and stateless configurations to achieve isolation. The Security Group configuration references the web servers' security group for strict instance-to-instance access, which automatically allows stateful outbound responses. The Network ACL configuration defines stateless inbound rules for port and stateless outbound rules for the ephemeral ports () back to the public subnet, ensuring response packets are not dropped at the subnet boundary.
Step-by-Step Solution
Key Concept
Stateful vs. Stateless Filtering in VPC Security