More Info:
Ensure that vTPM feature is enabled for your Vertex AI notebook instancesRisk Level
MediumAddress
SecurityCompliance Standards
- CIS GCP
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are the console steps to ensure vTPM is enabled for Vertex AI notebook instances. vTPM is a Shielded VM feature; for many notebook types this is only settable at creation time, so you may need to recreate the instance.
These steps ensure that your Vertex AI Workbench notebook instances are created with vTPM enabled via the GCP console.
1. Check whether vTPM is already enabled
- Go to Vertex AI Workbench
- In the Google Cloud console, open:
Navigation menu → Vertex AI → Workbench
- In the Google Cloud console, open:
- Identify your notebook:
- You’ll see User-managed notebooks and/or Managed notebooks tabs.
- Open the instance details:
- Click the notebook name → in the details pane, look for Shielded VM or Security info.
- If the instance indicates vTPM (or “Shielded VM with vTPM / integrity monitoring”) is enabled, no further action is needed.
- If not visible or disabled, plan to recreate the notebook with vTPM on.
For existing Workbench instances, Shielded VM/vTPM settings generally cannot be changed in place. You must create a new notebook instance with vTPM enabled.
2. Create a new Vertex AI notebook with vTPM enabled
A. Managed notebooks
- In the console, go to
Navigation menu → Vertex AI → Workbench → Managed notebooks. - Click New notebook (or Create notebook) and choose the image/type you need.
- In the creation page, expand Environment, then Advanced options or Security (the naming can differ slightly):
- Look for Shielded VM options.
- Enable:
- Turn on vTPM (or Virtual Trusted Platform Module (vTPM)).
- Optionally also enable Integrity monitoring (recommended).
- Configure other settings (machine type, region, disk, etc.).
- Click Create.
B. User-managed notebooks
- In the console, go to
Navigation menu → Vertex AI → Workbench → User-managed notebooks. - Click New notebook → select the image/framework and region/zone.
- On the creation page, expand Machine configuration or Security / Shielded VM section:
- Check the box for Enable Shielded VM options if present.
- Enable vTPM (sometimes presented as “Turn on vTPM”).
- Optionally enable Integrity monitoring.
- Finish configuring instance details and click Create.
3. Migrate data / notebooks from old instance (if needed)
- Start both the old and new notebook instances.
- From JupyterLab (or SSH), copy:
- Notebook files (
.ipynb), scripts, and data from the old instance to:- A Cloud Storage bucket, or
- Directly to the new instance using
gsutil,scp, or Jupyter file upload.
- Notebook files (
- Once migration is confirmed, you can delete the old notebook instance.
These steps ensure that your Vertex AI Workbench notebook instances are created with vTPM enabled via the GCP console.
Using CLI
Using CLI
In Vertex AI Workbench, vTPM is controlled by the Shielded VM settings of the notebook instance. You cannot toggle vTPM on/off for an existing notebook; you must create (or recreate) the instance with vTPM enabled.Below are CLI steps for both User‑managed and Managed notebooks.
To inspect a specific instance’s Shielded VM config:If
Key flag:
Migrate your notebooks/code from the old managed instance to the new one, then delete the old instance.
If you share the output of
1. Identify notebook instances missing vTPM
List all Workbench instances in a region:enableVtpm: true is not present, vTPM is not enabled.2. Recreate a User‑managed notebook with vTPM enabled
- Stop and delete the old instance (do not delete attached disks you need):
- Recreate a new instance with Shielded VM + vTPM:
--shielded-vtpm (enables vTPM).If you have an existing persistent disk you want to attach, use the relevant --boot-disk-* flags when creating the instance (or recreate using the same config as the previous instance).3. Recreate a Managed notebook with vTPM enabled
Managed notebooks are also backed by Shielded VMs; you must create them with vTPM:If you share the output of
gcloud notebooks instances describe for one of your current instances, I can give an exact gcloud notebooks instances create command matching its configuration but with vTPM enabled.Using Python
Using Python
Below are concrete steps and a Python example to enable vTPM (Shielded VM) on Vertex AI Workbench (Vertex AI Notebooks) instances.Assumptions:
If you get an error that and you construct:Use the one that matches your instance type (see the error message / object fields from
This pattern can be wrapped in a loop to remediate multiple instances.
- You’re using Vertex AI Workbench user-managed or managed notebooks (Notebooks API).
- You have
roles/notebooks.admin(or equivalent) and appropriate project permissions. gcloud auth application-default loginhas been run or you’re running in a GCP environment with a service account.
1. Install and import the Notebooks client library
2. Helper: wait for long‑running operations
3. Stop the instance (must be TERMINATED to change Shielded settings)
4. Patch the instance to enable vTPM
For Vertex AI Workbench (Notebooks API), the Shielded VM config is undergce_setup.shielded_instance_config for Workbench instances, or vm_image/container_image for older ones. The common field in the Notebooks API is:gce_setup.shielded_instance_config.enable_vtpm
gce_setup doesn’t exist (older notebook type), the path may instead be:client.get_instance).5. Start the instance again
6. Full remediation script (single instance)
7. Verification (optional, via Python)
Using Terraform
Using Terraform
VERTEX_NOTEBOOK_INSTANCE_NAMEwith your Vertex AI Workbench instance name.REGION,PROJECT_ID,MACHINE_TYPE,BOOT_DISK_TYPE,BOOT_DISK_SIZE_GB,NETWORK_SELF_LINK_OR_NAME,SUBNETWORK_SELF_LINK_OR_NAME, andSERVICE_ACCOUNT_EMAILwith your values.
shielded_instance_config.enable_vtpm from false to true may force replacement of the underlying VM, causing a brief outage when Terraform recreates the instance.For verification, terraform plan should show enable_vtpm changing from false (or being added) to true in the shielded_instance_config of google_workbench_instance.vertex_ai_notebook (and, if the provider marks it ForceNew, a planned -/+ replacement of the resource).
