A company is deploying a secure database tier on Amazon EC2 instances in a private subnet (Subnet B: ) of a VPC. The database instances run PostgreSQL. The application tier runs on EC2 instances in a different private subnet (Subnet A: ). The database instances must only allow inbound database traffic from the application instances. The database instances must be blocked from initiating any outbound connections to the internet, but they must be able to securely connect to AWS Systems Manager (SSM) via interface VPC endpoints to download software updates.
Which TWO configurations must a solutions architect implement to meet these requirements with least privilege? (Select TWO.)
- Configure the database security group to allow inbound TCP port 5432 from the application security group, and outbound TCP port 443 to the SSM VPC endpoint security group, removing the default outbound rule that allows all traffic.Answer
- Configure the VPC endpoint security group to allow inbound TCP port 443 from the database security group.Answer
- CAssociate the database security group with Subnet B to enforce traffic filtering at the subnet boundary, ensuring no outbound traffic is allowed to route to the internet.
- DConfigure the Network ACL for Subnet B to allow inbound TCP port 5432 from Subnet A, relying on the stateful nature of Network ACLs to automatically permit return traffic to the application tier.
- EConfigure the database security group to allow outbound TCP port 443 to so that the patch requests can be inspected by AWS WAF before being routed to AWS Systems Manager.
Answer
To meet the requirements, the database security group must be configured to allow inbound TCP port 5432 from the application security group and outbound TCP port 443 to the SSM VPC endpoint security group (with the default outbound rule removed). Additionally, the VPC endpoint security group must allow inbound TCP port 443 from the database security group.
The database security group must allow inbound database traffic on port 5432 from the application security group and outbound HTTPS traffic on port 443 to the security group of the SSM VPC endpoint, with the default outbound rule removed to prevent any other outbound traffic. The VPC endpoint security group must allow inbound HTTPS traffic on port 443 from the database security group. Since security groups are stateful, return traffic for both connections is automatically permitted.
Step-by-Step Solution
Key Concept
VPC Network Security using stateful Security Groups and Interface VPC Endpoints
Estimated Time:2m 0s