Check ID: sagemaker_models_vpc_settings_configured
Provider: AWS
Service: sagemaker
Severity: MEDIUM
Categories: trust-boundaries, gen-ai, internet-exposed
Resource type: Other

What this check verifies

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.

Recommendation

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

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
  }
}

References

Where this check fires

This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable by Check ID = sagemaker_models_vpc_settings_configured. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks