More Info:
Ensure that Vertex AI notebook instances are encrypted using Customer-Managed Encryption KeysRisk Level
MediumAddress
SecurityCompliance Standards
- CIS GCP
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are the GCP Console steps to ensure Vertex AI notebook instances are encrypted with Customer-Managed Encryption Keys (CMEK). Note that CMEK can only be set at creation time; you cannot convert an existing notebook instance from Google-managed keys to CMEK. For existing notebooks, you must create a new one with CMEK and migrate your work.
If you tell me your notebook type (Managed vs User-Managed) and region, I can tailor the exact screen labels and service account to use.
1. Create (or identify) a CMEK key in Cloud KMS
- In the GCP Console, go to:
Security → Key Management (or search “KMS” in the search bar). - At the top, make sure you are in the same project and region where you will create the Vertex AI notebook.
- Click + Create key ring (if you don’t already have one):
- Name: e.g.,
vertex-ai-notebooks-kr - Location type: Regional
- Location: select the same region you’ll use for the notebook.
- Click Create.
- Name: e.g.,
- In the key ring, click + Create key:
- Key name: e.g.,
vertex-ai-notebooks-key - Key purpose: Symmetric encrypt/decrypt
- Protection level: Software
- Leave default rotation if you don’t have a specific policy.
- Click Create.
- Key name: e.g.,
2. Grant the notebook’s service account access to the key
Vertex AI Notebooks use a service account to access resources. That service account needs Cloud KMS Encrypter/Decrypter on your key.- In the Console, go again to Security → Key Management.
- Click your key ring, then your key.
- Go to the Permissions tab.
- Click Grant access.
- In New principals, add:
- The notebook runtime service account you plan to use (often the Compute Engine default service account):
PROJECT_NUMBER-compute@developer.gserviceaccount.com
or a custom service account you attach to the notebook.
- The notebook runtime service account you plan to use (often the Compute Engine default service account):
- In Roles, add:
- Cloud KMS CryptoKey Encrypter/Decrypter (
roles/cloudkms.cryptoKeyEncrypterDecrypter)
- Cloud KMS CryptoKey Encrypter/Decrypter (
- Click Save.
3. Create a new Vertex AI notebook with CMEK enabled
Steps differ slightly depending on the notebook type, but the CMEK selection is similar.A. For User-Managed Notebooks (legacy instances)
- In the Console, go to:
Vertex AI → Workbench → User-managed notebooks. - Click New notebook.
- Select the environment/image you want (e.g., TensorFlow, PyTorch, etc.).
- In the notebook configuration page:
- Choose Region (must match your KMS key’s region).
- Under Security, look for Encryption.
- Select Customer-managed key.
- Click Browse next to the key field, then choose your KMS key created above.
- Ensure the Service account field matches the service account you granted KMS permissions to.
- Configure other options (machine type, disk, etc.) as needed.
- Click Create.
B. For Managed Notebooks (Vertex AI Workbench Managed)
- In the Console, go to:
Vertex AI → Workbench → Managed notebooks. - Click New notebook.
- Choose a Region (must match your KMS key’s region).
- Configure environment and machine options.
- Under Security (or Advanced options → Security depending on UI version):
- Find Encryption.
- Select Customer-managed key.
- Click Browse and choose your KMS key.
- Confirm the Runtime service account is the one that has KMS permissions.
- Click Create.
4. Migrate from an existing notebook (if needed)
Because encryption cannot be changed in-place:- Open the old notebook.
- Export notebooks and data:
- Save
.ipynbfiles to a Git repo, Cloud Storage, or download locally. - Copy any data from the old persistent disk (e.g., to Cloud Storage).
- Save
- Open the new CMEK-encrypted notebook.
- Import your notebooks and data there.
- When confirmed working, stop and delete the old (non-CMEK) notebook instance.
If you tell me your notebook type (Managed vs User-Managed) and region, I can tailor the exact screen labels and service account to use.
Using CLI
Using CLI
Below are the remediation steps to ensure Vertex AI notebook instances use Customer-Managed Encryption Keys (CMEK) with the gcloud CLI.
Get the full key resource name:
If you use a custom service account for notebooks, set it:
Key flags:
Confirm the
Important: Encryption cannot be changed on an existing notebook instance. You must create a new CMEK-encrypted instance and migrate your work.
1. Set environment variables
2. Create a KMS key ring and key
3. Identify the service account used by the notebook
For Vertex AI Workbench (User-managed notebooks), the default service account is usually the Compute Engine default:4. Grant KMS permissions to the notebook service account
5. Create a CMEK‑encrypted Vertex AI Workbench notebook
A. User-managed notebook instance
--kms-key– applies CMEK to the boot and data disks.--service-account– must match the account granted KMS permissions.
B. Managed notebook runtime (if using Managed Notebooks)
6. Verify the notebook uses CMEK
kmsKey fields match your $KMS_KEY.7. Migrate from existing non‑CMEK notebooks (manual)
- In the existing notebook, back up notebooks/data (e.g., to Cloud Storage or Git).
- Create a new CMEK‑encrypted instance as above.
- Restore your notebooks/data to the new instance.
- Delete the old non‑CMEK instance:
Using Python
Using Python
Below is a concise, end‑to‑end way to ensure Vertex AI notebook instances use CMEK, using Python.Key points:
Assume:
Note the CMEK resource name, e.g.:
Notes:
- CMEK must be set at creation time; you cannot change disk encryption of an existing instance.
- You’ll typically need to (1) create/choose a KMS key, (2) grant the notebook’s service account access to the key, and (3) create the notebook instance with that CMEK.
1. Prerequisites
PROJECT_ID= your GCP projectLOCATION= e.g.us-central1INSTANCE_ID= name for the notebook instanceSERVICE_ACCOUNT= SA that will run the notebook (or use default)
2. Create a CMEK key (Cloud KMS) via Python
3. Grant KMS access to the notebook service account
Vertex AI Notebooks uses a service account (either user‑specified or a Compute Engine default SA). That SA must haveroles/cloudkms.cryptoKeyEncrypterDecrypter on the KMS key.Example using gcloud (easiest):4. Create a Vertex AI Notebook instance with CMEK using Python
For user-managed notebooks (legacy “AI Platform Notebooks” /NotebooksServiceClient):disk_encryption="CMEK"tells GCE to use the KMS key for the boot disk.kms_keymust be in a region compatible with the zone (e.g.us-central1forus-central1-b).
5. For Managed Notebooks (Vertex AI Workbench “managed”)
Managed notebooks use the Vertex AI Notebooks API, but withRuntime/ManagedNotebookService. CMEK is set at the runtime level:6. Migration: existing non‑CMEK notebooks
Because encryption is fixed at disk creation, to “remediate” existing notebooks:- Create a new notebook / runtime with CMEK (as above).
- Migrate data:
- Copy notebooks and data to Cloud Storage (gs://) from old instance.
- Download them from new CMEK‑protected instance.
- Delete the old, non‑CMEK instance and its disks/snapshots.
Using Terraform
Using Terraform
PROJECT_IDwith your GCP project ID.LOCATIONwith the region of the Workbench/Vertex AI notebook and KMS key.KEY_RING_NAMEandVERTEX_NOTEBOOK_CMEK_KEY_NAMEwith your actual KMS key ring and key.VERTEX_NOTEBOOK_INSTANCE_NAMEwith your actual instance name.
kms_key) forces replacement of the instance; Terraform will destroy and recreate it, which can cause downtime and loss of any non‑persisted data on the VM.To verify, terraform plan should show:kms_keybeing added (or changed) in thegce_setupblock of thegoogle_workbench_instanceresource.- No other unrelated changes.

