Question

Difficulty: MediumVPC Endpoints and PrivateLink Integration

A company runs applications on Amazon EC2 instances in a private subnet. The applications must securely retrieve API keys from AWS Secrets Manager. To keep the traffic within the AWS network, a SysOps Administrator deploys an Interface VPC Endpoint for Secrets Manager (com.amazonaws.us-east-1.secretsmanager). However, connection attempts from the EC2 instances to the Secrets Manager service keep timing out. Which of the following actions will resolve this issue?

  1. Modify the security group associated with the Interface VPC Endpoint to allow inbound HTTPS traffic on TCP port 443 from the security group of the EC2 instances.Answer
  2. B
    Add a route to the private subnet's route table with the destination pointing to the AWS Secrets Manager prefix list and the target pointing to the VPC endpoint ID.
  3. C
    Configure the private subnet's route table to direct all Secrets Manager API traffic through a NAT Gateway residing in a public subnet.
  4. D
    Update the subnet's network ACL to allow outbound ephemeral ports to the public internet while blocking all inbound traffic from port 443.

Answer

Modify the security group associated with the Interface VPC Endpoint to allow inbound HTTPS traffic on TCP port 443 from the security group of the EC2 instances.
The correct action is to modify the security group associated with the Interface VPC Endpoint to allow inbound HTTPS traffic on TCP port 443 from the security group of the EC2 instances. Interface VPC Endpoints provision Elastic Network Interfaces (ENIs) inside the VPC subnets. These ENIs are secured by security groups. Since the API clients (the EC2 instances) communicate with these ENIs over HTTPS, the security group attached to the endpoint must allow inbound traffic on TCP port 443 from the EC2 instances' security group or subnet.

Step-by-Step Solution

1
Identify the type of VPC endpoint being used.
The scenario uses an Interface VPC Endpoint (powered by AWS PrivateLink) for AWS Secrets Manager.
Interface endpoints use Elastic Network Interfaces (ENIs) and security groups, unlike Gateway endpoints which use route tables.
2
Determine the network protocol and port required for the service API.
AWS Secrets Manager API endpoints accept secure HTTPS traffic over TCP port 443.
EC2 instances must be able to initiate an HTTPS connection to the endpoint's ENI.
3
Configure the security groups to allow the traffic flow.
Modify the security group attached to the Interface VPC Endpoint to permit inbound HTTPS (port 443) traffic originating from the EC2 instances.
Security groups are stateful and control traffic at the ENI level. The endpoint security group must explicitly allow the incoming request.

Key Concept

Interface VPC Endpoints rely on security groups to control inbound access to their ENIs, whereas routing is handled via DNS (Private DNS) rather than route table entries.
Rate this question