Skip to main content

Triage and Remediation

Remediation

Using Console

  1. Log in to the AWS Management Console:
    • Open the AWS Management Console and navigate to the SageMaker service.
  2. Identify Notebook Instances with Root Access Enabled:
    • Go to the “Notebook instances” section.
    • Check each notebook instance for the “Root access” setting. Instances with root access enabled will have it specified in their details.
  3. Disable Root Access:
    • Select the notebook instance you want to modify.
    • Click “Edit.”
    • In the “Notebook instance settings,” find the “Root access” setting and change it to “Disabled.”
    • Save the changes and restart the notebook instance for the changes to take effect.
To disable root access for a SageMaker notebook instance using the AWS CLI, you need to update the RootAccess parameter.Identify and Update Notebook Instances:
To disable root access for SageMaker notebook instances using a Python script, you’ll need the boto3 library:
  1. Install boto3 (if not already installed):
  1. Script to Identify and Update Notebook Instances:
This script will list all notebook instances, describe each one to check its root access setting, and then disable root access for those with it enabled. Finally, it will restart the modified instances to apply the changes.Replace placeholders (<YourNotebookInstanceName>) with appropriate values.
This change updates the existing SageMaker notebook instance configuration so that root access is disabled; AWS requires the instance to be stopped to apply this, which will interrupt active sessions and make the instance unavailable during the update (no resource replacement is required, but a manual stop/start or failed apply/retry cycle is expected).For verification, terraform plan should show the aws_sagemaker_notebook_instance resource with root_access changing from "Enabled" (or omitted/default) to "Disabled" and no -/+ replacement indicator on the resource.