Skip to content
WETNav

Google

Google Cloud audit logs

Admin Activity, Data Access, System Event and Policy Denied logs for every Google Cloud project: method, principal, caller IP and the full request.

Why it matters

Service account keys, IAM binding changes, instance metadata SSH keys and logging sink changes are how intrusions persist and hide in Google Cloud. All of them land in Admin Activity logs, which are always on.

How long it lasts

  • Admin Activity and System Event logs: always written, kept 400 days in the _Required bucket.
  • Data Access logs: off by default for most services (BigQuery is the main exception), kept 30 days in the _Default bucket unless you change it.
  • Route logs to a longer-retention bucket, BigQuery or a SIEM with an organization-level sink so new projects are covered.
Plan collection order across every source

Get the data

gcloud logging read \
  'logName:"cloudaudit.googleapis.com%2Factivity" AND protoPayload.authenticationInfo.principalEmail="[email protected]"' \
  --freshness=30d --format=json --project=<project-id>

Fields that matter

protoPayload.methodName

The API method called, for example google.iam.admin.v1.CreateServiceAccountKey.

protoPayload.serviceName

The API service, such as iam.googleapis.com or compute.googleapis.com.

protoPayload.authenticationInfo.principalEmail

The user or service account that made the call. For impersonation, serviceAccountDelegationInfo shows the chain.

protoPayload.requestMetadata.callerIp

Source IP. Calls from inside Google show as private or gce-internal-ip.

protoPayload.requestMetadata.callerSuppliedUserAgent

Client user agent: gcloud, Terraform, SDKs or scripts.

protoPayload.resourceName

The resource acted on.

protoPayload.serviceData.policyDelta

For IAM changes: the bindings added and removed.

protoPayload.status.code

0 or absent for success; 7 is PERMISSION_DENIED.

logName

Which audit log: activity, data_access, system_event or policy.

Values to know

Traps

  • Data Access logs are off for most services, so reads of buckets and secrets are usually not recorded unless someone enabled them.
  • Log sinks are per project unless an organization or folder sink exists. A project created by the attacker may log nowhere you look.
  • A sink update can silently filter out the attacker's activity. Review sink filters and destinations as part of scoping.