A financial services company is deploying a two-tier application inside a virtual private cloud (VPC). The application consists of backend processing Amazon EC2 instances running in Subnet A () and a PostgreSQL database instance running in Subnet B (). The backend instances need to access the database on TCP port , but all other traffic between the subnets must be blocked. The company requires a defense-in-depth network security architecture using both Security Groups and Network ACLs (NACLs). Which TWO configuration steps should the solutions architect perform to meet these security requirements?
- Configure the database security group to allow inbound TCP traffic on port from the security group of the backend processing instances.Answer
- Configure the Network ACL for Subnet B to allow inbound TCP traffic on port from Subnet A () and allow outbound TCP traffic on ephemeral ports () to Subnet A ().Answer
- CConfigure the database security group to allow inbound TCP traffic on port from the backend processing instances' security group, and add an outbound rule allowing TCP traffic on ephemeral ports () to the backend instances' security group.
- DConfigure the Network ACL for Subnet B to allow inbound TCP traffic on port from Subnet A (), relying on the stateful nature of Network ACLs to automatically allow the return database response traffic.
- EDeploy AWS WAF and associate it directly with Subnet B to inspect SQL traffic and prevent SQL injection attacks from Subnet A.
Answer
Configuring the database security group to allow inbound TCP traffic on port from the backend processing instances' security group, and configuring the Network ACL for Subnet B to allow inbound TCP traffic on port from Subnet A and outbound TCP traffic on ephemeral ports () to Subnet A.
The correct architecture uses a combination of a stateful security group on the database instance and a stateless Network ACL on Subnet B. The security group configuration must allow inbound traffic from the backend instances' security group on port , which automatically allows return traffic. The Network ACL configuration must allow inbound traffic from the backend subnet on port and also explicitly allow outbound return traffic to the backend subnet on ephemeral ports because Network ACLs are stateless.
Step-by-Step Solution
Key Concept
Distinguishing between the stateful behavior of Security Groups and the stateless behavior of Network ACLs in Amazon VPC.
Estimated Time:2m 0s