# Ensure Amazon SageMaker models have VPC settings configured

- Source: https://support.icompaas.com/support/solutions/articles/a_1793292223608304-ensure-amazon-sagemaker-models-have-vpc-settings-configured
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [AWS_Checks_v5.39.1](https://support.icompaas.com/support/solutions/c_1793285913477877) › [AWS Checks](https://support.icompaas.com/support/solutions/folders/f_1793287194371224)
- Last updated: 2026-10-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Description**

Ensure that every Amazon SageMaker model has VPC settings configured, with at least one subnet and security group in its VpcConfig. With VPC settings, the model's inference containers connect through your VPC instead of the public internet, so their network access can be controlled with security groups, route tables and VPC endpoints.

**Rationale**

Without VPC isolation, model traffic and data access can go over public network paths, which increases the risk of interception and misrouting. It also removes the access control provided by security groups and private endpoints, so a compromised container could send data to any destination or reach command-and-control servers. Running models in private subnets with restrictive security groups and VPC endpoints for Amazon S3 and the SageMaker runtime limits outbound traffic to approved destinations.

**Impact**

-   Places inference containers in your VPC, where traffic is controlled by security groups and route tables
    
-   Reduces the risk of data exfiltration from compromised containers
    
-   VPC settings cannot be added to an existing model, so a new model, endpoint configuration and endpoint update are required
    
-   The subnets must provide access to Amazon S3 and Amazon ECR (through VPC endpoints or a NAT gateway), or model loading will fail
    

**Default Value**

A SageMaker model has no VPC configuration unless subnets and security groups are specified when it is created. VPC settings cannot be changed after the model is created.

**Pre-Requisites**

-   IAM permissions: sagemaker:ListModels, sagemaker:DescribeModel, sagemaker:CreateModel, sagemaker:DeleteModel, sagemaker:CreateEndpointConfig, sagemaker:UpdateEndpoint and iam:PassRole
    
-   A VPC with private subnets and a security group for the model containers
    
-   VPC endpoints (or a NAT gateway) so that the containers can reach Amazon S3 and Amazon ECR
    
-   The execution role must allow the network interface actions SageMaker needs, such as ec2:CreateNetworkInterface and ec2:DescribeSubnets
    

**Remediation**

**Test Plan**

**Console:**

1.  Sign in to the AWS Management Console at [https://console.aws.amazon.com](https://console.aws.amazon.com/).
    
2.  Open the Amazon SageMaker AI console and select **Models** under **Inference**.
    
3.  Select a model and review its network settings.
    
4.  Check that a VPC with at least one subnet is configured.
    
5.  Repeat for each model in each region in use.
    
6.  If any model has no VPC subnets, follow the implementation steps.
    

**CLI:**

List the models in a region:

aws sagemaker list-models --region <REGION> --query "Models\[\].ModelName"

Show the VPC settings of a model:

aws sagemaker describe-model --region <REGION> --model-name <MODEL\_NAME> --query "VpcConfig"

A model fails if the output is null or contains no Subnets.

**Implementation Steps**

**Console:**

1.  Sign in to the AWS Management Console at [https://console.aws.amazon.com](https://console.aws.amazon.com/).
    
2.  Open the Amazon SageMaker AI console and select **Models** under **Inference**.
    
3.  Open the model and note its container image, model artifacts location and execution role.
    
4.  Choose **Create model** and enter a new model name.
    
5.  Select the same execution role and container settings as the original model.
    
6.  In the network section, select a VPC, then choose at least one subnet and one security group.
    
7.  Choose **Create model**.
    
8.  If the original model is used by an endpoint, create a new endpoint configuration that uses the new model and update the endpoint to use it.
    
9.  When the new model works as expected, delete the original model.
    
10.  Repeat for each affected model in each region in use.
     

**Backout Plan**

Before making changes, save the current model definition:

aws sagemaker describe-model --region <REGION> --model-name <MODEL\_NAME> > <MODEL\_NAME>-backup.json

To roll back:

1.  Sign in to the AWS Management Console at [https://console.aws.amazon.com](https://console.aws.amazon.com/).
    
2.  Open the Amazon SageMaker AI console.
    
3.  If the original model was deleted, recreate it from the saved backup without VPC settings.
    
4.  Update the endpoint to use the previous endpoint configuration (or a new one that uses the original model).
    
5.  Delete the new model if it is no longer needed.
    

Note: rolling back removes the network isolation of the model containers.

**Reference**

-   [https://docs.aws.amazon.com/sagemaker/latest/dg/host-vpc.html](https://docs.aws.amazon.com/sagemaker/latest/dg/host-vpc.html)
    
-   [https://docs.aws.amazon.com/sagemaker/latest/dg/interface-vpc-endpoint.html](https://docs.aws.amazon.com/sagemaker/latest/dg/interface-vpc-endpoint.html)
    
-   [https://docs.aws.amazon.com/cli/latest/reference/sagemaker/describe-model.html](https://docs.aws.amazon.com/cli/latest/reference/sagemaker/describe-model.html)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
