使用 IAM 控制访问权限

Google Cloud 提供 Identity and Access Management (IAM),可让您授予对特定 Google Cloud 资源的细化访问权限,并防止对其他资源进行不必要的访问。本页面介绍 Cloud Debugger IAM 角色。如需详细了解 IAM,请参阅 IAM 文档

授予角色

如需了解如何为主帐号(例如 Google 帐号或服务帐号)授予 IAM 角色,请参阅 IAM 文档中的授予、更改和撤消访问权限

以下 IAM 角色适用于 Debugger:

所需权限

借助 IAM,每个 Google Cloud 方法都要求发出 API 请求的帐号具有访问相应资源的适当权限。有了权限,主帐号便可对 Cloud 资源执行特定操作。

下表列出了调用者调用 Debugger 方法必须具备的权限:

方法 所需权限 适用的资源类型
REST: controller.debuggees.register
RPC: RegisterDebuggeeRequest
clouddebugger.debuggees.create 项目
REST: controller.debuggees.breakpoints.list
RPC: ListBreakpointsRequest
clouddebugger.breakpoints.list 项目
REST: controller.debuggees.breakpoints.update
RPC: UpdateActiveBreakpointRequest
clouddebugger.breakpoints.update 项目
REST: debugger.debuggees.list
RPC: ListDebuggeesRequest
clouddebugger.debuggees.list 项目
REST: debugger.debuggees.breakpoints.delete clouddebugger.breakpoints.delete 项目
REST: debugger.debuggees.breakpoints.get
RPC: GetBreakpointRequest
clouddebugger.breakpoints.get 项目
REST: debugger.debuggees.breakpoints.list
RPC: ListBreakpointsRequest
clouddebugger.breakpoints.list 项目
REST: debugger.debuggees.breakpoints.set
RPC: SetBreakpointRequest
clouddebugger.breakpoints.create 项目

Debugger IAM 角色

您不能直接向主帐号授予权限;不过,您可以为其授予 Google Cloud 资源的一个或多个角色,这些角色捆绑了一项或多项权限。

除了 Owner、Editor 和 Viewer 这些基本角色之外,您还可以授予以下 Cloud Debugger IAM 角色:

角色 目的 具有的权限
Cloud Debugger Agent
roles/clouddebugger.agent
可以注册调试目标,读取活动断点并报告断点结果。此角色通常分配给运行 Debugger 代理的服务帐号。
  • clouddebugger.breakpoints.list:返回调试对象的所有断点的列表,包括非活动断点。
  • clouddebugger.breakpoints.listActive:返回调试对象的所有活动断点的列表。
  • clouddebugger.breakpoints.update:更新断点。
  • clouddebugger.debuggees.create:注册调试对象。
Cloud Debugger User
roles/clouddebugger.user

可以创建、查看、列出和删除断点(快照和日志点)以及列出调试目标(调试对象)。

  • clouddebugger.breakpoints.create:创建断点。
  • clouddebugger.breakpoints.delete:删除断点。
  • clouddebugger.breakpoints.get:读取断点。
  • clouddebugger.breakpoints.list:列出断点。
  • clouddebugger.debuggees.list:列出用户可访问的调试目标(调试对象)。