Home/Refreshers/Preserving cloud evidence: refresher
Preserving cloud evidence
Capture what disappears first, keep it where nobody can change it, and record who collected what.
Remember
- Order of volatility: the machine's current state, then memory, then disk, then logs.
- On AWS, request the EBS snapshot before memory capture. The snapshot is fixed at that instant.
- Keep the machine alive: termination protection on, and out of its Auto Scaling group.
- Hash every file as it is collected, and store it under a lock.
- Export logs whose retention could run out during the investigation.
Commands
| Preserve with the evidence template | aws ec2 create-tags --resources <instance> --tags Key=incident,Value=<id> |
| Snapshot every volume at once | aws ec2 create-snapshots --instance-specification InstanceId=<instance> |
| Block termination | aws ec2 modify-instance-attribute --instance-id <instance> --disable-api-termination |
| Snapshot a Google Cloud disk | gcloud compute snapshots create <name> --source-disk <disk> --source-disk-zone <zone> |
| Preserve on Azure or OCI | az tag update --resource-id <vm> --operation Merge --tags incident=<id>; oci compute instance update --instance-id <ocid> --freeform-tags '{"incident":"<id>"}' |
| Hash a file | sha256sum memory.lime |
Watch out
- Writing a memory image to a disk changes that disk. Snapshot it first.
- Snapshots encrypted with the default EBS key cannot be shared with a forensics account.
- Exec into a compromised pod changes it, and the attacker may be watching. Capture the node.
Check it worked
Every item has a hash, a timestamp, and a collector's name, and sits under Object Lock or an immutability policy.