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
- Admin Activity logs are always on and kept 400 days at no charge. Data Access logs are off, except for BigQuery.
- A call made with a service account key names the key in serviceAccountKeyName. Compute Engine and App Engine do not.
- Impersonation starts with GenerateAccessToken, a Data Access log that is off by default. Calls made with the token name who asked in serviceAccountDelegationInfo.
- Firewall changes apply to new connections. Existing ones persist while traffic flows.
- Snapshots are crash-consistent. Memory needs a tool inside the VM.
Commands
| New service account keys | gcloud logging read 'protoPayload.methodName="google.iam.admin.v1.CreateServiceAccountKey"' --freshness=30d |
| Everything one identity did | gcloud logging read 'protoPayload.authenticationInfo.principalEmail="<identity>"' --freshness=7d |
| Disable a key | gcloud iam service-accounts keys disable <key id> --iam-account <service account> |
| Snapshot a disk | gcloud 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.