Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 36 ยท Mobile and Cloud Forensics

Cloud Forensics and SaaS Logs

Learn how cloud investigations differ: shared responsibility, volatile instances, audit logs such as CloudTrail, SaaS sign-in records, and legal access, with a Python log triage.

When data and workloads move to the cloud, the evidence moves too. There may be no disk to seize, virtual machines can vanish in seconds, and the records you need belong to a provider. Cloud forensics adapts the usual principles (preserve, document, analyze, report) to this setting. The biggest change is that you rely on logs and APIs, and on what your contract and the law let you obtain.

Shared responsibility

Cloud providers secure the underlying infrastructure; customers secure what they put on it. What you can collect depends on the service model.

Model You control Evidence you can usually get
IaaS (virtual machines) OS, apps, data Disk snapshots, memory (with agents), VM logs, flow logs
PaaS (managed platforms) Apps and data Application logs, platform audit logs
SaaS (email, storage, CRM) Only your data and users Sign-in logs, admin audit logs, exports from the vendor

In SaaS you cannot image a server. The vendor's audit log may be the only record, and its retention may be short (days to a year), so request or export logs early.

What is different about cloud evidence

  • Volatility. Instances are created and destroyed automatically; auto-scaling may delete the one you need. Snapshot first.
  • Multi-tenancy and location. Data may sit in several regions and countries, raising jurisdiction questions.
  • Time and identity. Records use UTC and identify principals (users, roles, access keys) rather than machines.
  • Access. You collect through consoles and APIs with credentials; use a dedicated read-only investigator role and log what you did.
  • Trust. You depend on the provider's logs being accurate and complete.
flowchart LR
  A["Incident suspected"] --> B["Preserve: snapshot, export logs"]
  B --> C["Restrict: isolate, rotate keys"]
  C --> D["Analyze audit logs"]
  D --> E["Reconstruct actions by principal"]

Preserving comes before containment where possible, because containment (rotating keys, terminating instances) can destroy evidence.

Common cloud log sources

Source Records Typical use
AWS CloudTrail API calls: who did what, when, from where Reconstruct changes, find new users and keys
Azure Activity / Entra sign-in logs Resource operations and sign-ins Account takeover, risky sign-ins
Google Cloud Audit Logs Admin activity and data access Permission changes, data reads
VPC / NSG flow logs Allowed and denied traffic Lateral movement, data exfiltration
Object storage access logs Reads and writes of buckets Data theft, public exposure
SaaS audit logs (email, drive) Logins, sharing, forwarding rules, downloads Business email compromise

Reading an audit event

A cloud audit event is JSON. These fields answer the investigator's questions:

JSON
{
  "eventTime": "2026-11-12T14:03:11Z",
  "eventName": "CreateAccessKey",
  "userIdentity": {"type": "IAMUser", "userName": "build-bot"},
  "sourceIPAddress": "203.0.113.9",
  "userAgent": "aws-cli/2.15",
  "requestParameters": {"userName": "admin-svc"}
}

Illustrative example of an event shape, not a real record.

It says that build-bot created an access key for admin-svc from an address at a time. If build-bot normally never does that, you have a lead.

Triage a set of events

The program below filters synthetic audit events for actions that matter in many investigations: new credentials, permission changes, disabled logging, and activity from new addresses.

Python Triage cloud audit events

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice the order: a new key, a policy change, logging stopped, then data read, all from an address build-bot does not normally use. That sequence is a classic compromised-credential story, built purely from metadata.

Count activity per principal

A summary by user and action helps find the noisiest accounts and unusual actions.

Python Summarize actions per principal

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Practical steps

  1. Act early. Export logs and take snapshots before retention windows close or instances are replaced.
  2. Use read-only roles for collection, and record every command or console action.
  3. Hash exports and store them in a protected location.
  4. Check logging coverage. Was audit logging enabled? Were data-event logs on? Missing logs are findings, not just gaps.
  5. Mind the law. Provider cooperation, data location and privacy law shape what you may collect (legal frameworks).
  6. Correlate with endpoint, mobile and network data on a shared timeline.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In a SaaS service, what is usually your main source of evidence?

    You cannot image the vendor's infrastructure, so audit logs and exports are the primary records.
  2. 2. Why should you snapshot before terminating a suspicious cloud instance?

    Ephemeral instances and their disks can disappear when stopped or deleted, so preserve first.
  3. 3. Which event is most suspicious as an anti-forensic action?

    Disabling audit logging removes your visibility and is a typical attacker step.
  4. 4. Cloud audit logs identify actions by:

    Records reference the identity that made the API call, such as an IAM user, role or access key.

Summary

  • Cloud forensics relies on logs, APIs and snapshots; responsibility is shared with the provider.
  • Export logs and snapshot early: retention is short and instances are ephemeral.
  • Audit events show principal, action, time and source address.
  • New credentials, permission changes and disabled logging are priority signals.
  • Legal access and data location affect what you can collect.

Next: Timeline Analysis Basics