0Pricing
AWS Security Academy · Lesson

Isolating a Resource for Forensics

Learn how to quarantine an instance while preserving evidence.

Isolating a Resource for Forensics is a free AWS Security Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Why Isolate First

When an EC2 instance is compromised, your instinct may be to shut it down. Resist that. Powering off destroys volatile memory and may tip off the attacker.

Isolation cuts the resource off from the network and other systems while keeping it running and intact for analysis. Stop the spread without erasing the evidence.

Network Isolation

The fastest way to isolate an instance is to attach an empty, deny-all security group. Because security groups are stateful and apply to the instance directly, swapping in one with no rules halts essentially all new traffic.

Some teams keep a pre-made forensic isolation security group ready so containment is a single API call.

aws ec2 modify-instance-attribute \
  --instance-id i-0abc123 \
  --groups sg-forensic-isolation

Preserve Memory and Disk

Before changing anything else, capture state. Take an EBS (Elastic Block Store) snapshot of every attached volume to freeze the disk.

If your tooling supports it, dump the instance memory too, since malware often lives only in RAM. These artifacts become the immutable evidence your investigation works from.

Tag and Document

Tag the isolated instance and its snapshots clearly — for example Status=Quarantine — so no one accidentally reuses or terminates them.

Record the timeline: when you detected it, when you isolated it, and what you changed. A clean chain of custody matters if findings ever feed a legal or compliance process.

Revoke the Instance Role

A compromised instance often carries an IAM role through its instance profile, and the attacker may be using those credentials.

Remove or restrict the role, and use the IAM revoke active sessions action to invalidate temporary credentials already issued. This stops the attacker from pivoting to other services with the instance identity.

Isolate the Subnet Path

For deeper containment you can adjust route tables or a network ACL to cut the subnet off, or move the instance into a dedicated quarantine subnet with no outbound path.

This is heavier-handed than a security group swap but useful when you suspect the attacker controls the instance configuration itself.

Capture Logs Early

Pull the relevant logs before they roll over. CloudTrail shows API calls made with the instance role, VPC Flow Logs show its network connections, and any application logs show on-host behavior.

Centralized logging means this evidence survives even if the instance is later wiped or rebuilt.

Forensic Workstation

Never analyze a suspect disk on a production system. Attach the EBS snapshot copy to a hardened forensic instance in an isolated environment.

Mount the volume read-only so the act of investigating cannot alter the evidence. Work from copies, never the originals.

Automate Isolation

Manual isolation is slow at 3 a.m. Wire GuardDuty findings to EventBridge and a Lambda function that automatically applies the forensic security group, snapshots volumes, and tags the instance.

Automation shrinks the window an attacker has between detection and containment from minutes to seconds.

Decide: Rebuild or Repair

Once evidence is captured, prefer to rebuild from a trusted AMI rather than clean the compromised host. You can rarely be fully certain a backdoor is gone.

The isolated instance and its snapshots remain in quarantine for investigation while a fresh, patched instance takes over production duties.

Document the Timeline

Throughout isolation, keep a precise record: when each action was taken, by whom, and why. CloudTrail captures the API calls, but add human context on top.

This timeline is essential for the post-incident review and for any legal or compliance follow-up, turning a frantic response into defensible, auditable evidence.

Quick Check

Choose the safest containment action.

Recap

To isolate a compromised resource, keep it running but cut off the network with a deny-all security group, then snapshot EBS volumes and capture memory before anything changes. Revoke the instance role and its active sessions, tag everything as quarantine, and pull CloudTrail and Flow Logs early. Analyze copies on a read-only forensic instance, automate the steps with EventBridge and Lambda, and rebuild from a trusted AMI rather than repairing.

Frequently asked questions

Is the “Isolating a Resource for Forensics” lesson free?

Yes — the full text of “Isolating a Resource for Forensics” is free to read here on the web, and the AWS Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Security Academy course, upgrade to CoddyKit PRO.

What will I learn in “Isolating a Resource for Forensics”?

Learn how to quarantine an instance while preserving evidence. You practise AWS Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AWS Security Academy?

No prior experience is required. AWS Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Isolating a Resource for Forensics” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AWS Security Academy lesson?

Yes. Every AWS Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. The Incident Response Lifecycle on AWS
  2. Building Runbooks for Common Events
  3. Isolating a Resource for Forensics
  4. Preparing an IR Account and Toolkit
← Back to AWS Security Academy