Back to Checks
aws

VPC endpoints ensure private connectivity for all Bedrock APIs

bedrock_vpc_endpoints_configured
Service: bedrockSeverity: medium
OfficialBuilt-inVerified
Categories:internet-exposedtrust-boundariesgen-ai
Resource Type:AwsEc2VpcEndpointService

Amazon VPCs are evaluated for interface VPC endpoints to all Bedrock services: bedrock, bedrock-runtime, bedrock-agent, bedrock-agent-runtime, and bedrock-mantle (OpenAI-compatible API). Only endpoints in available state are considered. Their presence indicates private Bedrock API connectivity over AWS PrivateLink within the VPC.

Risk

Without private Bedrock endpoints, control plane and runtime API traffic exits the VPC via IGW or NAT Gateway. This expands exposure to network path threats (e.g., DNS hijack, MITM), weakens egress isolation, and adds an internet dependency for Bedrock API access, reducing availability if NAT or edge paths fail.

Run this check with Prowler

Run in Prowler Cloud
Run
prowler aws --checks bedrock_vpc_endpoints_configured

Recommendation

Use interface VPC endpoints for all Bedrock services (bedrock, bedrock-runtime, bedrock-agent, bedrock-agent-runtime, bedrock-mantle) in each VPC that requires Bedrock API access.

  • Enable private DNS to keep calls on the AWS network
  • Apply restrictive endpoint policies (least privilege)
  • Reduce reliance on public egress and layer controls for defense in depth

Remediation

CLI

aws ec2 create-vpc-endpoint --vpc-id <VPC_ID> --service-name com.amazonaws.<REGION>.bedrock-runtime --vpc-endpoint-type Interface --subnet-ids <SUBNET_ID> && aws ec2 create-vpc-endpoint --vpc-id <VPC_ID> --service-name com.amazonaws.<REGION>.bedrock --vpc-endpoint-type Interface --subnet-ids <SUBNET_ID> && aws ec2 create-vpc-endpoint --vpc-id <VPC_ID> --service-name com.amazonaws.<REGION>.bedrock-agent --vpc-endpoint-type Interface --subnet-ids <SUBNET_ID> && aws ec2 create-vpc-endpoint --vpc-id <VPC_ID> --service-name com.amazonaws.<REGION>.bedrock-agent-runtime --vpc-endpoint-type Interface --subnet-ids <SUBNET_ID> && aws ec2 create-vpc-endpoint --vpc-id <VPC_ID> --service-name com.amazonaws.<REGION>.bedrock-mantle --vpc-endpoint-type Interface --subnet-ids <SUBNET_ID>

Terraform

# Create Bedrock control plane interface VPC endpoint
resource "aws_vpc_endpoint" "bedrock" {
  vpc_id            = "<example_resource_id>"                      # CRITICAL: target VPC
  service_name      = "com.amazonaws.<region>.bedrock"             # CRITICAL: Bedrock control plane endpoint
  vpc_endpoint_type = "Interface"                                  # CRITICAL: interface endpoint
  subnet_ids        = ["<example_resource_id>"]                   # CRITICAL: subnet(s) for endpoint ENIs
}

# Create Bedrock runtime interface VPC endpoint
resource "aws_vpc_endpoint" "bedrock_runtime" {
  vpc_id            = "<example_resource_id>"                      # CRITICAL: target VPC
  service_name      = "com.amazonaws.<region>.bedrock-runtime"     # CRITICAL: Bedrock runtime endpoint
  vpc_endpoint_type = "Interface"                                  # CRITICAL: interface endpoint
  subnet_ids        = ["<example_resource_id>"]                   # CRITICAL: subnet(s) for endpoint ENIs
}

# Create Bedrock agent control plane interface VPC endpoint
resource "aws_vpc_endpoint" "bedrock_agent" {
  vpc_id            = "<example_resource_id>"                      # CRITICAL: target VPC
  service_name      = "com.amazonaws.<region>.bedrock-agent"       # CRITICAL: Bedrock agent control plane endpoint
  vpc_endpoint_type = "Interface"                                  # CRITICAL: interface endpoint
  subnet_ids        = ["<example_resource_id>"]                   # CRITICAL: subnet(s) for endpoint ENIs
}

# Create Bedrock agent runtime interface VPC endpoint
resource "aws_vpc_endpoint" "bedrock_agent_runtime" {
  vpc_id            = "<example_resource_id>"                      # CRITICAL: target VPC
  service_name      = "com.amazonaws.<region>.bedrock-agent-runtime"  # CRITICAL: Bedrock agent runtime endpoint
  vpc_endpoint_type = "Interface"                                  # CRITICAL: interface endpoint
  subnet_ids        = ["<example_resource_id>"]                   # CRITICAL: subnet(s) for endpoint ENIs
}

# Create Bedrock Mantle (OpenAI-compatible) interface VPC endpoint
resource "aws_vpc_endpoint" "bedrock_mantle" {
  vpc_id            = "<example_resource_id>"                      # CRITICAL: target VPC
  service_name      = "com.amazonaws.<region>.bedrock-mantle"      # CRITICAL: Bedrock Mantle OpenAI-compatible endpoint
  vpc_endpoint_type = "Interface"                                  # CRITICAL: interface endpoint
  subnet_ids        = ["<example_resource_id>"]                   # CRITICAL: subnet(s) for endpoint ENIs
}

NativeIaC

