Cloud Audit Logs overview  |  Cloud Logging  |  Google Cloud (2024)

This document provides a conceptual overview of Cloud Audit Logs.

Google Cloud services write audit logs that record administrative activitiesand accesses within your Google Cloud resources. Audit logs help youanswer "who did what, where, and when?" within your Google Cloud resourceswith the same level of transparency as in on-premises environments. Enablingaudit logs helps your security, auditing, and compliance entities monitorGoogle Cloud data and systems for possible vulnerabilities or externaldata misuse.

Google services producing audit logs

For a list of Google Cloud services that provide audit logs, seeGoogle services with audit logs. AllGoogle Cloud services will eventually provide audit logs.

For an overview of Google Workspace audit logs, seeAudit logs for Google Workspace.

Required roles

To view audit logs, you must have the appropriateIdentity and Access Management (IAM) permissions and roles:

  • To get the permissions that you need to get read-only access to Admin Activity, Policy Denied, andSystem Event audit logs, ask your administrator to grant you the Logs Viewer (roles/logging.viewer) IAM role on your project.

    If you have only the Logs Viewer role (roles/logging.viewer), then youcannot view Data Access audit logs that are in the _Default bucket.

  • To get the permissions that you need to get access to all logs in the _Required and _Defaultbuckets, including Data Access logs, ask your administrator to grant you the Private Logs Viewer (roles/logging.privateLogViewer) IAM role on your project.

    The Private Logs Viewer role (roles/logging.privateLogViewer) includes thepermissions contained in the Logs Viewer role (roles/logging.viewer),and those necessary to read Data Access audit logs in the _Default bucket.

For more information about the IAM permissions and roles thatapply to audit logs data, seeAccess control with IAM.

Types of audit logs

Cloud Audit Logs provides the following audit logs for eachGoogle Cloud project, folder, and organization:

  • Admin Activity audit logs
  • Data Access audit logs
  • System Event audit logs
  • Policy Denied audit logs

Admin Activity audit logs

Admin Activity audit logs contain log entries for API calls or other actionsthat modify the configuration or metadata of resources. For example, these logsrecord when users create VM instances or change Identity and Access Management permissions.

Admin Activity audit logs are always written; you can't configure, exclude, ordisable them. Even if you disable the Cloud Logging API, Admin Activity auditlogs are still generated.

For a list of services that write Admin Activity audit logs and detailedinformation about which activities generate those logs, seeGoogle Cloud services with audit logs.

Data Access audit logs

Data Access audit logs contain API calls that read the configuration or metadataof resources, as well as user-driven API calls that create, modify, or readuser-provided resource data.

Publicly available resources that have the Identity and Access Management policiesallAuthenticatedUsers orallUsers don't generate audit logs. Resourcesthat can be accessed without logging into a Google Cloud,Google Workspace, Cloud Identity, or Drive Enterprise account don'tgenerate audit logs. This helps protect end-user identities and information.

Data Access audit logs—except forBigQuery Data Access audit logs—are disabled by default becauseaudit logs can be quite large. If you want DataAccess audit logs to be written for Google Cloud services other thanBigQuery, you must explicitly enable them. Enabling the logs mightresult in your Google Cloud project being charged for the additional logsusage. For instructions on enabling and configuring Data Access audit logs, seeEnable Data Access audit logs.

For a list of services that write Data Access audit logs and detailedinformation about which activities generate those logs, seeGoogle Cloud services with audit logs.

Data Access audit logs are stored in the_Default log bucket unlessyou've routed them elsewhere. For more information, see theStoring and routing audit logssection of this page.

System Event audit logs

System Event audit logs contain log entries for Google Cloud actions thatmodify the configuration of resources. System Event audit logs are generated byGoogle systems; they aren't driven by direct user action.

System Event audit logs are always written; you can't configure, exclude, ordisable them.

For a list of services that write System Event audit logs and detailedinformation about which activities generate those logs, seeGoogle Cloud services with audit logs.

Policy Denied audit logs

Policy Denied audit logs are recorded when a Google Cloud service denies accessto a user or service account because of a securitypolicy violation.

