客戶自行管理的加密金鑰 (CMEK)

根據預設,Gemini Enterprise Agent Platform Workbench 會加密靜態客戶內容。Agent Platform Workbench 會為您處理加密作業,您不必採取其他動作。這個選項稱為「Google 預設加密機制」。

如要控管加密金鑰,您可以在 Cloud KMS 中使用客戶自行管理的加密金鑰 (CMEK),並搭配整合 CMEK 的服務,包括 Agent Platform Workbench。使用 Cloud KMS 金鑰,即可控管金鑰的保護等級、位置、輪替時間表、使用權限和存取權,以及加密範圍。 使用 Cloud KMS 還可追蹤金鑰使用情形、查看稽核記錄,以及控管金鑰生命週期。 您可以在 Cloud KMS 中控管及管理用於保護資料的對稱金鑰加密金鑰 (KEK),而非由 Google 擁有及管理。

使用 CMEK 設定資源後,存取 Agent Platform Workbench 資源的體驗與使用 Google 預設加密機制類似。如要進一步瞭解加密選項,請參閱「客戶自行管理的加密金鑰 (CMEK)」。

本頁面說明搭配使用 CMEK 與 Gemini Enterprise Agent Platform Workbench 的特定優點和限制,並說明如何設定新的 Agent Platform Workbench 執行個體,以便使用 CMEK。

如要進一步瞭解如何將 CMEK 用於 Gemini Enterprise Agent Platform,請參閱 Agent Platform CMEK 頁面。

CMEK 的優點

一般來說,如果您需要完全控管用於加密資料的金鑰,CMEK 最實用。有了 CMEK,您就能在 Cloud Key Management Service 中管理金鑰。例如,您可以輪替或停用金鑰,也可以使用 Cloud KMS API 設定輪替排程。

執行 Agent Platform Workbench 執行個體時,執行個體會在 Gemini Enterprise Agent Platform Workbench 代管的虛擬機器 (VM) 上執行。為 Agent Platform Workbench 執行個體啟用 CMEK 後,Agent Platform Workbench 會使用您指定的金鑰,而非 Google 代管的金鑰,加密 VM 開機磁碟上的資料。

CMEK 金鑰不會加密與 Agent Platform Workbench 執行個體相關聯的中繼資料,例如執行個體的名稱和區域。與 Agent Platform Workbench 執行個體相關聯的中繼資料,一律會使用 Google 的預設加密機制加密。

CMEK 的限制

為縮短延遲時間,並避免資源依賴分散在多個故障域的服務,Google 建議您使用相同位置的金鑰保護區域性 Agent Platform Workbench 執行個體。

  • 您可以使用相同位置或全域位置的金鑰,加密區域性 Agent Platform Workbench 執行個體。舉例來說,您可以使用 us-west1 或 global 中的金鑰,加密可用區 us-west1-a 磁碟中的資料。
  • 您可以使用任何位置的金鑰,為全域執行個體加密。
  • 為 Agent Platform Workbench 設定 CMEK,不會自動為您使用的其他 Google Cloud 產品設定 CMEK。如要使用 CMEK 加密其他 Google Cloud 產品中的資料,您必須完成其他設定。

為 Agent Platform Workbench 執行個體設定 CMEK

下列各節說明如何在 Cloud KMS 建立金鑰環和金鑰、授予服務帳戶金鑰加密器和解密器權限,以及建立使用 CMEK 的 Agent Platform Workbench 執行個體。

事前準備

建議您採用支援分散權責的設定。如要為 Agent Platform Workbench 設定 CMEK,可以使用兩個獨立的 Google Cloud 專案:

  • Cloud KMS 專案:用於管理加密金鑰
  • Agent Platform Workbench 專案:用於存取 Agent Platform Workbench 執行個體,以及與用途所需的任何其他 Google Cloud 產品互動

或者,您也可以使用單一 Google Cloud 專案。請使用同一個專案執行下列所有工作。

設定 Cloud KMS 專案

  1. 登入 Google Cloud 帳戶。如果您未曾使用過 Google Cloud,歡迎 建立帳戶,親自體驗實際使用我們產品的成效。新客戶還能獲得價值 $300 美元的免費抵免額,用於執行、測試及部署工作負載。
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Cloud KMS API, if it is not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Cloud KMS API, if it is not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

設定 Agent Platform Workbench 專案

  1. 登入 Google Cloud 帳戶。如果您未曾使用過 Google Cloud,歡迎 建立帳戶,親自體驗實際使用我們產品的成效。新客戶還能獲得價值 $300 美元的免費抵免額,用於執行、測試及部署工作負載。
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Notebooks API, if it is not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Notebooks API, if it is not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

