감사 상태 가져오기

이 페이지에서는 감사 관리자에서 진행 중인 감사의 상태를 가져오는 방법을 설명합니다. 감사는 장기 실행 작업이며 작업이 실행되는 동안 감사 상태를 확인하는 것이 유용할 수 있습니다.

시작하기 전에

진행 중인 감사의 상태 가져오기

콘솔

  1. Google Cloud 콘솔에서 감사 관리자 페이지로 이동합니다.

    감사 관리자로 이동

  2. 규정 준수 감사 섹션에서 감사 보기를 클릭합니다.

  3. 평가 보기 페이지에서 진행 중인 감사의 현재 상태를 확인하거나 완료된 감사에 대한 자세한 정보를 확인할 수 있습니다.

  4. 감사에 대한 자세한 내용을 보려면 상태 열의 링크를 클릭합니다.

gcloud

gcloud audit-manager operations describe 명령어는 감사 작업을 설명합니다.

아래의 명령어 데이터를 사용하기 전에 다음을 바꿉니다.

  • RESOURCE_TYPE: 리소스 유형(프로젝트 또는 폴더). 예를 들면 folder입니다.
  • RESOURCE_ID: 프로젝트 또는 폴더의 리소스 ID. 예를 들면 8767234입니다.
  • LOCATION: 감사 관리자 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: 감사 관리자 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.

감사 보고서가 완료되고 업로드되면 보고서 링크가 반환됩니다.

다음 단계