tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Cloud Platforms > Google Cloud Platform (GCP) > Cloud Audit Logs

Cloud Audit Logs

Author: Venkata Sudhakar

Google Cloud Audit Logs help you answer the question "Who did what, where, and when?" within your GCP projects. They provide a complete audit trail of all administrative activities and data access operations across all Google Cloud services, helping you meet compliance and security requirements.

Types of Cloud Audit Logs:

1. Admin Activity Audit Logs - Records API calls and administrative actions that modify resource configurations (always enabled, no cost).

2. Data Access Audit Logs - Records API calls that read resource configurations or user-provided data (must be enabled, charged).

3. System Event Audit Logs - Records GCP administrative actions triggered by Google systems (always enabled, no cost).

4. Policy Denied Audit Logs - Records when a security policy denies access to a user or service account.

The below example shows how to read Cloud Audit Logs programmatically using the Cloud Logging API in Java.


It gives the following output,

Recent Admin Activity Audit Log Entries:
==========================================
Timestamp  : seconds: 1704067200 nanos: 0
Severity   : NOTICE
Principal  : [email protected] created bucket my-bucket
------------------------------------------
Timestamp  : seconds: 1704063600 nanos: 0
Severity   : WARNING
Principal  : [email protected]
------------------------------------------

Common Audit Log Filters:

Admin Activity logs: logName="projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Factivity"

Data Access logs: logName="projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fdata_access"

Specific user activity: protoPayload.authenticationInfo.principalEmail="[email protected]"

Specific resource: protoPayload.resourceName="projects/PROJECT_ID/buckets/my-bucket"

Failed operations: protoPayload.status.code != 0


 
  


  
bl  br