iac.htora.dev · security templates

Home/Refreshers/Incident response on Google Cloud: refresher

Incident response on Google Cloud

What Google Cloud records by default, how to read an identity out of it, and the first moves for each kind of compromise.

Remember

  1. Admin Activity logs are always on and kept 400 days at no charge. Data Access logs are off, except for BigQuery.
  2. A call made with a service account key names the key in serviceAccountKeyName. Compute Engine and App Engine do not.
  3. Impersonation starts with GenerateAccessToken, a Data Access log that is off by default. Calls made with the token name who asked in serviceAccountDelegationInfo.
  4. Firewall changes apply to new connections. Existing ones persist while traffic flows.
  5. Snapshots are crash-consistent. Memory needs a tool inside the VM.

Commands

New service account keysgcloud logging read 'protoPayload.methodName="google.iam.admin.v1.CreateServiceAccountKey"' --freshness=30d
Everything one identity didgcloud logging read 'protoPayload.authenticationInfo.principalEmail="<identity>"' --freshness=7d
Disable a keygcloud iam service-accounts keys disable <key id> --iam-account <service account>
Snapshot a diskgcloud compute disks snapshot <disk> --zone <zone> --labels incident=<id>

Watch out

  • Without Data Access logs, reading data leaves no audit record.
  • Anyone who can edit a VM can change its network tags. Isolate by service account.
  • Security Command Center Standard has no threat detection. Premium and Enterprise do.
Check it worked

A test key creation in a scratch project appears in the query above within minutes.

Read the full pageDownload PDF

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.