管理 Fault Injection Testing 访问权限

本页面介绍如何使用 Identity and Access Management (IAM) 管理对 Fault Injection Testing 功能的访问权限。

Google Cloud资源的管理员或所有者可以授予故障注入测试角色和权限

管理员负责确保用户拥有所需的访问权限,而不会拥有更多权限(最小权限原则)。由于 Fault Injection Testing 需要账号来配置和运行实验,因此最小权限原则尤为重要 - 如果在错误的资源上运行故障实验,或者由未经授权或未经培训的用户操作,可能会导致意外中断。

为 Fault Injection Testing 启用 API

如需为您的项目启用 Fault Injection Testing API,请执行以下操作:

  1. 前往 Google Cloud 控制台的“API 库”页面。
  2. 搜索 faulttesting,然后选择 Fault Testing API
  3. 选择启用按钮。

系统会显示一个对话框,其中显示了 API 激活进度。

设置所需权限

Fault Injection Testing 提供以下角色:

角色名称

说明

权限

roles/faulttesting.operator

Fault Testing Admin/Operator

拥有对故障测试资源的完整访问权限。操作员还必须对受影响的 Google Cloud 资源拥有编辑者权限。

faulttesting.googleapis.com/operations.delete

faulttesting.googleapis.com/operations.cancel

faulttesting.googleapis.com/experiments.create

faulttesting.googleapis.com/experiments.update

faulttesting.googleapis.com/experiments.delete

faulttesting.googleapis.com/validations.create

faulttesting.googleapis.com/validations.delete

faulttesting.googleapis.com/validationResources.create

faulttesting.googleapis.com/validationResources.update

faulttesting.googleapis.com/validationResources.delete

faulttesting.googleapis.com/affectedResources.create

faulttesting.googleapis.com/affectedResources.update

faulttesting.googleapis.com/affectedResources.delete

faulttesting.googleapis.com/experimentTemplates.create

faulttesting.googleapis.com/experimentTemplates.update

faulttesting.googleapis.com/experimentTemplates.delete

faulttesting.googleapis.com/exclusionWindows.create

faulttesting.googleapis.com/exclusionWindows.update

faulttesting.googleapis.com/exclusionWindows.delete

cloudresourcemanager.googleapis.com/projects.get

cloudresourcemanager.googleapis.com/projects.list

faulttesting.googleapis.com/operations.list

faulttesting.googleapis.com/operations.get

faulttesting.googleapis.com/locations.list

faulttesting.googleapis.com/locations.get

faulttesting.googleapis.com/experiments.list

faulttesting.googleapis.com/experiments.get

faulttesting.googleapis.com/validations.list

faulttesting.googleapis.com/validations.get

faulttesting.googleapis.com/validationResources.list

faulttesting.googleapis.com/validationResources.get

faulttesting.googleapis.com/affectedResources.list

faulttesting.googleapis.com/affectedResources.get

faulttesting.googleapis.com/experimentTemplates.list

faulttesting.googleapis.com/experimentTemplates.get

faulttesting.googleapis.com/exclusionWindows.list

faulttesting.googleapis.com/exclusionWindows.get

roles/faulttesting.viewer

Fault Testing Viewer

拥有对故障测试资源的只读权限。

cloudresourcemanager.googleapis.com/projects.get

cloudresourcemanager.googleapis.com/projects.list

faulttesting.googleapis.com/operations.list

faulttesting.googleapis.com/operations.get

faulttesting.googleapis.com/locations.list

faulttesting.googleapis.com/locations.get

faulttesting.googleapis.com/experiments.list

faulttesting.googleapis.com/experiments.get

faulttesting.googleapis.com/validations.list

faulttesting.googleapis.com/validations.get

faulttesting.googleapis.com/validationResources.list

faulttesting.googleapis.com/validationResources.get

faulttesting.googleapis.com/affectedResources.list

faulttesting.googleapis.com/affectedResources.get

faulttesting.googleapis.com/experimentTemplates.list

faulttesting.googleapis.com/experimentTemplates.get

faulttesting.googleapis.com/exclusionWindows.list

faulttesting.googleapis.com/exclusionWindows.get

使用 Google Cloud CLI 授予角色和权限。如需授予 faulttesting.operator role,请运行以下命令:

gcloud projects add-iam-policy-binding ${PROJECT_ID} \
  --member {USER|GROUP|SERVICE_ACCOUNT} \
  --role roles/faulttesting.operator

向用户 anon@example.com in projectexample-project` 添加 faulttesting.operator 的语法示例如下:

gcloud projects add-iam-policy-binding example-project --member=user:anon@example.com --role=roles/faulttesting.operator