Question

Difficulty: EasyVPC Network Security

A company is deploying a database instance in a private subnet. The database needs to receive traffic only from a web server running in a public subnet of the same VPC. Which of the following configurations are required to establish this network security boundary? (Select TWO.)

  1. Create a security group for the database instance with an inbound rule that allows the database port traffic from the security group of the web server.Answer
  2. Configure the private subnet's Network ACL with an inbound rule allowing database port traffic from the public subnet CIDR, and an outbound rule allowing ephemeral port traffic back to the public subnet CIDR.Answer
  3. C
    Attach an AWS WAF web ACL directly to the database instance to inspect and filter SQL queries at the network layer.
  4. D
    Configure the database security group with an outbound rule allowing return traffic to the web server, because security groups are stateless.
  5. E
    Configure a Network ACL at the database instance level to restrict inbound access to the database port.

Answer

The correct configurations are to create a security group for the database instance that allows inbound traffic from the web server's security group, and to configure the private subnet's Network ACL with both inbound traffic rules and outbound ephemeral port return rules.
The correct choices are the security group inbound rule configuration and the Network ACL rules configuration. Security groups operate at the instance level and are stateful, so configuring an inbound rule referencing the web server's security group allows the traffic and its return flow. Network ACLs operate at the subnet level and are stateless, requiring explicit rules for both inbound database traffic and outbound ephemeral port return traffic.

Step-by-Step Solution

1
Analyze instance-level network security controls.
Identify that security groups operate at the instance level and are stateful, meaning they only require inbound configuration to allow bidirectional communication.
This confirms that an inbound rule on the database security group referencing the web server's security group is correct and sufficient at the instance level.
2
Analyze subnet-level network security controls.
Identify that Network ACLs operate at the subnet level and are stateless, meaning they require explicit rules for both inbound traffic and outbound return traffic.
This confirms that the Network ACL must allow inbound database port traffic and outbound ephemeral port traffic to enable successful bidirectional communication.

Key Concept

VPC Network Security controls comparison (Security Groups vs. Network ACLs)
Rate this question