設定 Google Cloud CLI

本頁面的部分步驟必須使用 gcloud CLI,其他步驟則可視需要使用。

安裝 Google Cloud CLI。 安裝完成後,請執行下列指令,初始化 Google Cloud CLI:

gcloud init

若您採用的是外部識別資訊提供者 (IdP),請先 使用聯合身分登入 gcloud CLI。

建立金鑰環和金鑰

建立金鑰環和金鑰時,請留意下列規定:

  • 選擇金鑰環的位置時,請使用 global 或 Agent Platform Workbench 執行個體所在的位置。

  • 請務必在 Cloud KMS 專案中建立金鑰環和金鑰。

如要建立金鑰環和金鑰,請參閱「建立對稱式加密金鑰」。

授予 Agent Platform Workbench 權限

如要為 Agent Platform Workbench 執行個體使用 CMEK,您必須授予 Agent Platform Workbench 執行個體權限,允許使用金鑰加密及解密資料。您需要將這項權限授予專案的服務代理和 Compute Engine 服務帳戶。

如要找出 Agent Platform Workbench 專案的特定帳戶,請使用 Google Cloud 控制台。

  1. 前往 Google Cloud 控制台的「IAM」頁面。

    前往「IAM」(身分與存取權管理) 頁面

  2. 勾選「包含 Google 提供的角色授予項目」。

  3. 尋找符合下列電子郵件地址格式的成員。請記下電子郵件地址,並在後續步驟中使用。

    • 專案服務代理的電子郵件地址如下所示:

      service-NOTEBOOKS_PROJECT_NUMBER@gcp-sa-notebooks.iam.gserviceaccount.com
    • Compute Engine 服務帳戶的電子郵件地址應如下所示:

      service-NOTEBOOKS_PROJECT_NUMBER@compute-system.iam.gserviceaccount.com

    將 NOTEBOOKS_PROJECT_NUMBER 替換為 Agent Platform Workbench 專案的專案編號。

    如要授予這些帳戶使用金鑰加密及解密資料的權限,可以使用 Google Cloud 控制台或 gcloud CLI。

    控制台

    1. 前往 Google Cloud 控制台的「Key management」(金鑰管理) 頁面。

      前往「金鑰管理」

    2. 選取 Cloud KMS 專案。

    3. 按一下您在「建立金鑰環和金鑰」中建立的金鑰環名稱。「Key ring details」(金鑰環詳細資料) 頁面隨即開啟。

    4. 勾選您在「建立金鑰環和金鑰」中建立的金鑰核取方塊。如果標有金鑰名稱的資訊面板尚未開啟,請按一下「Show info panel」(顯示資訊面板)。

    5. 在資訊面板中,按一下 「Add member」(新增成員)。「將成員新增至『KEY_NAME』」對話方塊隨即開啟。在這個對話方塊中,執行下列操作:

      1. 在「New members」(新成員) 欄位中,輸入專案服務代理的電子郵件地址:

        service-NOTEBOOKS_PROJECT_NUMBER@gcp-sa-notebooks.iam.gserviceaccount.com
      2. 在「Select a role」(選取角色) 清單中,按一下「Cloud KMS」,然後選取「Cloud KMS CryptoKey Encrypter/Decrypter」(Cloud KMS CryptoKey 加密者/解密者) 角色。

      3. 按一下 [儲存]。

    6. 對 Compute Engine 服務代理重複執行這些步驟:

      service-NOTEBOOKS_PROJECT_NUMBER@compute-system.iam.gserviceaccount.com

    gcloud

    1. 如要授予專案服務代理權限,允許使用金鑰加密及解密資料,請執行下列指令:

      gcloud kms keys add-iam-policy-binding KEY_NAME \
        --keyring=KEY_RING_NAME \
        --location=REGION \
        --project=KMS_PROJECT_ID \
        --member=serviceAccount:service-NOTEBOOKS_PROJECT_NUMBER@gcp-sa-notebooks.iam.gserviceaccount.com \
        --role=roles/cloudkms.cryptoKeyEncrypterDecrypter

      更改下列內容:

      • KEY_NAME:您在「建立金鑰環和金鑰」中建立的金鑰名稱
      • KEY_RING_NAME:您在「建立金鑰環和金鑰」中建立的金鑰環
      • REGION:建立金鑰環的區域
      • KMS_PROJECT_ID:Cloud KMS 專案的 ID
      • NOTEBOOKS_PROJECT_NUMBER:Agent Platform Workbench 專案的專案編號,您在上一節中記下的服務帳戶電子郵件地址中包含這項資訊。
    2. 如要授予 Compute Engine 服務帳戶權限,允許使用您的金鑰加密及解密資料,請執行下列指令:

      gcloud kms keys add-iam-policy-binding KEY_NAME \
        --keyring=KEY_RING_NAME \
        --location=REGION \
        --project=KMS_PROJECT_ID \
        --member=serviceAccount:service-NOTEBOOKS_PROJECT_NUMBER@compute-system.iam.gserviceaccount.com \
        --role=roles/cloudkms.cryptoKeyEncrypterDecrypter

