使用 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 资源授予一组相关权限。
基本角色(Owner、Editor 和 Viewer)提供项目级层的 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 Admin (
roles/aiplatform.colabEnterpriseAdmin) 和 Colab Enterprise User (roles/aiplatform.colabEnterpriseUser)。如需了解与运行时管理相关的角色,请参阅 Notebook Runtime Admin (
roles/aiplatform.notebookRuntimeAdmin) 和 Notebook Runtime User (roles/aiplatform.notebookRuntimeUser)。Agent Platform Administrator (
roles/aiplatform.admin)、Agent Platform User (roles/aiplatform.user) 和 Agent Platform Viewer (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 服务。这些角色包括 Owner、Editor 和 Viewer。
这些基本角色可在整个 Google Cloud中提供权限,而不仅仅是针对 Colab Enterprise。因此,您应尽可能使用 Colab Enterprise 角色。
自定义角色
如果 Colab Enterprise 的预定义 IAM 角色不符合您的需求,您可以定义自定义角色。自定义角色让您可以基于一组特定权限创建具有这些权限的专属角色,然后将该角色授予组织中的用户。如需了解详情,请参阅了解 IAM 自定义角色。
Colab Enterprise 的服务代理
Colab Enterprise 会自动创建并使用服务代理来代表您访问资源。创建服务代理后,系统会为服务代理授予项目的预定义角色。
下表列出了 Colab Enterprise 服务代理、其邮箱以及各自的角色:
| 名称 | 用于: | 电子邮件地址 | 角色 |
|---|---|---|---|
| Vertex AI Service Agent | Agent Platform 功能 | service-PROJECT_NUMBER@gcp-sa-aiplatform. |
roles/aiplatform.serviceAgent |
| Vertex AI Colab Service Agent | 授予 Colab Enterprise 正常运行所需的适当权限 | service-PROJECT_NUMBER@gcp-sa-vertex-nb. |
roles/aiplatform.colabServiceAgent |
| Vertex AI Notebook Service Agent | 在权限受限的用户项目中运行由笔记本管理的资源 | 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权限(包含在标准 Colab Enterprise 角色中,例如 Colab Enterprise User (roles/aiplatform.colabEnterpriseUser) 和 Colab Enterprise Admin (roles/aiplatform.colabEnterpriseAdmin))的用户可以查看Google Cloud 项目中的所有笔记本,无论这些笔记本是否由他们创建或与他们共享。如需限制公开范围,您可以创建不包含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 存储桶,而无需对这些资源拥有直接 IAM 权限。为了保护您的凭据和存储桶,请将 Dataform 代码库创建、修改和编译权限限制为受信任的用户,强制执行constraints/dataform.restrictGitRemotes,并将 Dataform 服务代理的权限范围限定为仅限必要的资源。如需了解详情,请参阅通过 Dataform 服务代理共享对资源的访问权限和软件包安装期间的 Secret 访问权限。
如需了解详情,请参阅 Dataform 权限的安全注意事项。