Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
In Vertex AI Workbench, “no root” is a creation‑time setting. You can’t flip an existing instance from root-enabled to root-disabled; you must recreate it with root disabled.Below are console steps to (1) identify notebooks, (2) recreate them with root access disabled, and (3) clean up.
1. Identify existing Vertex AI notebook instances
- Go to Google Cloud console: https://console.cloud.google.com
- Make sure you’re in the correct project (top-left project selector).
- Navigate to Vertex AI → Workbench (or Vertex AI > Workbench > User-managed notebooks, depending on UI).
- In the Instances list, note each notebook instance that should not allow root access.
2. Back up any work from existing instances
For each instance:- Click the instance name to open details.
- Open JupyterLab or Jupyter from the console link.
- Export notebooks and scripts:
- Download notebooks locally, or
- Commit them to a repo, or
- Copy them to a shared location (e.g., Cloud Storage bucket).
3. Create a new notebook instance with root access disabled
You must do this per notebook you want to lock down.- In Vertex AI → Workbench, click New Notebook (or Create).
- Choose the appropriate type (Managed / User-managed) and framework (JupyterLab, TensorFlow, etc.), matching the original environment as closely as needed.
- In the creation wizard, expand Advanced options or Security / Permissions (label may vary slightly).
- Locate the setting similar to:
- Disable root access, or
- Disallow root login / sudo
- Check or enable the option to disable root access.
- Configure:
- Region / zone
- Machine type
- GPU, if applicable
- Disk size to match or appropriately replace the original instance.
- Click Create and wait for the instance to be ready.
4. Restore notebooks and verify no-root behavior
- From the new instance’s row in Workbench, click Open JupyterLab/Jupyter.
- Upload your previously backed-up notebooks/scripts or pull them from your repo / Cloud Storage.
- Verify root is disabled:
- Open a Terminal in Jupyter.
- Run:
- You should:
- Be a non-root user (
jupyter,user, etc.). - See
sudounavailable or permission denied (no root escalation possible).
- Be a non-root user (
5. Decommission old root-enabled instances
After confirming the new instance works:- Return to Vertex AI → Workbench.
- Select the old root-enabled instance.
- Click Stop (optional) and then Delete.
- Confirm deletion.
6. Enforce this for future notebooks (process / policy)
While not strictly a console click, you should:- Document a process that all new Vertex AI notebooks must be created with root access disabled.
- If you use infrastructure-as-code (e.g., Terraform/Deployment Manager), encode:
disable_root: true(or equivalent flag) in your notebook resource definitions.
- Optionally restrict who can create Workbench instances via IAM so only a controlled group can create them with the right settings.
Using CLI
Using CLI
In Vertex AI Workbench, “disabling root access” is controlled by a boolean setting on the notebook instance. You cannot turn off root on a running instance; you must recreate it with root access disabled.Below is how to do it with
Note the
Save/record relevant fields:
If you use a VM image instead of a container:Adjust flags as needed (GPU, network, etc.) to match your previous configuration.
Ensure it returns
gcloud for Managed Notebooks.1. List existing notebook instances
INSTANCE_ID and REGION of the instance you want to recreate.2. Capture the current instance configuration
Describe the existing instance so you can recreate it with the same settings (machine type, GPUs, etc.):machineTypeacceleratorConfig(if any)bootDiskType,bootDiskSizeGbnetwork/subnetserviceAccountcontainerImageorvmImageinfo- Any other custom settings you rely on.
3. Stop and delete the current instance
4. Recreate the instance with root access disabled
Use the same config you captured in step 2, but ensure root access is disabled via the--no-enable-root-access flag.Example (adapt with your values):5. Verify root is disabled
After creation:False. Root access is now disabled for this Vertex AI notebook instance.Using Python
Using Python
In Vertex AI Workbench (user‑managed notebooks), root access is controlled by the
Make sure your ADC is set to a principal with permission:
This will:
Run per region you use.
4. Enforce
If you tell me whether you use user‑managed or managed notebooks across your project, I can tailor this to your exact setup and add policy/guardrails (e.g., org policy + CI checks).
disable_root flag on the notebook instance. You remediate by updating existing instances to set disable_root = True (and enforce it on all new ones).Below is a minimal, step‑by‑step Python approach using the Notebooks API.1. Install and authenticate
notebooks.instances.getnotebooks.instances.update
2. Disable root on a single Notebook instance
Replace:YOUR_PROJECT_IDYOUR_REGION(e.g.us-central1)YOUR_INSTANCE_ID(Notebook instance name, not full path)
- Patch only the
disable_rootfield. - Restart/update the instance as required by the service (it may take a few minutes).
3. Disable root on all existing instances in a region
4. Enforce disable_root on new instances (creation example)
If you tell me whether you use user‑managed or managed notebooks across your project, I can tailor this to your exact setup and add policy/guardrails (e.g., org policy + CI checks).
Using Terraform
Using Terraform
terraform plan will show no arguments or changes related to a “disable root access” setting, because none exist in the provider.