建立使用 CMEK 的 Agent Platform Workbench 執行個體

授予 Agent Platform Workbench 執行個體權限,允許使用金鑰加密及解密資料後,即可建立使用這組金鑰加密資料的 Agent Platform Workbench 執行個體。

以下範例說明如何使用 Google Cloud 控制台,透過金鑰加密及解密資料。

如要使用客戶自行管理的加密金鑰建立 Agent Platform Workbench 執行個體,可以使用 Google Cloud 控制台或 gcloud CLI:

控制台

  1. 前往 Google Cloud 控制台的「Instances」(執行個體) 頁面。

    前往「Instances」(執行個體) 頁面

  2. 按一下「 建立新項目」。

  3. 在「New instance」(新增執行個體) 對話方塊中,按一下「Advanced options」(進階選項)。

  4. 在「Create instance」(建立執行個體) 對話方塊的「Details」(詳細資料) 部分,提供新執行個體的下列資訊:

    • 名稱:新執行個體的名稱
    • 區域:金鑰和金鑰環所在的區域
    • 「Zone」(可用區):所選區域內的可用區
  5. 在「Disks」(磁碟) 區段的「Encryption」(加密) 中,選取「Customer-managed encryption key (CMEK)」(客戶自行管理的加密金鑰 (CMEK))。

  6. 按一下「選取客戶自行管理的金鑰」。

    • 如果清單中有所需的客戶自行管理金鑰,請選取該金鑰。
    • 如果清單中未列出您要使用的客戶自行管理金鑰,請輸入該金鑰的資源 ID。客戶自行管理金鑰的資源 ID 如下所示:

      projects/NOTEBOOKS_PROJECT_NUMBER/locations/REGION/keyRings/KEY_RING_NAME/cryptoKeys/KEY_NAME

      更改下列內容:

      • NOTEBOOKS_PROJECT_NUMBER:Agent Platform Workbench 專案 ID
      • REGION:建立金鑰環的區域,以及您打算建立 Agent Platform Workbench 執行個體的區域
      • KEY_RING_NAME:您在「建立金鑰環和金鑰」中建立的金鑰環
      • KEY_NAME:您在「建立金鑰環和金鑰」中建立的金鑰名稱
  7. 完成執行個體建立對話方塊的其餘部分,然後按一下「Create」(建立)。

gcloud

如要使用 gcloud CLI 建立 Agent Platform Workbench 執行個體,並採用客戶自行管理的加密金鑰,請執行下列指令。本範例假設您要建立 Agent Platform Workbench 執行個體,並使用 n1-standard-1 機型和 100 GB 標準永久開機磁碟。

gcloud notebooks instances create notebook-vm-cmek \
    --location=REGION \
    --vm-image-family=IMAGE_FAMILY \
    --vm-image-project=cloud-notebooks-managed \
    --machine-type="n1-standard-1" \
    --boot-disk-type="PD_STANDARD" \
    --boot-disk-size=100 \
    --kms-key=KEY_NAME \
    --kms-project=KMS_PROJECT_ID \
    --kms-location=REGION \
    --kms-keyring=KEY_RING_NAME \
    --disk-encryption=CMEK \
    --metadata='proxy-mode=project_editors'

更改下列內容:

  • REGION:您建立金鑰環和預計建立 Agent Platform Workbench 執行個體的區域
  • IMAGE_FAMILY:要用來建立 Agent Platform Workbench 執行個體的映像檔系列
  • KEY_NAME:您在「建立金鑰環和金鑰」中建立的金鑰名稱
  • KMS_PROJECT_ID:Cloud KMS 專案的 ID
  • KEY_RING_NAME:您在「建立金鑰環和金鑰」中建立的金鑰環

後續步驟