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.
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
The API method called, for example google.iam.admin.v1.CreateServiceAccountKey.
The API service, such as iam.googleapis.com or compute.googleapis.com.
The user or service account that made the call. For impersonation, serviceAccountDelegationInfo shows the chain.
Source IP. Calls from inside Google show as private or gce-internal-ip.
Client user agent: gcloud, Terraform, SDKs or scripts.
The resource acted on.
For IAM changes: the bindings added and removed.
0 or absent for success; 7 is PERMISSION_DENIED.
Which audit log: activity, data_access, system_event or policy.
Values to know
methodName
All values- SetIamPolicyIAM policy set (Resource Manager)IAM bindings on a project, folder or organization were replaced.High signal
- google.iam.admin.v1.CreateServiceAccountKeyService account key createdA downloadable key for a service account was created.High signal
- google.iam.admin.v1.CreateServiceAccountService account createdA new service account was created.Suspicious
- google.iam.admin.v1.SetIAMPolicyIAM policy set on a service accountWho can act as or manage a service account changed.High signal
- GenerateAccessTokenService account token generatedA short-lived access token was minted for a service account (impersonation).Depends on context
- storage.setIamPermissionsBucket IAM changedPermissions on a Cloud Storage bucket changed.Suspicious
- storage.objects.getObject readAn object was read from Cloud Storage (Data Access log).Depends on context
- google.logging.v2.ConfigServiceV2.DeleteSinkLog sink deletedA log export sink was deleted.High signal
- google.logging.v2.ConfigServiceV2.UpdateSinkLog sink updatedA log export sink was changed.Suspicious
- v1.compute.projects.setCommonInstanceMetadataProject metadata setProject-wide instance metadata changed.High signal
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.