Check ID: sagemaker_notebook_instance_without_direct_internet_access_configured
Provider: AWS
Service: sagemaker
Severity: HIGH
Categories: internet-exposed, trust-boundaries, gen-ai
Resource type: AwsSageMakerNotebookInstance

What this check verifies

Amazon SageMaker notebook instances are evaluated for the DirectInternetAccess setting. Instances with it disabled use only VPC connectivity; instances with it enabled permit direct outbound internet access.

Risk

Direct internet access from notebooks weakens egress control, risking confidentiality and integrity. Adversaries or unvetted code can exfiltrate data, download malware, or run command-and-control. Public package installs bypass inspection, enabling supply-chain tampering and lateral movement from compromised sessions.

Recommendation

Disable direct internet access (DirectInternetAccess: Disabled) and place notebooks in private subnets. Use VPC endpoints/PrivateLink for required services, restrict egress with allowlists and least privilege security groups, and apply defense in depth with network isolation and monitoring of outbound traffic.

Remediation

# SageMaker notebook with direct internet access disabled
resource "aws_sagemaker_notebook_instance" "<example_resource_name>" {
  name                = "<example_resource_name>"
  role_arn            = "<example_role_arn>"
  instance_type       = "ml.t3.medium"
  subnet_id           = "<example_subnet_id>"          # Required when disabling direct internet access
  security_groups     = ["<example_security_group_id>"] # Required when disabling direct internet access

  direct_internet_access = "Disabled" # CRITICAL: disables direct internet access to pass the check
}

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