Amazon SageMaker notebook instance has root access disabled
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 Cloudprowler aws --checks sagemaker_notebook_instance_root_access_disabledRecommendation
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 DisabledTerraform
# 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 checkOther
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