How do you respond to a compromised EC2 instance?
AdvancedProductionSecurity Services and Data Protection
Answer
- Contain without destroying evidence: replace its security groups with an isolation SG (no inbound or outbound), detach it from the ASG and load balancer, tag it as quarantined.
- Revoke credentials: deny active sessions on the instance role (revoke older sessions), rotate any secrets it could read.
- Preserve: snapshot EBS volumes, capture memory if you have tooling, collect logs and Flow Logs.
- Investigate in an isolated forensics account (Amazon Detective helps build the timeline).
- Rebuild from a clean AMI; never "clean" the instance.
More on Security Services and Data Protection
What is a minimal security services baseline for every account?BeginnerHow do you roll out GuardDuty across an organization and what protections do you turn on?IntermediateHow do you handle the flood of findings from GuardDuty and Security Hub?AdvancedWhat does Security Hub add on top of GuardDuty?BeginnerHow do you automate remediation of security findings?AdvancedHow do you design a KMS key strategy?Advanced