Nesta página, descrevemos como acessar o status de uma auditoria em andamento no Audit Manager. As auditorias são operações de longa duração, e pode ser útil receber o status de uma auditoria enquanto a operação está em execução.
Antes de começar
Verifique se você tem um dos seguintes papéis do IAM:
- Administrador do Audit Manager (
roles/auditmanager.admin) - Auditor do Audit Manager (
roles/auditmanager.auditor)
- Administrador do Audit Manager (
Identifique a auditoria de que você quer saber o status.
Ver o status de uma auditoria em andamento
Console
No console do Google Cloud , acesse a página Gerenciador de auditoria.
Na seção Auditorias de compliance, clique em Ver auditorias.
Na página Ver avaliações, você pode conferir o status atual de uma auditoria em andamento ou mais informações sobre uma auditoria concluída.
Para mais informações sobre a auditoria, clique no link na coluna Status.
gcloud
O comando gcloud audit-manager operations describe
descreve uma operação de auditoria.
Antes de usar os dados do comando abaixo, faça estas substituições:
- RESOURCE_TYPE: o tipo de recurso, um projeto ou uma pasta. Por exemplo,
folder. - RESOURCE_ID: o ID do recurso do projeto ou da pasta. Por exemplo,
8767234. - LOCATION: o local do endpoint de API Audit Manager. Para conferir uma lista de endpoints disponíveis, consulte Locais. Por exemplo:
us-central1. - AUDIT_OPERATION_ID: o ID exclusivo da operação em andamento incluída no corpo da resposta quando você executou a auditoria. Por
exemplo:
098234.
Execute o seguinte comando:
Linux, macOS ou Cloud Shell
gcloud audit-manager operations describe AUDIT_OPERATION_ID \ --RESOURCE_TYPE=RESOURCE_ID \ --location=LOCATION
Windows (PowerShell)
gcloud audit-manager operations describe AUDIT_OPERATION_ID ` --RESOURCE_TYPE=RESOURCE_ID ` --location=LOCATION
Windows (cmd.exe)
gcloud audit-manager operations describe AUDIT_OPERATION_ID ^ --RESOURCE_TYPE=RESOURCE_ID ^ --location=LOCATION
REST
Antes de usar os dados da solicitação abaixo, faça as substituições a seguir:
- RESOURCE_TYPE: o tipo de recurso, um projeto ou uma pasta. Por exemplo,
folder. - RESOURCE_ID: o ID do recurso do projeto ou da pasta. Por exemplo,
8767234. - LOCATION: o local do endpoint de API Audit Manager. Para conferir uma lista de endpoints disponíveis, consulte Locais. Por exemplo:
us-central1. - AUDIT_OPERATION_ID: o ID exclusivo da operação em andamento incluída no corpo da resposta quando você executou a auditoria. Por
exemplo:
098234.
Método HTTP e URL:
GET https://auditmanager.googleapis.com/RESOURCE_TYPE/RESOURCE_ID/locations/LOCATION//operationDetails/AUDIT_OPERATION_ID
Para enviar a solicitação, escolha uma destas opções:
curl
Execute o seguinte comando:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://auditmanager.googleapis.com/RESOURCE_TYPE/RESOURCE_ID/locations/LOCATION//operationDetails/AUDIT_OPERATION_ID"
PowerShell
Execute o seguinte comando:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://auditmanager.googleapis.com/RESOURCE_TYPE/RESOURCE_ID/locations/LOCATION//operationDetails/AUDIT_OPERATION_ID" | Select-Object -Expand Content
| Status type | Description |
|---|---|
OPERATION_STATE_UNSPECIFIED |
An invalid state. |
OPERATION_STATE_NOT_STARTED |
The audit report generation process has not yet started. |
OPERATION_STATE_EVALUATION_IN_PROGRESS |
Audit Manager is evaluating the resources against compliance controls. |
OPERATION_STATE_EVALUATION_DONE |
Audit Manager has completed compliance evaluation. |
OPERATION_STATE_EVIDENCE_REPORT_GENERATION_IN_PROGRESS |
Audit Manager is creating an audit report from the evaluated data. |
OPERATION_STATE_EVIDENCE_REPORT_GENERATION_DONE |
Audit Manager has completed the generation of the audit report. |
OPERATION_STATE_EVIDENCE_UPLOAD_IN_PROGRESS |
Audit Manager is uploading the audit report and evidence to the destination. |
OPERATION_STATE_DONE |
The audit report generation process is completed. |
OPERATION_STATE_FAILED |
The audit report generation process has failed. |
Each of the execution status types might provide any of the following additional information, when applicable:
| Additional status | Description |
|---|---|
failure_reason |
If the audit assessment fails, this field provides the reason for the failure. |
evaluation_percent_complete |
If evaluation has started, this
field provides the percentage of the progress.
When the process is yet to start, the field starts at 0.
When the process is concluded, the field is
set to 100. |
report_generation_percent_complete |
If the report generation has started, this
field provides percentage of the progress. When the process is yet to start,
the field starts at 0. When the process is concluded, the field is
set to 100. |
report_uploading_percent_complete |
If the report uploading has started, this
field provides percentage of the progress. When the process is yet to start,
the field starts at 0. When the process is concluded, the field is set to 100. |
Quando um relatório de auditoria é concluído e enviado, um link para ele é retornado.