Gerenciar o acesso ao Fault Injection Testing

Nesta página, descrevemos como usar Identity and Access Management (IAM) para gerenciar o acesso aos recursos do Fault Injection Testing.

Os administradores ou proprietários dos seus Google Cloud recursos podem conceder papéis e permissões do Fault Injection Testing.

Os administradores são responsáveis por garantir que os usuários tenham o acesso necessário e nada mais (princípio de privilégio mínimo). Como o Fault Injection Testing exige que as contas configurem e executem experimentos, o privilégio mínimo é especialmente importante. A experimentação de falhas pode causar interrupções inesperadas se for executada em recursos incorretos ou operada por usuários não autorizados ou não treinados.

Ativar as APIs do Fault Injection Testing

Para ativar a API Fault Injection Testing no seu projeto, faça o seguinte:

  1. Acesse a página Biblioteca de APIs do Google Cloud console.
  2. Pesquise faulttesting e selecione a API Fault Testing.
  3. Selecione o botão Ativar.

Uma caixa de diálogo mostrando o progresso da ativação da API aparece.

Definir as permissões necessárias

O Fault Injection Testing oferece os seguintes papéis:

Nome do papel

Descrição

Permissões

roles/faulttesting.operator

Administrador/operador de testes de falhas

Acesso total aos recursos de teste de falhas. Os operadores também precisam ter permissões de editor para os recursos afetados 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

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

roles/faulttesting.viewer

Leitor de testes de falhas

Acesso somente leitura aos recursos de teste de falhas.

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

Use a Google Cloud CLI para conceder papéis e permissões. Para conceder o faulttesting.operator role, execute o seguinte comando:

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

Um exemplo da sintaxe para adicionar faulttesting.operator ao usuário anon@example.com in projectexample-project` seria assim:

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