Back to Checks
aws

Amazon SageMaker notebook instance has root access disabled

sagemaker_notebook_instance_root_access_disabled
Service: sagemakerSeverity: medium
OfficialBuilt-inVerified
Categories:identity-accessgen-ai
Resource Type:AwsSageMakerNotebookInstance

Amazon SageMaker notebook instances with user root access disabled. The evaluation checks whether interactive users can obtain root privileges on the instance, highlighting notebooks where RootAccess is not set to Disabled.

Risk

Allowing user root access enables full system control, risking integrity (tampering with code, packages, and kernels), confidentiality (reading secrets, credentials, data copies), and availability (disabling agents or breaking environments). Compromise of a notebook can lead to lateral movement via the instance role.

Run this check with Prowler

Run in Prowler Cloud
Run
prowler aws --checks sagemaker_notebook_instance_root_access_disabled

Recommendation

Apply least privilege: set RootAccess to Disabled for notebook users. Provide needed software via managed images or lifecycle automation, not ad-hoc root installs. Limit the notebook IAM role, enforce defense in depth (network isolation and monitoring), and require controlled admin workflows for privileged changes.

Remediation

CLI

aws sagemaker update-notebook-instance --notebook-instance-name <example_resource_name> --root-access Disabled

Terraform

# Terraform: Disable root access on a SageMaker Notebook Instance
resource "aws_sagemaker_notebook_instance" "notebook" {
  name          = "<example_resource_name>"
  role_arn      = "<example_role_arn>"
  instance_type = "ml.t3.medium"
  root_access   = "Disabled"  # Critical: disables user root access to pass the check
}

NativeIaC

# CloudFormation: Disable root access on a SageMaker Notebook Instance
Resources:
  Notebook:
    Type: AWS::SageMaker::NotebookInstance
    Properties:
      InstanceType: ml.t3.medium
      RoleArn: <example_role_arn>
      RootAccess: Disabled  # Critical: disables user root access to pass the check

Other

1In the AWS Console, go to SageMaker > Notebook instances
2Select <example_resource_name> and click Stop if it is running
3After it stops, click Edit
4Set Root access to Disabled
5Save changes, then click Start

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_notebook_instance_root_access_disabled(Check):
    def execute(self):
        findings = []
        for notebook_instance in sagemaker_client.sagemaker_notebook_instances:
            report = Check_Report_AWS(
                metadata=self.metadata(), resource=notebook_instance
            )
            report.status = "PASS"
            report.status_extended = f"Sagemaker notebook instance {notebook_instance.name} has root access disabled."
            if notebook_instance.root_access:
                report.status = "FAIL"
                report.status_extended = f"Sagemaker notebook instance {notebook_instance.name} has root access enabled."

            findings.append(report)

        return findings