Containing active breach

From yanacuti1121/Yana-AI · View interactive version

Containing active breach is an AI agent skill from the GitHub repository yanacuti1121/Yana-AI. Executes containment strategies to stop active adversary operations and prevent lateral movement during a confirmed security breach. Implements short-term and long-term containment using network segmentation, endpoint isolation, credential revocation, and access control modifications. Activates for

How to use this skill

Skill file

Containing Active Breaches

When to Use

Do not use for post-incident cleanup when the adversary is no longer active; use eradication procedures instead.

Prerequisites

Workflow

Step 1: Assess Containment Scope

Before taking containment actions, map the full scope of compromise to avoid partial containment that alerts the adversary:

Containment Scope Assessment:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Compromised Hosts:     5 (WKSTN-042, WKSTN-087, SRV-FILE01, SRV-DC02, WKSTN-103)
Compromised Accounts:  3 (jsmith, svc-backup, admin-tier0)
C2 Channels:           HTTPS beacon to 185.220.x.x every 60s ± 15% jitter
Lateral Movement:      PsExec via svc-backup, RDP via admin-tier0
Adversary Privilege:   Domain Admin (admin-tier0 compromised)
Data at Risk:          Finance share (\\SRV-FILE01\finance$) accessed

Step 2: Execute Short-Term Containment

Implement immediate actions to stop adversary operations without destroying evidence:

Network Containment:

Identity Containment:

Endpoint Containment:

Step 3: Execute Long-Term Containment

Implement sustainable containment while the investigation continues:

Step 4: Validate Containment Effectiveness

Confirm that containment measures have stopped adversary operations:

Containment Validation Checklist:
[x] C2 beacon traffic ceased from all known compromised hosts
[x] Disabled accounts producing expected 4625 failure events (no new successes)
[x] Contained hosts unreachable via network scan from adjacent subnets
[x] No new hosts exhibiting IOCs from the initial compromise
[x] Honeypot account has not been accessed (adversary may be dormant)
[ ] Full packet capture running on finance VLAN (pending switch config)

Step 5: Preserve Evidence During Containment

Containment must not destroy forensic evidence:

Step 6: Communicate Containment Status

Provide structured status updates to incident commander and stakeholders:

Key Concepts

| Term | Definition |

|------|------------|

| Short-Term Containment | Immediate actions to stop active adversary operations; typically network isolation and credential disablement |

| Long-Term Containment | Sustainable measures allowing continued investigation while preventing adversary re-access |

| KRBTGT Double Reset | Resetting the KRBTGT password twice to invalidate all existing Kerberos tickets including golden tickets |

| Network Containment | EDR feature that isolates an endpoint from all network communication except the EDR management channel |

| Lateral Movement | Adversary technique of moving from one compromised system to another within a network using stolen credentials or exploits |

| C2 Sinkholing | Redirecting DNS queries for C2 domains to an internal server to prevent adversary communication and detect additional victims |

| Microsegmentation | Granular network access controls between workloads that limit lateral communication paths |

Tools & Systems

Common Scenarios

Scenario: Ransomware Lateral Propagation via SMB

Context: EDR alerts on three file servers showing rapid file encryption. The ransomware is spreading via SMB using a compromised domain service account.

Approach:

  1. Immediately isolate all three file servers via EDR network containment
  2. Disable the compromised service account in Active Directory
  3. Block SMB (TCP 445) between all server VLANs at the network switch layer
  4. Deploy an emergency GPO disabling the SMB server service on non-critical endpoints
  5. Capture memory from one encrypted server before it reboots
  6. Search for the ransomware binary hash across all endpoints using EDR threat hunting

Pitfalls:

Output Format

CONTAINMENT STATUS REPORT
=========================
Incident:        INC-2025-1547
Status:          CONTAINED (Short-Term)
Timestamp:       2025-11-15T15:47:00Z
Containment Lead: [Name]

ACTIONS TAKEN
Network:
- [x] 5 hosts isolated via CrowdStrike containment
- [x] C2 IP 185.220.x.x blocked at perimeter FW (rule #4521)
- [x] C2 domain evil.example[.]com sinkholed to 10.0.0.99

Identity:
- [x] jsmith account disabled
- [x] svc-backup account disabled, password rotated
- [x] admin-tier0 account disabled
- [x] KRBTGT first reset completed at 15:30 UTC

Endpoint:
- [x] Malicious hash blocked in EDR prevention policy
- [x] Malware processes terminated on all contained hosts

EVIDENCE PRESERVED
- Memory dumps: 3 of 5 hosts completed
- Event logs exported: all 5 hosts
- Network capture: running on finance VLAN

REMAINING RISKS
- Possible undiscovered implants on non-EDR endpoints (15 legacy hosts)
- KRBTGT second reset pending (scheduled 03:30 UTC +1 day)
- Adversary may have exfiltrated data before containment

BUSINESS IMPACT
- Finance file share offline (affects 42 users)
- 3 user workstations isolated (users reassigned to loaners)
- Estimated restoration: pending eradication completion
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.