# CloudFormation: create Bedrock interface VPC endpoints in the VPC
Resources:
  BedrockEndpoint:
    Type: AWS::EC2::VPCEndpoint
    Properties:
      VpcId: "<example_resource_id>"                              # CRITICAL: target VPC
      ServiceName: !Sub "com.amazonaws.${AWS::Region}.bedrock"     # CRITICAL: Bedrock control plane endpoint
      VpcEndpointType: Interface                                   # CRITICAL: interface endpoint
      SubnetIds:
        - "<example_resource_id>"
  BedrockRuntimeEndpoint:
    Type: AWS::EC2::VPCEndpoint
    Properties:
      VpcId: "<example_resource_id>"                              # CRITICAL: target VPC
      ServiceName: !Sub "com.amazonaws.${AWS::Region}.bedrock-runtime"  # CRITICAL: Bedrock runtime endpoint
      VpcEndpointType: Interface                                   # CRITICAL: interface endpoint
      SubnetIds:
        - "<example_resource_id>"
  BedrockAgentEndpoint:
    Type: AWS::EC2::VPCEndpoint
    Properties:
      VpcId: "<example_resource_id>"                              # CRITICAL: target VPC
      ServiceName: !Sub "com.amazonaws.${AWS::Region}.bedrock-agent"  # CRITICAL: Bedrock agent control plane endpoint
      VpcEndpointType: Interface                                   # CRITICAL: interface endpoint
      SubnetIds:
        - "<example_resource_id>"
  BedrockAgentRuntimeEndpoint:
    Type: AWS::EC2::VPCEndpoint
    Properties:
      VpcId: "<example_resource_id>"                              # CRITICAL: target VPC
      ServiceName: !Sub "com.amazonaws.${AWS::Region}.bedrock-agent-runtime"  # CRITICAL: Bedrock agent runtime endpoint
      VpcEndpointType: Interface                                   # CRITICAL: interface endpoint
      SubnetIds:
        - "<example_resource_id>"
  BedrockMantleEndpoint:
    Type: AWS::EC2::VPCEndpoint
    Properties:
      VpcId: "<example_resource_id>"                              # CRITICAL: target VPC
      ServiceName: !Sub "com.amazonaws.${AWS::Region}.bedrock-mantle"  # CRITICAL: Bedrock Mantle OpenAI-compatible endpoint
      VpcEndpointType: Interface                                   # CRITICAL: interface endpoint
      SubnetIds:
        - "<example_resource_id>"

Other

1In the AWS console, go to VPC > Endpoints
2Click Create endpoint
3For Service category, choose AWS services and select com.amazonaws.<region>.bedrock
4Select your VPC and at least one subnet
5Click Create endpoint
6Repeat steps 2-5 for com.amazonaws.<region>.bedrock-runtime, com.amazonaws.<region>.bedrock-agent, com.amazonaws.<region>.bedrock-agent-runtime, and com.amazonaws.<region>.bedrock-mantle

Check Code

from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.bedrock.bedrock_agent_client import (
    bedrock_agent_client,
)
from prowler.providers.aws.services.bedrock.bedrock_client import bedrock_client
from prowler.providers.aws.services.vpc.vpc_client import vpc_client

BEDROCK_ENDPOINT_SERVICES = {
    "bedrock": "Bedrock control plane",
    "bedrock-runtime": "Bedrock runtime",
    "bedrock-agent": "Bedrock agent control plane",
    "bedrock-agent-runtime": "Bedrock agent runtime",
    "bedrock-mantle": "Bedrock Mantle (OpenAI-compatible API)",
}


class bedrock_vpc_endpoints_configured(Check):
    """Ensure VPC endpoints are configured for Bedrock services.

    This check verifies that each VPC in regions with Bedrock activity has
    interface VPC endpoints for all Amazon Bedrock services (control plane,
    runtime, agent, agent runtime, and Mantle OpenAI-compatible API),
    ensuring that traffic to these services remains within the AWS network.
    - PASS: The VPC has VPC endpoints for all Bedrock services.
    - FAIL: The VPC is missing one or more Bedrock VPC endpoints.
    VPCs in regions without Bedrock activity are skipped.
    """

    def execute(self) -> list[Check_Report_AWS]:
        """Execute the check logic.

        Returns:
            A list of reports containing the result of the check.
        """
        findings = []
        bedrock_regions = self._get_bedrock_active_regions()

        for vpc_id, vpc in vpc_client.vpcs.items():
            if not (vpc_client.provider.scan_unused_services or vpc.in_use):
                continue

            if vpc.region not in bedrock_regions:
                continue

            report = Check_Report_AWS(metadata=self.metadata(), resource=vpc)
            report.status = "FAIL"

            found_services = set()

            for endpoint in vpc_client.vpc_endpoints:
                if endpoint.vpc_id == vpc_id and endpoint.state == "available":
                    for svc_suffix in BEDROCK_ENDPOINT_SERVICES:
                        if endpoint.service_name.endswith(f".{svc_suffix}"):
                            found_services.add(svc_suffix)

            missing_services = set(BEDROCK_ENDPOINT_SERVICES) - found_services

            if not missing_services:
                report.status = "PASS"
                report.status_extended = (
                    f"VPC {vpc.id} has VPC endpoints for all Bedrock services."
                )
            else:
                missing_labels = [
                    BEDROCK_ENDPOINT_SERVICES[svc] for svc in sorted(missing_services)
                ]
                report.status_extended = f"VPC {vpc.id} does not have VPC endpoints for the following Bedrock services: {', '.join(missing_labels)}."

            findings.append(report)

        return findings

    @staticmethod
    def _get_bedrock_active_regions() -> set[str]:
        """Return regions where Bedrock resources or logging are configured."""
        active_regions = set()

        for region, config in bedrock_client.logging_configurations.items():
            if config.enabled:
                active_regions.add(region)

        for guardrail in bedrock_client.guardrails.values():
            active_regions.add(guardrail.region)

        for agent in bedrock_agent_client.agents.values():
            active_regions.add(agent.region)

        return active_regions