本頁說明如何在 Audit Manager 中取得進行中稽核的狀態。稽核是長時間執行的作業,因此在作業執行期間取得稽核狀態會很有幫助。
事前準備
請確認您具備下列任一 IAM 角色:
- 稽核管理員管理員 (
roles/auditmanager.admin) - Audit Manager 稽核者 (
roles/auditmanager.auditor)
- 稽核管理員管理員 (
找出要取得狀態的稽核。
取得稽核作業的狀態
控制台
前往 Google Cloud 控制台的「Audit Manager」頁面。
在「法規遵循稽核」部分,按一下「查看稽核」。
在「查看評估」頁面中,您可以查看進行中稽核的目前狀態,或取得已完成稽核的詳細資訊。
如要查看稽核的詳細資訊,請按一下「狀態」欄中的連結。
gcloud
gcloud audit-manager operations describe 指令會說明稽核作業。
使用下列任何指令資料之前,請先替換以下項目:
- RESOURCE_TYPE:資源類型,可以是專案或資料夾。例如:
folder。 - RESOURCE_ID:專案或資料夾的資源 ID。例如:
8767234。 - LOCATION:Audit Manager API 端點的位置。如需可用端點清單,請參閱「位置」。例如:
us-central1。 - AUDIT_OPERATION_ID:執行稽核時,回應主體中包含的進行中作業專屬 ID。例如:
098234。
執行下列指令:
Linux、macOS 或 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
使用任何要求資料之前,請先修改下列項目的值:
- RESOURCE_TYPE:資源類型,可以是專案或資料夾。例如:
folder。 - RESOURCE_ID:專案或資料夾的資源 ID。例如:
8767234。 - LOCATION:Audit Manager API 端點的位置。如需可用端點清單,請參閱「位置」。例如:
us-central1。 - AUDIT_OPERATION_ID:執行稽核時,回應主體中包含的進行中作業專屬 ID。例如:
098234。
HTTP 方法和網址:
GET https://auditmanager.googleapis.com/RESOURCE_TYPE/RESOURCE_ID/locations/LOCATION//operationDetails/AUDIT_OPERATION_ID
如要傳送要求,請選擇以下其中一個選項:
curl
執行下列指令:
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
執行下列指令:
$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. |
稽核報告完成並上傳後,系統會傳回報告的連結。