This document describes the audit logs created by Resource Manager as part of Cloud Audit Logs.
Overview
Google Cloud services write audit logs to help you answer the questions, "Who did what, where, and when?" within your Google Cloud resources.
Your Google Cloud projects contain only the audit logs for resources that are directly within the Google Cloud project. Other Google Cloud resources, such as folders, organizations, and billing accounts, contain the audit logs for the entity itself.
For a general overview of Cloud Audit Logs, see Cloud Audit Logs overview. For a deeper understanding of the audit log format, see Understand audit logs.
Available audit logs
The following types of audit logs are available for Resource Manager:
-
Admin Activity audit logs
Includes "admin write" operations that write metadata or configuration information.
You can't disable Admin Activity audit logs.
-
Data Access audit logs
Includes "admin read" operations that read metadata or configuration information. Also includes "data read" and "data write" operations that read or write user-provided data.
To receive Data Access audit logs, you must explicitly enable them.
For fuller descriptions of the audit log types, see Types of audit logs.
Audited operations
The following table summarizes which API operations correspond to each audit log type in Resource Manager:
| Audit logs category | Resource Manager operations |
|---|---|
| Admin Activity logs (ADMIN_WRITE) |
v3:
v2beta1:
v2:
v1beta1:
v1:
|
| Data Access logs (ADMIN_READ) |
v3:
v2beta1:
v2:
v1beta1:
v1:
|
| Data Access logs (ADMIN_READ under integrating service name)[1] |
v3:
|
| Data Access logs (ADMIN_READ under Organization Policy Service)[2] |
v2:
|
[1] ADMIN_READ must be enabled under
the service for the particular resource to which the tag is attached in order
to enable this log
[2] ADMIN_READ must be enabled under
the Organization Policy Service API in order to enable this log
The audit logs for tags operations in other services, such as
cloudsql.instances.listEffectiveTags, are written to the resource's parent and
are included in Resource Manager audit logs. They are not included in the service
resource's audit logs. To see these logs, you must enable
ADMIN_READ under the service for the particular resource to which
the tag is attached.
The GetContactInfo and UpdateContactInfo operations
support the ContactInfo service for the EU General Data Protection
Regulation (GDPR). These operations update and retrieve contact information for
an EU Representative and a Data Protections Officer, which can be modified in
the Google Cloud console on the
Google Cloud Privacy & Security page.
Audit log format
Audit log entries include the following objects:
The log entry itself, which is an object of type
LogEntry. Useful fields include the following:- The
logNamecontains the resource ID and audit log type. The resource is a project, folder, organization, or billing account. - The
resourcecontains the target of the audited operation. - The
timeStampcontains the time of the audited operation. - The
protoPayloadcontains the audited information.
- The
The audit logging data, which is an
AuditLogobject held in theprotoPayloadfield of the log entry.- The
@typefield is set to"type.googleapis.com/google.cloud.audit.AuditLog". - The
serviceNamefield identifies the service that wrote the audit log. The format of this field is service specific.
- The
Optional service-specific audit information, which is a service-specific object. For earlier integrations, this object is held in the
serviceDatafield of theAuditLogobject; later integrations use themetadatafield.
For other fields in these objects, and how to interpret them, review Understand audit logs.
Log name
Cloud Audit Logs log names include resource identifiers indicating the Google Cloud project or other Google Cloud entity that owns the audit logs, and whether the log contains Admin Activity, Data Access, Policy Denied, or System Event audit logging data.
The following are the audit log names, including variables for the resource identifiers:
projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Factivity projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fdata_access projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fsystem_event projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fpolicy folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Factivity folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Fdata_access folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Fsystem_event folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Fpolicy billingAccounts/BILLING_ACCOUNT_ID/logs/cloudaudit.googleapis.com%2Factivity billingAccounts/BILLING_ACCOUNT_ID/logs/cloudaudit.googleapis.com%2Fdata_access billingAccounts/BILLING_ACCOUNT_ID/logs/cloudaudit.googleapis.com%2Fsystem_event billingAccounts/BILLING_ACCOUNT_ID/logs/cloudaudit.googleapis.com%2Fpolicy organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Factivity organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Fdata_access organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Fsystem_event organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Fpolicy
Service name
Resource Manager audit logs use the service name
cloudresourcemanager.googleapis.com.
For a list of all the Cloud Logging API service names and their corresponding monitored resource type, see Map services to resources.
Resource types
Resource Manager audit logs use the resource type project for all audit
logs.
For a list of all the Cloud Logging monitored resource types and descriptive information, see Monitored resource types.
Caller identities
The IP address of the caller is held in the RequestMetadata.caller_ip field of
the AuditLog object. Logging might redact certain
caller identities and IP addresses.
For information about what information is redacted in audit logs, see Caller identities in audit logs.
Enable audit logging
Admin Activity audit logs are always enabled; you can't disable them.
Data Access audit logs are disabled by default and aren't written unless explicitly enabled (the exception is Data Access audit logs for BigQuery, which can't be disabled).
For information about enabling some or all of your Data Access audit logs, see Enable Data Access audit logs.
Permissions and roles
IAM permissions and roles determine your ability to access audit logs data in Google Cloud resources.
When deciding which Logging-specific permissions and roles apply to your use case, consider the following:
The Logs Viewer role (
roles/logging.viewer) gives you read-only access to Admin Activity, Policy Denied, and System Event audit logs. If you have just this role, you cannot view Data Access audit logs that are in the_Defaultbucket.The Private Logs Viewer role
(roles/logging.privateLogViewer) includes the permissions contained inroles/logging.viewer, plus the ability to read Data Access audit logs in the_Defaultbucket.Note that if these private logs are stored in user-defined buckets, then any user who has permissions to read logs in those buckets can read the private logs. For more information about log buckets, see Routing and storage overview.
For more information about the IAM permissions and roles that apply to audit logs data, see Access control with IAM.
View logs
You can query for all audit logs or you can query for logs by their
audit log name. The audit log name includes the
resource identifier
of the Google Cloud project, folder, billing account, or
organization for which you want to view audit logging information.
Your queries can specify indexed LogEntry fields.
For more information about querying your logs, see
Build queries in the Logs Explorer
The Logs Explorer lets you view filter individual log entries. If you want to use SQL to analyze groups of log entries, then use the Log Analytics page. For more information, see:
- Query and view logs in Observability Analytics.
- Sample queries for security insights.
- Chart query results.
Most audit logs can be viewed in Cloud Logging by using the Google Cloud console, the Google Cloud CLI, or the Logging API. However, for audit logs related to billing, you can only use the Google Cloud CLI or the Logging API.
Console
In the Google Cloud console, you can use the Logs Explorer to retrieve your audit log entries for your Google Cloud project, folder, or organization:
-
In the Google Cloud console, go to the