Incident Response in the Cloud
When a cloud breach occurs, the response process is fundamentally different from on-premises incident response. Evidence is ephemeral, infrastructure can be destroyed in seconds, and the blast radius can span multiple accounts and regions. This lesson covers cloud-specific IR procedures, forensic evidence collection, and how to contain and eradicate a cloud compromise while preserving evidence for investigation.
Learning Objectives — Deep Dive
Each objective below is broken down into plain English so you know exactly what you are learning, why it matters, and what you will be able to do when you are done. Mark each one complete as you work through the lesson.
Detect the incident
Review GuardDuty findings for high-severity alerts indicating active compromise.
aws guardduty list-findings --detector-id $(aws guardduty list-detectors --query "DetectorIds[0]" --output text) --finding-criteria file://gd-filter.jsonContain compromised credentials
Immediately attach a DenyAll policy to the compromised IAM user to stop further damage.
aws iam put-user-policy --user-name compromised-user --policy-name EmergencyDeny --policy-document file://deny-all.jsonInvestigate with CloudTrail
Query CloudTrail for all API calls made by the compromised identity in the last 24 hours.
aws cloudtrail lookup-events --lookup-attributes AttributeKey=Username,AttributeValue=compromised-user --start-time $(date -d "24 hours ago" --iso-8601=seconds) --query "Events[*].[EventTime,EventName,SourceIPAddress]" --output tableIsolate a compromised EC2 instance
Replace the instance's security group with an isolation group that blocks all inbound and outbound traffic.
aws ec2 modify-instance-attribute --instance-id i-xxxxxxxx --groups sg-isolation-only