Amazon SageMaker model has VPC settings enabled
SageMaker models use VPC settings (VpcConfig with subnets and security groups) so inference containers communicate through a selected VPC rather than the public internet.
This evaluates whether a model defines VPC subnets for its network path.
Risk
Without VPC isolation, model traffic and data access can traverse public paths, weakening confidentiality and integrity through interception or misrouting.
Missing security groups and private endpoints reduce access control, enabling excessive egress, data exfiltration, or command-and-control from compromised containers.
Run this check with Prowler
Run in Prowler Cloudprowler aws --checks sagemaker_models_vpc_settings_configuredRecommendation
Enable VPC-only networking for models by defining VpcConfig with private subnets and restrictive security groups.
Apply least privilege egress, use VPC endpoints for S3 and SageMaker runtime, avoid public routes, and implement defense in depth with segmentation and traffic monitoring.
Remediation
Terraform
resource "aws_sagemaker_model" "model" {
name = "<example_resource_name>"
execution_role_arn = "<example_resource_id>"
primary_container {
image = "<example_resource_name>"
}
# Critical: VPC config enables VPC networking for the model so the check passes
vpc_config {
subnets = ["<example_resource_id>"] # Critical
security_group_ids = ["<example_resource_id>"] # Critical
}
}NativeIaC
Resources:
SageMakerModel:
Type: AWS::SageMaker::Model
Properties:
ExecutionRoleArn: "<example_resource_id>"
PrimaryContainer:
Image: "<example_resource_name>"
# Critical: VpcConfig enables VPC networking for the model so the check passes
VpcConfig:
SecurityGroupIds:
- "<example_resource_id>" # Critical: security group in the VPC
Subnets:
- "<example_resource_id>" # Critical: at least one subnet in the VPCOther
Check Code
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.sagemaker.sagemaker_client import sagemaker_client
class sagemaker_models_vpc_settings_configured(Check):
def execute(self):
findings = []
for model in sagemaker_client.sagemaker_models:
report = Check_Report_AWS(metadata=self.metadata(), resource=model)
report.status = "PASS"
report.status_extended = (
f"Sagemaker notebook instance {model.name} has VPC settings enabled."
)
if not model.vpc_config_subnets:
report.status = "FAIL"
report.status_extended = f"Sagemaker notebook instance {model.name} has VPC settings disabled."
findings.append(report)
return findings