Notes
The audit log
The foundation is the management audit log: CloudTrail on AWS, the Activity Log on Azure, Cloud Audit Logs on Google. It records every API call, who did what, when, and from where. This is the single most important source for any investigation, because in the cloud everything is an API call. Turn it on for all regions and all accounts, not just one. Store it in immutable storage and retain it a long time, because you often investigate things from months ago.
- AWS CloudTrail, Azure Activity Log, GCP Cloud Audit Logs
- records every API call: who, what, when, from where
- this is the primary record for investigations
- turn it on for ALL regions and accounts
- immutable storage; retain for a long time
Protect the logs
Logs an attacker can delete are not evidence. So ship them from each account to a separate, locked-down logging account the compromised account cannot reach. Add the governance guardrail that denies disabling or deleting the audit log for everyone, including account admins. And enable more than the management log: data-event logs for operations like object reads, and network flow logs, so you see not just control-plane actions but data access and traffic. Protected, complete logs make an investigation possible.
- ship logs to a separate, locked-down log account
- attackers cannot reach them from the compromised account
- guardrail: deny disabling or deleting the audit log (SCP, from the governance episode)
- turn on data-event and network/flow logs too
Managed detection
You do not have to write all the detection yourself. Managed services, GuardDuty on AWS, Defender for Cloud on Azure, Security Command Center on Google, analyse your logs, DNS and network traffic for known attack patterns and anomalies. They produce findings like crypto-mining, credential exfiltration, reconnaissance, or unusual API calls. Low effort and high value, so turn them on across all accounts and route the findings into your alerting. They catch many common cloud attacks automatically.
- GuardDuty (AWS), Defender for Cloud (Azure), SCC (GCP)
- analyse logs, DNS, network for known attack patterns
- findings: crypto-mining, credential exfiltration, recon, anomalous API calls
- low effort, high value: turn them on feed findings into your alerting
Reading the trail
An audit entry answers the investigator's questions directly. This one shows a create-user action, by the web application role, from an external IP, using the command-line tool, and it succeeded. Each is a clue: a web app role should never create IAM users, the source IP is not your infrastructure, and the command-line agent is unusual for an app. Reading entries like this is the core of cloud investigation, and alerting on suspicious combinations, like a service role creating users, is how you catch it live.
{
"eventName": "CreateUser",
"userIdentity": "role/web-app",
"sourceIPAddress": "203.0.113.9",
"userAgent": "aws-cli",
"errorCode": null
}
# a web-app role creating an IAM
# user, from an odd IP = suspicious What attacks look like
It helps to know what the attacks from this part look like in the logs. A new access key created and used from a new country. Instance role credentials used from an external IP, the metadata-SSRF attack. Someone calling stop-logging or changing policies. A sudden burst of object reads, signalling exfiltration. Threat detection being disabled, or new admin users created. Each breach pattern has a log signature, and knowing them lets you build targeted alerts rather than drowning in raw events.
- new access key created, then used from a new country
- instance creds used from an external IP (the SSRF attack)
- StopLogging / policy changes
- mass GetObject or data downloads
- disabling GuardDuty; creating admin users
Aggregate and alert
Raw logs are not detection; you turn them into signal. Centralise logs from every account into one place, a SIEM or query tool, which Part thirteen covers in depth. Then alert on the high-value events, a new admin user, logging disabled, off-instance credential use, rather than on everything, and tune to cut noise. The goal is to shrink the time to notice an intrusion from the typical weeks to minutes, because detection speed limits the damage of every breach.
- centralise logs from all accounts in one place
- into a SIEM or query tool (Part 13 covers detection engineering)
- alert on high-value events, not everything
- tune to cut noise
- the goal: minutes to notice, not weeks
Common mistakes
Mistakes. The audit log turned off, or only enabled in one region while the attacker works in another. Logs stored in the same account an attacker compromises, so they are deleted. Managed threat detection never switched on, despite being cheap and easy. Logs dutifully collected but with nobody alerting on them, so they are only read after the breach. No data-event or flow logs, so you see control actions but not data access. And alerting on everything, so the few real signals are lost in noise.
- audit log off, or only in one region
- logs an attacker can delete (same account)
- managed detection not turned on
- logs collected but nobody alerting on them
- no data-event or flow logs
- alerting on everything, so real signals are missed
Say it like this
In the interview: detection starts with logging. I enable the management audit log in every region and account, ship it to a separate locked-down logging account, and guardrail against anyone disabling or deleting it. I turn on the managed threat detection service for broad coverage. Then I centralise logs into a SIEM, add data-event and flow logs, and alert on high-value signals, a new admin user, logging disabled, off-instance credential use. The goal is to cut time-to-notice from weeks to minutes.
- "Turn on the audit log in all regions and accounts, ship it
- to a locked-down log account
- with a guardrail against
- deletion. Enable managed
- detection (GuardDuty etc.).
- Centralise logs, alert on high-value events like new admins or off-instance creds, and aim for minutes to notice."