このページでは、Audit Manager で進行中の監査のステータスを取得する方法について説明します。監査は長時間実行オペレーションであり、オペレーションの実行中に監査のステータスを取得すると便利です。
始める前に
次のいずれかの IAM ロールがあることを確認します。
- Audit Manager 管理者(
roles/auditmanager.admin) - Audit Manager 監査担当者(
roles/auditmanager.auditor)
- Audit Manager 管理者(
ステータスを取得する監査を特定します。
進行中の監査のステータスを取得する
コンソール
Google Cloud コンソールで、[監査マネージャー] ページに移動します。
[コンプライアンス監査] セクションで、[監査を表示] をクリックします。
[評価を表示] ページでは、進行中の監査の現在のステータスを確認したり、完了した監査の詳細情報を取得したりできます。
監査の詳細を表示するには、[ステータス] 列のリンクをクリックします。
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 メソッドと URL:
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. |
監査レポートが完了してアップロードされると、レポートへのリンクが返されます。