Skip to main content

Triage and Remediation

Remediation

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

  1. Go to Google Cloud console: https://console.cloud.google.com
  2. Make sure you’re in the correct project (top-left project selector).
  3. Navigate to Vertex AIWorkbench (or Vertex AI > Workbench > User-managed notebooks, depending on UI).
  4. 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:
  1. Click the instance name to open details.
  2. Open JupyterLab or Jupyter from the console link.
  3. 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).
If you have data stored on the boot disk, ensure that data is backed up (e.g., copy to Cloud Storage).

3. Create a new notebook instance with root access disabled

You must do this per notebook you want to lock down.
  1. In Vertex AI → Workbench, click New Notebook (or Create).
  2. Choose the appropriate type (Managed / User-managed) and framework (JupyterLab, TensorFlow, etc.), matching the original environment as closely as needed.
  3. In the creation wizard, expand Advanced options or Security / Permissions (label may vary slightly).
  4. Locate the setting similar to:
    • Disable root access, or
    • Disallow root login / sudo
  5. Check or enable the option to disable root access.
  6. Configure:
    • Region / zone
    • Machine type
    • GPU, if applicable
    • Disk size to match or appropriately replace the original instance.
  7. Click Create and wait for the instance to be ready.

4. Restore notebooks and verify no-root behavior

  1. From the new instance’s row in Workbench, click Open JupyterLab/Jupyter.
  2. Upload your previously backed-up notebooks/scripts or pull them from your repo / Cloud Storage.
  3. Verify root is disabled:
    • Open a Terminal in Jupyter.
    • Run:
    • You should:
      • Be a non-root user (jupyter, user, etc.).
      • See sudo unavailable or permission denied (no root escalation possible).
If root is still available, confirm you created the instance with the “disable root access” flag; if not, you’ll need to recreate it again with the setting correctly applied.

5. Decommission old root-enabled instances

After confirming the new instance works:
  1. Return to Vertex AI → Workbench.
  2. Select the old root-enabled instance.
  3. Click Stop (optional) and then Delete.
  4. Confirm deletion.
Repeat for all remaining instances that should not allow root access.

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.
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 gcloud for Managed Notebooks.

1. List existing notebook instances

Note the 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.):
Save/record relevant fields:
  • machineType
  • acceleratorConfig (if any)
  • bootDiskType, bootDiskSizeGb
  • network / subnet
  • serviceAccount
  • containerImage or vmImage info
  • 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):
If you use a VM image instead of a container:
Adjust flags as needed (GPU, network, etc.) to match your previous configuration.

5. Verify root is disabled

After creation:
Ensure it returns False. Root access is now disabled for this Vertex AI notebook instance.
In Vertex AI Workbench (user‑managed notebooks), root access is controlled by the 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

Make sure your ADC is set to a principal with permission:
  • notebooks.instances.get
  • notebooks.instances.update

2. Disable root on a single Notebook instance

Replace:
  • YOUR_PROJECT_ID
  • YOUR_REGION (e.g. us-central1)
  • YOUR_INSTANCE_ID (Notebook instance name, not full path)
This will:
  • Patch only the disable_root field.
  • 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

Run per region you use.

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).
Disabling root access inside the notebook VM for Vertex AI Workbench is not currently exposed via Terraform; you must apply this control through the Google Cloud Console (Workbench instance security settings) or via OS policy/organization policies outside Terraform. To verify, terraform plan will show no arguments or changes related to a “disable root access” setting, because none exist in the provider.