本頁說明如何使用 身分與存取權管理 (IAM) 管理 Vertex AI 資源的存取權。如要管理 Vertex AI Workbench 執行個體的存取權,請參閱「Vertex AI Workbench 執行個體存取控管」。
總覽
Vertex AI 會使用 IAM 管理資源存取權。規劃資源的存取權控管時,請考量下列事項:
您可以管理專案層級或資源層級的存取權。專案層級存取權會套用至該專案中的所有資源。特定資源的存取權僅適用於該資源。請參閱「專案層級存取權與資源層級存取權」。
您可以將 IAM 角色指派給主體,藉此授予存取權。您可以使用預先定義的角色,輕鬆設定存取權,但建議您建立自訂角色,這樣您就能限制角色的存取權,只授予必要的權限。請參閱「身分與存取權管理角色」。
IAM 角色
在 Vertex AI 中可以使用不同類型的 IAM 角色:
自訂角色可讓您選擇特定的一組權限,使用這些權限建立您自己的角色,然後將該角色授予機構中的使用者。
預先定義的角色可讓您在專案層級為 Vertex AI 資源授予一組相關權限。
基本角色 (擁有者、編輯者和檢視者) 可在專案層級提供 Vertex AI 資源存取權控管功能,且適用於所有 Google Cloud 服務。
如要在 Vertex AI 專案中新增、更新或移除這些角色,請參閱授予、變更及撤銷存取權的說明文件。
自訂角色
您可以使用自訂角色選擇特定權限組合,並使用這些權限建立自己的角色,然後將該角色授予機構中的使用者。詳情請參閱「瞭解身分與存取權管理自訂角色」。
使用自訂角色授予最低權限
預先定義的角色通常會包含您不需要的權限。您可以建立自訂角色,只授予主體所需的特定權限。
舉例來說,您可以建立具有 aiplatform.endpoints.predict
權限的自訂角色,然後將該角色指派給端點的服務帳戶。這麼做可讓服務帳戶呼叫端點進行預測,但無法控制端點。
Vertex AI 的預先定義角色
Role | Permissions |
---|---|
Vertex AI Administrator( Grants full access to all resources in Vertex AI |
|
Vertex AI Batch Prediction Service Agent( Vertex AI Batch Prediction Service Agent for serving batch prediction requests. |
|
Colab Enterprise Admin( Admin role of using colab enterprise. |
|
Colab Enterprise User( User role of using colab enterprise. |
|
Vertex AI Colab Service Agent( Gives Vertex AI Colab the proper permissions to function. |
|
Vertex AI Custom Code Service Agent( Gives Vertex AI Custom Code the proper permissions. |
|
Vertex AI Feature Store EntityType owner( Provides full access to all permissions for a particular entity type resource. Lowest-level resources where you can grant this role:
|
|
Vertex AI Platform Express Admin Beta( Grants admin access to Vertex AI Express |
|
Vertex AI Platform Express User Beta( Grants user access to Vertex AI Express |
|
Vertex AI Extension Custom Code Service Agent( Gives Vertex AI Extension that executes custom code the permissions it needs to function. |
|
Vertex AI Extension Service Agent( Gives Vertex AI Extension the permissions it needs to function. |
|
Vertex AI Feature Store Admin( Grants full access to all resources in Vertex AI Feature Store Lowest-level resources where you can grant this role:
|
|
Vertex AI Feature Store Data Viewer( This role provides permissions to read Feature data. Lowest-level resources where you can grant this role:
|
|
Vertex AI Feature Store Data Writer( This role provides permissions to read and write Feature data. Lowest-level resources where you can grant this role:
|
|
Vertex AI Feature Store Instance Creator( Administrator of Featurestore resources, but not the child resources under Featurestores. Lowest-level resources where you can grant this role:
|
|
Vertex AI Feature Store Resource Viewer( Viewer of all resources in Vertex AI Feature Store but cannot make changes. Lowest-level resources where you can grant this role:
|
|
Vertex AI Feature Store User Beta( Deprecated. Use featurestoreAdmin instead. |
|
Vertex AI Migration Service User( Grants access to use migration service in Vertex AI |
|
Vertex AI Model Monitoring Service Agent( Gives Vertex AI Model Monitoring the permissions it needs to function. |
|
Notebook Executor User Beta( Grants users full access to schedules and notebook execution jobs. |
|
Notebook Runtime Admin( Grants full access to all runtime templates and runtimes in Notebook Service. |
|
Notebook Runtime User( Grants users permissions to create runtime resources using a runtime template and manage the runtime resources they created. |
|
Vertex AI Notebook Service Agent( Vertex AI Service Agent used to run Notebook managed resources in user project with restricted permissions. |
|
Vertex AI Online Prediction Service Agent( Gives Vertex AI Online Prediction the permissions it needs to function. |
|
Vertex AI Platform Provisioned Throughput Admin Beta( Grants access to use all resources related to Vertex AI Provisioned Throughput |
|
Vertex AI RAG Data Service Agent( Vertex AI Service Agent used by Vertex RAG to access user imported data, Vertex AI, Document AI processors in the project |
|
Vertex AI Rapid Eval Service Agent( Vertex AI Service Agent used by GenAI Rapid Evaluation Service to access publisher model endpoints in the user project |
|
Vertex AI Reasoning Engine Service Agent( Gives Vertex AI Reasoning Engine the proper permissions to function. |
|
Vertex AI Service Agent( Gives Vertex AI the permissions it needs to function. |
|
Vertex AI Tensorboard Web App User Beta( Grants access to the Vertex AI TensorBoard web app. |
|
Vertex AI Tuning Service Agent( Vertex AI Service Agent used for tuning in user project. |
|
Vertex AI User( Grants access to use all resource in Vertex AI |
|
Vertex AI Viewer( Grants access to view all resource in Vertex AI |
|
基本角色
舊版 Google Cloud 基本角色是所有 Google Cloud 服務通用的角色。這些角色包括「擁有者」、「編輯者」和「檢視者」。
專案層級存取權與資源層級存取權
您可以管理專案層級或資源層級的存取權。您也可能可以在資料夾或機構層級管理存取權。
對於大多數 Vertex AI 資源,存取權只能由專案、資料夾和機構控制。您只能針對特定資源類型 (例如端點或 Featurestore) 授予個別資源的存取權。
使用者可共用自己可存取的所有資源。舉例來說,如果使用者註冊模型,專案中所有其他已授權使用者都能存取、變更及刪除該模型。
如要授予專案層級資源的存取權,請將一或多個角色指派給實體 (使用者、群組或服務帳戶)。
如果 Vertex AI 資源可讓您在資源層級授予存取權,您就必須為該資源設定 IAM 政策。政策會定義要將哪些角色指派給哪些主體。
在資源層級設定政策不會影響專案層級政策。資源會繼承其祖系的所有政策。您可以利用這兩個層級的精細程度來自訂權限。舉例來說,您可以在專案層級授予使用者讀取權限,讓他們讀取專案中的所有資源,然後再授予使用者個別資源的寫入權限 (在資源層級)。
並非所有 Vertex AI 預先定義角色和資源都支援資源層級政策。如要瞭解哪些角色可用於哪些資源,請參閱預先定義角色表格。
支援的資源
Vertex AI 支援 Vertex AI 特徵儲存庫特徵儲存庫和實體類型資源。詳情請參閱「控管 Vertex AI 特徵儲存庫資源的存取權」。
授予或撤銷資源存取權後,這些變更需要一段時間才能生效。詳情請參閱「存取權變更傳播」。
資源、服務帳戶和服務代理
Vertex AI 服務通常會管理執行動作的長時間運作資源,例如執行可讀取訓練資料的訓練工作,或提供可讀取模型權重的機器學習 (ML) 模型。這類獨立資源在執行動作時,會擁有自己的資源身分。這個身分與建立資源的主體身分不同。授予資源身分的權限會定義資源身分可存取哪些資料和其他資源,而非建立資源的實體的權限。
根據預設,Vertex AI 資源會使用由 Vertex AI 管理的服務帳戶做為資源身分識別資訊。這些服務帳戶稱為 Vertex AI 服務代理,並附加至建立資源的專案。擁有特定 Vertex AI 權限的使用者,可以建立使用 Vertex AI 服務代理的資源。對於某些服務,您可以指定要附加至資源的服務帳戶。資源會使用這個服務帳戶存取其他資源和服務。如要進一步瞭解服務帳戶,請參閱「服務帳戶」。
Vertex AI 會根據呼叫的 API 使用不同的服務代理。每個服務代理在綁定的專案中都有特定的 IAM 權限。資源身分識別會使用這些權限執行動作,這些權限可能包括對專案中所有 Cloud Storage 資源和 BigQuery 資料的唯讀存取權。
服務帳戶
服務帳戶是應用程式或虛擬機器 (VM) 執行個體使用的特殊帳戶,而非真人。您可以為服務帳戶建立及指派權限,為資源或應用程式提供特定權限。
如要瞭解如何使用服務帳戶,為自訂訓練容器或為自訂訓練模型提供線上預測服務的容器自訂可用的權限,請參閱「使用自訂服務帳戶」。
服務帳戶會透過電子郵件地址來識別。
服務代理
系統會自動提供服務代理,讓服務代您存取資源。
建立服務代理人時,系統會為服務代理人授予專案的預先定義角色。下表列出 Vertex AI 服務專員、他們的電子郵件地址和各自的角色:
名稱 | 適用於: | 電子郵件地址 | 角色 |
---|---|---|---|
Vertex AI 服務代理 | Vertex AI 功能 | service-PROJECT_NUMBER@gcp-sa-aiplatform.iam.gserviceaccount.com |
roles/aiplatform.serviceAgent |
Vertex AI RAG 資料服務代理 | Vertex AI RAG 可存取使用者匯入的資料、Vertex AI 和 Document AI 處理器 | service-PROJECT_NUMBER@gcp-sa-vertex-rag.iam.gserviceaccount.com |
roles/ |
Vertex AI 自訂程式碼服務代理人 |
自訂訓練程式碼 Ray on Vertex AI 應用程式程式碼 |
service-PROJECT_NUMBER@gcp-sa-aiplatform-cc.iam.gserviceaccount.com |
roles/aiplatform.customCodeServiceAgent |
Vertex AI 擴充功能服務代理 | Vertex 擴充功能 | service-PROJECT_NUMBER@gcp-sa-vertex-ex.iam.gserviceaccount.com |
|
Cloud AI Platform Notebooks 服務帳戶 | Vertex AI Workbench 功能 | service-PROJECT_NUMBER@gcp-sa-notebooks.iam.gserviceaccount.com |
roles/notebooks.serviceAgent |
只有在您執行自訂訓練程式碼來訓練自訂訓練模型時,才會建立 Vertex AI 自訂程式碼服務代理人。
服務代理角色和權限
請參閱下列授予 Vertex AI 服務代理人的角色和權限。
角色 | 權限 |
---|---|
Vertex AI 服務代理人( 授予 Vertex AI 正常運作所需的權限。 |
|
Vertex AI RAG 資料服務代理( Vertex RAG 可以透過這個 Vertex AI 服務代理,在專案中存取使用者匯入的資料、Vertex AI 和 Document AI 處理器 |
|
Vertex AI 自訂程式碼服務代理( 可將適當的權限授予 Vertex AI 自訂程式碼。 |
|
Vertex AI 擴充功能服務代理( 可授予 Vertex AI 擴充功能運作所需的權限。 |
|
AI 平台筆記本服務代理人( 為筆記本服務代理人授予管理使用者專案中筆記本執行個體的權限 |
|
授予 Vertex AI 服務代理人其他資源的存取權
有時您需要為 Vertex AI 服務代理授予其他角色。舉例來說,如果您需要 Vertex AI 存取其他專案中的 Cloud Storage 值區,就必須為服務代理授予一或多個額外角色。
在 BigQuery 中新增角色的相關規定
下表說明需要新增至 Vertex AI 服務代理的其他角色,以便針對不同專案中的 BigQuery 資料表或檢視畫面,或由外部資料來源支援。
「主專案」一詞是指 Vertex AI 資料集或模型所在的專案。「其他專案」一詞是指任何其他專案。
資料表類型 | 表格專案 | 資料來源專案 | 必須新增角色 |
---|---|---|---|
原生 BigQuery 資料表 | 居家專案 | 不適用 | 無 |
原生 BigQuery 資料表 | 其他專案 | 不適用 | BigQuery Data Viewer 適用於其他專案。瞭解詳情。 |
BigQuery 檢視表 | 居家專案 | 不適用 | 無 |
BigQuery 檢視表 | 其他專案 | 不適用 | BigQuery Data Viewer 適用於其他專案。瞭解詳情。 |
由 Bigtable 支援的外部 BigQuery 資料來源 | 居家專案 | 居家專案 | Bigtable Reader 適用於住家專案。瞭解詳情。 |
由 Bigtable 支援的外部 BigQuery 資料來源 | 居家專案 | 其他專案 | Bigtable Reader 適用於其他專案。瞭解詳情。 |
由 Bigtable 支援的外部 BigQuery 資料來源 | 其他專案 | 其他專案 | BigQuery Reader 和 Bigtable Reader 適用於不同的專案。瞭解詳情。 |
由 Cloud Storage 支援的外部 BigQuery 資料來源 | 居家專案 | 居家專案 | 無 |
由 Cloud Storage 支援的外部 BigQuery 資料來源 | 居家專案 | 其他專案 | Storage Object Viewer 適用於其他專案。瞭解詳情。 |
由 Cloud Storage 支援的外部 BigQuery 資料來源 | 其他專案 | 其他專案 | Storage Object Viewer 和 BigQuery Data Viewer 適用於不同的專案。瞭解詳情。 |
由 Google 試算表支援的外部 BigQuery 資料來源 | 居家專案 | 不適用 | 將您的試算表檔案分享給 Vertex AI 服務帳戶。瞭解詳情。 |
由 Google 試算表支援的外部 BigQuery 資料來源 | 其他專案 | 不適用 | BigQuery Reader 適用於不同專案,並與 Vertex AI 服務帳戶共用您的 Google 試算表檔案。 |
新增 Cloud Storage 角色的必要條件
如果您要存取其他專案的 Cloud Storage 值區資料,必須將 Storage > Storage Object Viewer
角色授予該專案中的 Vertex AI。瞭解詳情。
如果您使用 Cloud Storage 值區,從本機電腦接收匯入作業的資料,且該值區位於與Google Cloud 專案不同的專案中,則必須將 Storage > Storage Object Creator
角色授予該專案中的 Vertex AI。瞭解詳情。
將 Vertex AI 的存取權授予主專案中的資源
如要為家用專案中的 Vertex AI 服務代理人授予其他角色,請按照下列步驟操作:
前往 Google Cloud 控制台的「IAM」頁面,查看家用專案。
選取「包含 Google 提供的角色授予項目」核取方塊。
決定要授予權限的服務代理,然後按一下 鉛筆圖示。
您可以篩選 Principal:@gcp-sa-aiplatform-cc。iam.gserviceaccount.com 找出 Vertex AI 服務代理。
將必要角色授予服務代理,然後儲存變更。
將 Vertex AI 存取權授予其他專案中的資源
在其他專案中使用資料來源或目的地時,您必須授予該專案中的 Vertex AI 服務代理權限。啟動第一個非同步工作 (例如建立端點) 後,系統就會建立 Vertex AI 服務代理。您也可以明確建立 Vertex AI 服務代理。詳情請參閱「gcloud beta 服務身分建立」。這個 Google Cloud CLI 指令會建立主要服務代理人和自訂程式碼服務代理人。不過,回應中只會傳回主要服務代理。
如要在其他專案中為 Vertex AI 新增權限,請按照下列步驟操作:
前往 Google Cloud 控制台的「IAM」頁面,查看您的主頁專案 (使用 Vertex AI 的專案)。
選取「包含 Google 提供的角色授予項目」核取方塊。
決定要授予權限的服務代理,並複製其電子郵件地址 (列於「Principal」下方)。
您可以篩選 Principal:@gcp-sa-aiplatform-cc。iam.gserviceaccount.com 找出 Vertex AI 服務代理。
將專案變更為需要授予權限的專案。
按一下「新增」,然後在「New principals」中輸入電子郵件地址。
新增所有必要角色,然後按一下「儲存」。
提供 Google 試算表存取權
如果您使用 Google 試算表支援的外部 BigQuery 資料來源,則必須將試算表與 Vertex AI 服務帳戶共用。啟動第一個非同步工作 (例如建立端點) 後,系統就會建立 Vertex AI 服務帳戶。您也可以按照這篇文章的說明,使用 gcloud CLI 明確建立 Vertex AI 服務帳戶。
如要授權 Vertex AI 存取您的試算表檔案,請按照下列步驟操作:
前往 Google Cloud 控制台的「IAM」頁面。
找出名稱為
Vertex AI Service Agent
的服務帳戶,並複製其電子郵件地址 (列於「Principal」下方)。開啟試算表檔案,並與該地址共用檔案。
後續步驟
- 進一步瞭解 IAM。
- 瞭解特定身分與存取權管理權限,以及這些權限支援的作業。
- 如要瞭解為團隊設定專案的建議方式,請參閱「為團隊設定專案」。
- 瞭解 Vertex AI 的總體情況。