管理 Fault Injection Testing 存取權

本頁說明如何使用 Identity and Access Management (IAM) 管理 Fault Injection Testing 功能的存取權。

管理員或擁有者可以為 Google Cloud資源授予 Fault Injection Testing 角色和權限

管理員有責任確保使用者擁有必要存取權,且僅限於此 (最小權限原則)。由於 Fault Injection Testing 需要帳戶設定及執行實驗,因此最小權限原則特別重要。如果容錯實驗在錯誤的資源上執行,或由未經授權或未受過訓練的使用者操作,可能會導致非預期的服務中斷。

啟用 Fault Injection Testing 的 API

如要為專案啟用 Fault Injection Testing API,請按照下列步驟操作:

  1. 前往Google Cloud 控制台的「API Library」(API 程式庫) 頁面。
  2. 搜尋「faulttesting」,然後選取「Fault Testing API」
  3. 選取「啟用」按鈕。

系統會顯示對話方塊,說明 API 啟用進度。

設定必要權限

Fault Injection Testing 提供下列角色:

角色名稱

說明

權限

roles/faulttesting.operator

Fault Testing 管理員/操作者

具備錯誤測試資源的完整存取權。此外,業者也必須具備受影響 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 檢視者

具備錯誤測試資源的唯讀存取權。

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

faulttesting.operator 新增至使用者 `example-project` 的語法範例如下:anon@example.com in project

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