Policy Denied audit logs are generated by default and yourGoogle Cloud project is charged for the logs storage. You can't disable PolicyDenied audit logs, but you can useexclusion filters to prevent PolicyDenied audit logs from being stored in Cloud Logging.

For a list of services that write Policy Denied audit logs and detailedinformation about which activities generate those logs, seeGoogle Cloud services with audit logs.

Audit log entry structure

Every audit log entry in Cloud Logging is an object of typeLogEntry. What distinguishes an audit log entry from other logentries is the protoPayload field; this field contains anAuditLog object that stores the audit logging data.

To understand how to read and interpret audit log entries, and for a sample ofan audit log entry, seeUnderstanding audit logs.

Log name

Cloud Audit Logs log names include the following:

  • Resource identifiers indicating the Google Cloud project orother Google Cloud entity that owns the audit logs.

  • The string cloudaudit.googleapis.com.

  • A string that indicates 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 resourceidentifiers:

 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

Caller identities in audit logs

Audit logs record the identity that performed the logged operations on theGoogle Cloud resource. The caller's identity is held in theAuthenticationInfo field of AuditLog objects.

Audit logging doesn't redact the caller's principal email address for anyaccess that succeeds or for any write operation.

For read-only operations that fail with a "permission denied" error,Audit Logging might redact the caller's principal email address unless thecaller is a service account.

In addition to the conditions listed above, the following applies to certainGoogle Cloud services:

  • Legacy App Engine API: Identities aren'tcollected.

  • BigQuery: Calleridentities and IP addresses, as well as some resource names, are redactedfrom the audit logs, unless certain conditions are met.

  • Cloud Storage: When Cloud Storageusage logs are enabled, Cloud Storage writes usage data to theCloud Storage bucket, which generates Data Access audit logs for thebucket. The generated Data Access audit log has its caller identityredacted.

  • Firestore: If a JSON Web Token(JWT) was used for third-party authentication, the thirdPartyPrincipalfield includes the token's header and payload. For example, audit logs forrequests authenticated with Firebase Authentication include thatrequest's auth token.

  • VPC Service Controls: ForPolicy Denied audit logs, the following redaction occurs:

    • Parts of the caller email addresses might be redacted and replaced bythree period characters ....

    • Some caller email addresses belonging to the domain google.com areredacted and replaced by google-internal.

  • Organization Policy:Parts of the caller email addresses might be redacted and replaced bythree period characters ....

IP address of the caller in audit logs

The IP address of the caller is held in the RequestMetadata.caller_ip field ofthe AuditLog object:

  • For a caller from the internet, the address is a public IPv4 or IPv6address.
  • For calls made from inside Google's internal production network from oneGoogle Cloud service to another, the caller_ip is redacted to "private".
  • For a caller from a Compute Engine VM with a external IP address, thecaller_ip is the external address of the VM.
  • For a caller from a Compute Engine VM without a external IP address, ifthe VM is in the same organization or project as the accessed resource, thencaller_ip is the VM's internal IPv4 address. Otherwise, the caller_ip isredacted to "gce-internal-ip". For more information, seeVPC network overview.

Viewing audit logs

You can query for all audit logs or you can query for logs by theiraudit log name. The audit log name includes theresource identifierof the Google Cloud project, folder, billing account, ororganization for which you want to view audit logging information.Your queries can specify indexed LogEntry fields, and if you usethe Log Analytics page, which supports SQL queries, then you canview your query results as a chart.

For more information about querying your logs, see the following pages:

  • Build queries in the Logs Explorer.
  • Query and view logs in Log Analytics.
  • Sample queries for security insights.

You can view audit logs in Cloud Logging by using theGoogle Cloud console, the Google Cloud CLI, or the Logging API.

Console

