By default, Vertex AI Workbench encrypts customer content at rest. Vertex AI Workbench handles encryption for you without any additional actions on your part. This option is called Google default encryption.
If you want to control your encryption keys, then you can use customer-managed encryption keys (CMEKs) in Cloud KMS with CMEK-integrated services including Vertex AI Workbench. Using Cloud KMS keys gives you control over their protection level, location, rotation schedule, usage and access permissions, and cryptographic boundaries. Using Cloud KMS also lets you view audit logs and control key life cycles. Instead of Google owning and managing the symmetric key encryption keys (KEKs) that protect your data, you control and manage these keys in Cloud KMS.
After you set up your resources with CMEKs, the experience of accessing your Vertex AI Workbench resources is similar to using Google default encryption. For more information about your encryption options, see Customer-managed encryption keys (CMEK).
This page describes some specific benefits and limitations of using CMEK with managed notebooks and shows how to configure a new managed notebooks instance to use CMEK.
Benefits of CMEK
In general, CMEK is most useful if you need full control over the keys used to encrypt your data. With CMEK, you can manage your keys within Cloud Key Management Service. For example, you can rotate or disable a key or you can set up a rotation schedule by using the Cloud KMS API.
When you run a managed notebooks instance, your instance runs in a compute infrastructure managed by Google. When you enable CMEK for a managed notebooks instance, Vertex AI Workbench uses the key that you designate, rather than a key managed by Google, to encrypt your user data.
The CMEK key doesn't encrypt metadata, like the instance's name and region, associated with your managed notebooks instance. Metadata associated with managed notebooks instances is always encrypted using Google's default encryption mechanism.
Limitations of CMEK
To decrease latency and to prevent cases where resources depend on services that are spread across multiple failure domains, Google recommends that you protect regional managed notebooks instances with keys in the same location.
- You can encrypt regional managed notebooks instances
by using keys in the same location or in the global location. For example,
you can encrypt user data in region
us-west1
by using a key inus-west1
orglobal
. - Configuring CMEK for managed notebooks doesn't automatically configure CMEK for other Google Cloud products that you use. To use CMEK to encrypt data in other Google Cloud products, you must complete additional configuration.
Configure CMEK for your managed notebooks instance
The following sections describe how to create a key ring and key in Cloud Key Management Service, grant the service account encrypter and decrypter permissions for your key, and create a managed notebooks instance that uses CMEK.
Before you begin
We recommend using a setup that supports a separation of duties. To configure CMEK for managed notebooks, you can use two separate Google Cloud projects:
- A Cloud KMS project: a project for managing your encryption key
- A managed notebooks project: a project for accessing managed notebooks instances and interacting with any other Google Cloud products that you need for your use case
Alternatively, you can use a single Google Cloud project. To do so, use the same project for all of the following tasks.
Set up the Cloud KMS project
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Cloud KMS API.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Cloud KMS API.
Set up the managed notebooks project
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Notebooks API.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Notebooks API.
Set up the Google Cloud CLI
The gcloud CLI is required for some steps on this page and optional for others.Install the Google Cloud CLI, then initialize it by running the following command:
gcloud init
Create a key ring and key
When you create a key ring and key, keep the following requirements in mind:
When you choose your key ring's location, use either
global
or the location where your managed notebooks instance will be.Make sure to create your key ring and key in your Cloud KMS project.
To create a key ring and a key, see Create symmetric encryption keys.
Grant managed notebooks permissions
If you set up your instance with single user access, you must grant your managed notebooks instance's project permission to encrypt and decrypt data using your key. You grant this permission to your project's service agent. This service agent's email address looks like:
service-NOTEBOOKS_PROJECT_NUMBER@gcp-sa-notebooks.iam.gserviceaccount.com
Replace NOTEBOOKS_PROJECT_NUMBER
with the
project number
for your managed notebooks instance's project.
Make note of the email address for your service agent. You will use it in the following steps to grant your managed notebooks instance's project permission to encrypt and decrypt data using your key. You can grant permission by using the Google Cloud console or by using the Google Cloud CLI.
Console
In the Google Cloud console, go to the Key management page.
Select your Cloud KMS project.
Click the name of the key ring that you created in Create a key ring and key. The Key ring details page opens.
Select the checkbox for the key that you created in Create a key ring and key. If an info panel labeled with the name of your key isn't already open, click Show info panel.
In the info panel, click
Add member. The Add members to "KEY_NAME" dialog opens. In this dialog, do the following:In the New members field, enter the service agent email address that you made a note of in the preceding section.
In the Select a role list, click Cloud KMS and then select the Cloud KMS CryptoKey Encrypter/Decrypter role.
Click Save.
gcloud
Run the following command to grant the service agent permission to encrypt and decrypt data using your key:
gcloud kms keys add-iam-policy-binding KEY_NAME \ --keyring=KEY_RING_NAME \ --location=REGION \ --project=KMS_PROJECT_ID \ --member=serviceAccount:EMAIL_ADDRESS \ --role=roles/cloudkms.cryptoKeyEncrypterDecrypter
Replace the following:
KEY_NAME
: the name of the key that you created in Create a key ring and keyKEY_RING_NAME
: the key ring that you created in Create a key ring and keyREGION
: the region where you created your key ringKMS_PROJECT_ID
: the ID of your Cloud KMS projectEMAIL_ADDRESS
: the email address of the service agent that you made note of in the previous section
Create a managed notebooks instance with CMEK
After you have granted your managed notebooks instance permission to encrypt and decrypt data using your key, you can create a managed notebooks instance that encrypts data using this key. Use the following steps:
In the Google Cloud console, go to the Managed notebooks page.
Click
New notebook.In the Notebook name field, enter a name for your instance.
Click the Region list, and select a region for your instance.
Click Advanced settings.
In the Disk encryption section, select Customer-managed encryption key (CMEK).
Click Select a customer-managed key.
If the customer-managed key that you want to use is in the list, select it.
If the customer-managed key that you want to use isn't in the list, enter the resource ID for your customer-managed key. The resource ID for your customer-managed key looks like this:
projects/NOTEBOOKS_PROJECT_NUMBER/locations/global/keyRings/KEY_RING_NAME/cryptoKeys/KEY_NAME
Replace the following:
NOTEBOOKS_PROJECT_NUMBER
: the ID of your managed notebooks projectKEY_RING_NAME
: the key ring that you created in Create a key ring and keyKEY_NAME
: the name of the key that you created in Create a key ring and key
Complete the rest of the Create a managed notebook dialog according to your needs.
Click Create.
Vertex AI Workbench creates a managed notebooks instance based on your specified properties and automatically starts the instance. When the instance is ready to use, Vertex AI Workbench activates an Open JupyterLab link.
What's next
Learn more about CMEK on Google Cloud