使用 IAM 控管存取權
本頁面說明如何使用 Identity and Access Management (IAM) 管理 Colab Enterprise 資源的存取權。如要管理其他 Gemini Enterprise Agent Platform 資源的存取權,請參閱「使用 IAM 控管 Agent Platform 存取權」。
使用 IAM 控管筆記本存取權
您可以在專案層級或個別筆記本層級,管理 Colab Enterprise 筆記本 (IPYNB 檔案) 的存取權。
執行與其他 Google Cloud 服務互動的程式碼
授予筆記本存取權時,僅限與筆記本互動相關的特定權限。例如,您可以授予建立筆記本、在筆記本中編寫程式碼或刪除筆記本的權限。
如要執行與其他 Google Cloud 服務互動的程式碼,請務必使用下列其中一種方法:
在已啟用使用者憑證的執行階段中執行程式碼。也就是說,筆記本與筆記本使用者對 Google Cloud 服務具有相同的存取權。
執行程式碼,驗證並授權筆記本與Google Cloud 服務互動。
詳情請參閱「執行與Google Cloud互動的程式碼」。
IAM 角色類型
Colab Enterprise 可使用不同類型的 IAM 角色:
預先定義的角色可讓您在專案層級,為 Colab Enterprise 資源授予一組相關權限。
基本角色 (擁有者、編輯者和檢視者) 可在專案層級控管 Colab Enterprise 資源的存取權,且適用於所有 Google Cloud服務。
自訂角色可讓您選擇特定的一組權限,使用這些權限建立您自己的角色,然後將該角色授予機構中的使用者。
如要在 Colab Enterprise 專案中新增、更新或移除這些角色,請參閱管理專案、資料夾和組織的存取權說明文件。
Colab Enterprise 的預先定義角色
Colab Enterprise 是 Agent Platform 的一部分,Colab Enterprise 資源則透過 Agent Platform API 管理。因此,您可以透過 Agent Platform 角色,授予主體 Colab Enterprise 資源的存取權。
下表列出所有 Agent Platform 預先定義的角色。
如要使用預先定義的角色執行常見的 Colab Enterprise 作業,請參閱「Colab Enterprise 管理員」(
roles/aiplatform.colabEnterpriseAdmin) 和「Colab Enterprise 使用者」(roles/aiplatform.colabEnterpriseUser)。如需執行階段管理相關角色,請參閱筆記本執行階段管理員 (
roles/aiplatform.notebookRuntimeAdmin) 和筆記本執行階段使用者 (roles/aiplatform.notebookRuntimeUser)。Agent Platform 管理員 (
roles/aiplatform.admin)、Agent Platform 使用者 (roles/aiplatform.user) 和 Agent Platform 檢視者 (roles/aiplatform.viewer) 也包含 Colab Enterprise 權限。
| Role | Permissions |
|---|---|
Agent Platform Administrator( Grants full access to all resources in Agent Platform. |
|
Aiplatform Editor( Editor role for aiplatform |
|
Agent Platform Express User Beta( Grants user access to Agent Platform Express. |
|
Agent Platform User( Grants access to use all resource in Agent Platform. |
|
Agent Platform Viewer( Grants access to view all resource in Agent Platform. |
|
Agent Platform Agents Admin Role Beta( Grants full administrative access to Agent Platform agents, including reading and managing their memories and their access control policies. |
|
Agent Platform Agents Creator Role Beta( Grants access to create and discover Agent Platform agents and their auth providers, and to create and list collaborative projects. |
|
Agent Platform Agents User Role Beta( Grants access to view agents and to create, update, cancel, and delete their tasks. |
|
Agent Platform Agents Viewer Role Beta( Grants read-only access to Agent Platform agents. |
|
Colab Enterprise Admin( Admin role of using colab enterprise. |
|
Colab Enterprise User( User role of using colab enterprise. |
|
Agent Platform 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:
|
|
Agent Platform Express Admin Beta( Grants admin access to Agent Platform Express. |
|
Agent Platform Feature Store Admin( Grants full access to all resources in Agent Platform Feature Store. Lowest-level resources where you can grant this role:
|
|
Agent Platform Feature Store Data Viewer( This role provides permissions to read Feature data. Lowest-level resources where you can grant this role:
|
|
Agent Platform Feature Store Data Writer( This role provides permissions to read and write Feature data. Lowest-level resources where you can grant this role:
|
|
Agent Platform Feature Store Instance Creator( Administrator of Featurestore resources, but not the child resources under Featurestores. Lowest-level resources where you can grant this role:
|
|
Agent Platform Feature Store Resource Viewer( Viewer of all resources in Agent Platform Feature Store but cannot make changes. Lowest-level resources where you can grant this role:
|
|
Agent Platform Feature Store User Beta( Deprecated. Use featurestoreAdmin instead. |
|
Agent Platform Memory Bank Editor Role( Grants edit access to Agent Platform Memory Bank. |
|
Agent Platform Memory Bank User Role( Grants full user access to Agent Platform Memory Bank. |
|
Agent Platform Memory Bank Viewer Role( Grants viewer access to Agent Platform Memory Bank. |
|
Agent Platform Migration Service User( Grants access to use migration service in Agent Platform |
|
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 Platform Provisioned Throughput Admin Beta( Grants access to use all resources related to Vertex AI Provisioned Throughput |
|
Vertex AI Platform Publisher Provisioned Throughput Admin Beta( Grants Publisher access to use all resources related to Vertex AI Provisioned Throughput Orders |
|
Vertex AI Platform Publisher Provisioned Throughput Viewer Beta( Grants Publisher access to view all resources related to Vertex AI Provisioned Throughput Orders |
|
Agent Platform Sessions Editor Role( Grants edit access to Agent Platform Sessions. |
|
Agent Platform Sessions User Role( Grants full user access to Agent Platform Sessions. |
|
Agent Platform Sessions Viewer Role( Grants viewer access to Agent Platform Sessions |
|
Agent Platform Tensorboard Web App User Beta( Grants access to the Vertex AI TensorBoard web app. |
|
Service agent roles
Service agent roles should only be granted to service agents.
| Role | Permissions |
|---|---|
Vertex AI Agent Sandbox Service Agent( Vertex AI Service Agent used to access Agent Sandbox managed resources in consumer project with restricted permissions. |
|
Vertex AI Batch Prediction Service Agent( Vertex AI Batch Prediction Service Agent for serving batch prediction requests. |
|
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. The aiplatform.customJobs.create IAM permission is highly privileged. Through Vertex AI Custom Training jobs, it effectively grants editor-level access to other services activated for the consumer project, such as GCS and BigQuery. |
|
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 Model Monitoring Service Agent( Gives Vertex AI Model Monitoring the permissions it needs to function. |
|
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 RAG Data Service Agent( Vertex AI Service Agent used by Vertex RAG to access user imported data, Vertex AI, Document AI processors, and Vector Search 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. The aiplatform.reasoningEngines.create IAM permission implies read access to the GCS objects of the consumer project through this service agent. |
|
Vertex AI Service Agent( Gives Vertex AI the permissions it needs to function. |
|
Vertex AI Telemetry Service Agent( Allows Vertex AI Telemetry Service Agent to access telemetry data. |
|
Vertex AI Tuning Service Agent( Vertex AI Service Agent used for tuning in user project. |
|
基本角色
舊版 Google Cloud基本角色適用於所有 Google Cloud 服務。包括擁有者、編輯者和檢視者。
基本角色提供 Google Cloud的權限,不限於 Colab Enterprise。因此,請盡可能使用 Colab Enterprise 角色。
自訂角色
如果 Colab Enterprise 的預先定義 IAM 角色不符合需求,您可以定義自訂角色。自訂角色可讓您選擇一組特定權限、建立具備這些權限的角色,並將該角色授予組織中的使用者。詳情請參閱「瞭解 IAM 自訂角色」。
Colab Enterprise 的服務代理
Colab Enterprise 會自動建立並使用服務代理,代表您存取資源。建立服務代理時,系統會為專案授予預先定義的角色。
下表列出 Colab Enterprise 服務代理、其電子郵件地址和各自的角色:
| 名稱 | 適用於: | 電子郵件地址 | 角色 |
|---|---|---|---|
| Vertex AI 服務代理 | Agent Platform 功能 | service-PROJECT_NUMBER@gcp-sa-aiplatform. |
roles/aiplatform.serviceAgent |
| Vertex AI Colab 服務代理 | 可授予 Colab Enterprise 運作所需的適當權限 | service-PROJECT_NUMBER@gcp-sa-vertex-nb. |
roles/aiplatform.colabServiceAgent |
| Vertex AI 筆記本服務代理 | 在使用者專案中執行筆記本代管資源,但權限受限 | service-PROJECT_NUMBER@gcp-sa-aiplatform-vm. |
roles/aiplatform.notebookServiceAgent |
如果您移除 Colab Enterprise 服務代理的預設角色,Colab Enterprise 會自動重新指派這些角色,確保服務功能不中斷。如要停用 Colab Enterprise 服務,請停用相關 API,而非移除角色。
Colab Enterprise 權限的安全性考量
使用者建立 Colab Enterprise 筆記本時,系統會自動授予該筆記本的程式碼擁有者 (roles/dataform.codeOwner) 角色。這項資源層級角色授權與任何專案層級 IAM 角色無關。
IAM 會以階層式方式管理政策:
- 使用者可以具備專案 IAM 政策中的角色,該角色會自動套用至專案中的所有資源。
- 使用者也可以在特定資源政策 (例如個別筆記本) 中擁有角色。
如果使用者在資源政策「或」任何上層政策中具有角色,就能存取資源。
如要完全撤銷使用者的存取權,管理員可以採取下列任一做法:
- 從各個筆記本中移除使用者的角色。詳情請參閱「移除筆記本的資源層級存取權」。
- 建立 IAM 拒絕政策,撤銷使用者對專案中所有資源的權限。
Colab Enterprise 的筆記本儲存在 Dataform 中,因此請考量下列安全性影響,再決定是否讓使用者存取這些筆記本:
- 筆記本的瀏覽權限由專案層級的 Dataform 權限控管。使用者只要具備
dataform.repositories.list權限,就能查看Google Cloud 專案中的所有筆記本,無論是否為筆記本建立者或共用對象。這項權限包含在標準 Colab Enterprise 角色中,例如 Colab Enterprise 使用者 (roles/aiplatform.colabEnterpriseUser) 和 Colab Enterprise 管理員 (roles/aiplatform.colabEnterpriseAdmin)。如要限制瀏覽權限,您可以建立不含dataform.repositories.list權限的自訂角色。 - 標準 Colab Enterprise 角色 (例如
roles/aiplatform.colabEnterpriseUser和roles/aiplatform.colabEnterpriseAdmin) 也包含dataform.repositories.create,且建立者會獲得所建立筆記本和存放區的資源層級擁有者或管理員存取權。這樣一來,使用者就能在Google Cloud 專案中建立或更新 Dataform 存放區,並參照與 Dataform 服務代理共用的資源,包括 Secret Manager 密鑰、Developer Connect Git 存放區連結,以及用於存放區快照的 Cloud Storage bucket,而不必具備這些資源的直接 IAM 權限。為保護憑證和 Storage bucket,請限制 Dataform 存放區的建立、編輯和編譯權限,僅授予信任的使用者,並強制執行constraints/dataform.restrictGitRemotes,以及將 Dataform 服務代理的權限範圍,限制在必要資源。詳情請參閱「透過 Dataform 服務代理共用資源存取權」和「安裝套件時的 Secret 存取權」。
詳情請參閱「Dataform 權限的安全性考量」。