In the Google Cloud console, you can use the Logs Explorerto retrieve your audit log entries for your Google Cloud project, folder,or organization:

  1. In the Google Cloud console, go to the Logs Explorer page:

    Go to Logs Explorer

    If you use the search bar to find this page, then select the result whose subheading isLogging.

  2. Select an existing Google Cloud project, folder, or organization.

  3. To display all audit logs, enter either of the following queriesinto the query-editor field, and then click Run query:

    logName:"cloudaudit.googleapis.com"
    protoPayload."@type"="type.googleapis.com/google.cloud.audit.AuditLog"
  4. To display the audit logs for a specific resource and audit log type,in the Query builder pane, do the following:

    • In Resource type, select the Google Cloud resource whoseaudit logs you want to see.

    • In Log name, select the audit log type that you want to see:

      • For Admin Activity audit logs, select activity.
      • For Data Access audit logs, select data_access.
      • For System Event audit logs, select system_event.
      • For Policy Denied audit logs, select policy.
    • Click Run query.

    If you don't see these options, then there aren't any audit logs ofthat type available in the Google Cloud project, folder, ororganization.

    If you're experiencing issues when trying to view logs in theLogs Explorer, see thetroubleshootinginformation.

    For more information about querying by using the Logs Explorer, seeBuild queries in the Logs Explorer.For information about summarizing log entries in the Logs Explorerby using Gemini, seeSummarize log entries with Gemini assistance.

gcloud

The Google Cloud CLI provides a command-line interface to theLogging API. Supply a valid resource identifier in each of the lognames. For example, if your query includes a PROJECT_ID, then theproject identifier you supply must refer to the currently selectedGoogle Cloud project.

To read your Google Cloud project-level audit log entries, runthe following command:

gcloud logging read "logName : projects/PROJECT_ID/logs/cloudaudit.googleapis.com" \ --project=PROJECT_ID

To read your folder-level audit log entries, run the following command:

gcloud logging read "logName : folders/FOLDER_ID/logs/cloudaudit.googleapis.com" \ --folder=FOLDER_ID

To read your organization-level audit log entries, run the followingcommand:

gcloud logging read "logName : organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com" \ --organization=ORGANIZATION_ID

To read your Cloud Billing account-level audit log entries, run the following command:

gcloud logging read "logName : billingAccounts/BILLING_ACCOUNT_ID/logs/cloudaudit.googleapis.com" \ --billing-account=BILLING_ACCOUNT_ID

Add the --freshness flagto your command to read logs that are more than 1 day old.

For more information about using the gcloud CLI, seegcloud logging read.

API

When building your queries, supply a valid resource identifier in each ofthe log names. For example, if your query includes a PROJECT_ID,then the project identifier you supply must refer to the currently selectedGoogle Cloud project.

For example, to use the Logging API to view your project-levelaudit log entries, do the following:

  1. Go to the Try this API section in the documentation for theentries.listmethod.

  2. Put the following into the Request body part of the Try thisAPI form. Clicking this prepopulated formautomatically fills the request body, but you need to supply a validPROJECT_ID in each of the log names.

    { "resourceNames": [ "projects/PROJECT_ID" ], "pageSize": 5, "filter": "logName : projects/PROJECT_ID/logs/cloudaudit.googleapis.com"}
  3. Click Execute.

Storing and routing audit logs

Cloud Logging uses log buckets ascontainers that store and organize your logs data. For eachGoogle Cloud project, folder, and organization, Loggingautomatically creates two log buckets, _Required and _Default, andcorrespondingly named sinks.

Cloud Logging _Required buckets store Admin Activity audit logsand System Event audit logs. You can't configure _Required buckets or anylogs data in it.

Admin Activity audit logs and System Event audit logs are always stored in the_Required bucket in the project where the logs were generated.

If you route Admin Activity audit logs and System Event audit logs to adifferent project, then those logs don't pass through the _Default or_Required sink of the destination project. Therefore, these logs aren't storedin the _Default log bucket or the _Required log bucket of the destinationproject. To store these logs, create a log sink in the destination project.For more information, see Route logs to supported destinations.

The _Default buckets, by default, store any enabled Data Accessaudit logs as well as Policy Denied audit logs. To prevent Data Access auditlogs from being stored in the _Default buckets, you can disable them. Toprevent any Policy Denied audit logs from being stored in the _Defaultbuckets, you can exclude them by modifying their sinks' filters.

You can also route your audit log entries to user-definedCloud Logging buckets at the Google Cloud project level or to supporteddestinations outside of Logging using sinks. For instructionson routing logs, seeRoute logs to supported destinations.

