All checks
Medium SageMaker · regional

SageMaker models should have network isolation enabled

Checks that the SageMaker model has network isolation enabled. Inference containers have network access by default; with isolation on, the container can make no inbound or outbound network calls, including to other AWS services, and gets no AWS credentials, so code running in it cannot send data out.

service
SageMaker
severity
Medium
scope
evaluated in every region

How to fix it

  • Replaces the resource: A model cannot be edited: create a new one with isolation on, point each endpoint (through a new endpoint configuration), batch transform job and pipeline step at it, then delete this one.
  • Can break clients: Anything the container fetches while serving, such as code, packages or a licence check, then fails; SageMaker still downloads the model artifacts itself, outside the container.

In the console

SageMaker Studio → Models → Deployable models → Create deployable model → Security → Network isolation

Network isolation
On
Enable network isolation
On, on the Deploy page, where Studio deploys a model only to an endpoint with matching isolation

With the AWS CLI

aws sagemaker create-model --model-name <model-name> --execution-role-arn <execution-role-arn> --primary-container '{"Image":"<inference-image-uri>"}' --enable-network-isolation --region <region>

With Terraform

resource "aws_sagemaker_model" "this" {
  name                     = var.model_name
  execution_role_arn       = var.execution_role_arn
  enable_network_isolation = true

  primary_container {
    image = var.inference_image_uri
  }
}

See which of your accounts this check is failing on.

Book a live scan