Before we come to the end of this chapter, I just want to quickly highlight a common approach to how you might respond to an infrastructure-related security incident involving an EC2 instance:
- Capture: You should try and capture any metadata from the instance before you proceed and make any further changes related to your environment.
- Protect: To prevent the EC2 instance from being accidentally terminated, enable termination protection while you continue to investigate.
- Isolate: You should then isolate the instance by modifying the security group or updating the NACL to deny all traffic destined for the IP address of the instance.
- Detach: Remove the affected instance from any autoscaling groups.
- Deregister: If the instance is associated with any ELBs, you must remove it from any ELBs.
- Snapshot: Take a copy of any EBS volumes via a snapshot so that you can investigate further without affecting the original...