When configuring your log sinks' filters, you need to specify the audit logtypes you want to route; for filtering examples, seeSecurity logging queries.

If you want to route audit log entries for a Google Cloud organization,folder, or billing account, seeCollate and route organization-level logs to supported destinations.

Audit log retention

For details on how long log entries are retained by Logging,see the retention information inQuotas and limits: Logs retention periods.

Access control

IAM permissions and roles determine your ability to access auditlogs data in the Logging API, theLogs Explorer, and theGoogle Cloud CLI.

For detailed information about the IAM permissions and roles youmight need, see Access control with IAM .

Quotas and limits

For details on logging usage limits, including the maximum sizes of audit logs,see Quotas and limits.

Pricing

Cloud Logging doesn't charge to route logs to asupported destination; however, the destination might apply charges.With the exception of the _Required log bucket,Cloud Logging charges to stream logs into log buckets andfor storage longer than the default retention period of the log bucket.

Cloud Logging doesn't charge for copying logs,for defining log scopes,or for queries issued through theLogs Explorer or Log Analytics pages.

For more information, see the following documents:

  • Cloud Logging pricing summary
  • Destination costs:

    • Cloud Storage pricing
    • BigQuery pricing
    • Pub/Sub pricing
    • Cloud Logging pricing
  • VPC flow log generation charges apply when you send and then exclude your Virtual Private Cloud flow logs from Cloud Logging.

What's next

  • Learn how toread and understand audit logs.
  • Learn how toenable Data Access audit logs.
  • Review best practices forCloud Audit Logs.
  • Learn about Access Transparency,which provides logs of actions taken by Google Cloud staff when accessing yourGoogle Cloud content.
Cloud Audit Logs overview  |  Cloud Logging  |  Google Cloud (2024)
Top Articles
Health insurance and your taxes
Gold Storage Limit in India - Know Complete Information
Skigebiet Portillo - Skiurlaub - Skifahren - Testberichte
Lengua With A Tilde Crossword
Danielle Moodie-Mills Net Worth
Pitt Authorized User
Klustron 9
The Idol - watch tv show streaming online
How to Type German letters ä, ö, ü and the ß on your Keyboard
Legacy First National Bank
Nestle Paystub
Grand Park Baseball Tournaments
Seth Juszkiewicz Obituary
Fire Rescue 1 Login
Camstreams Download
Lqse-2Hdc-D
Chile Crunch Original
Lake Nockamixon Fishing Report
Q33 Bus Schedule Pdf
Commodore Beach Club Live Cam
Lonesome Valley Barber
Carson Municipal Code
50 Shades Of Grey Movie 123Movies
Van Buren County Arrests.org
PowerXL Smokeless Grill- Elektrische Grill - Rookloos & geurloos grillplezier - met... | bol
EASYfelt Plafondeiland
Reptile Expo Fayetteville Nc
Sussyclassroom
Loslaten met de Sedona methode
T Mobile Rival Crossword Clue
eugene bicycles - craigslist
Fiona Shaw on Ireland: ‘It is one of the most successful countries in the world. It wasn’t when I left it’
Giantbodybuilder.com
Mosley Lane Candles
Publix Daily Soup Menu
Texters Wish You Were Here
Western Gold Gateway
Metro By T Mobile Sign In
Powerspec G512
SF bay area cars & trucks "chevrolet 50" - craigslist
2008 DODGE RAM diesel for sale - Gladstone, OR - craigslist
Mvnt Merchant Services
60 X 60 Christmas Tablecloths
Shipping Container Storage Containers 40'HCs - general for sale - by dealer - craigslist
Dr Mayy Deadrick Paradise Valley
Comanche Or Crow Crossword Clue
Brown launches digital hub to expand community, career exploration for students, alumni
The top 10 takeaways from the Harris-Trump presidential debate
Tenichtop
Craigslist.raleigh
Die 10 wichtigsten Sehenswürdigkeiten in NYC, die Sie kennen sollten
Latest Posts
Article information

Author: Aron Pacocha

Last Updated:

Views: 6579

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.