Lesson 6 of 6 · 20 min read

Network Containment Actions — Blocks, Blocks, and What to Block

Network containment is the bridge between investigation and remediation. A vague block request can cause an outage worse than the attack. A precise, well-specified block stops the threat without collateral damage.


The Containment Action Decision Tree

Is the attacker currently active (live session)?

├─YES → Isolate host first (EDR isolation) → THEN block
│         Reason: blocking without isolation alerts attacker;
│         host isolation is atomic and cuts all channels

└─NO  → Direct block (no active session to alert attacker)

          What are you blocking?
          ├─ IP address → verify it's not a CDN
          │               → firewall outbound block, specific port if possible
          ├─ Domain    → DNS sinkhole (preferred — catches all infected hosts)
          │               → proxy URL block as backup
          └─ URL path  → proxy block (domain may be legitimate; path is malicious)

Block Specification Format

IP Block

ACTION: Outbound Block — IP
Target: 185.220.101.7
Protocol: TCP
Port: 443
Direction: Outbound (from internal network)
Duration: Until IR ticket IR-2024-0892 closes, then review
Risk check: Not a CDN IP (confirmed via ipinfo.io — this is a single-tenant Tor exit node)
Justification: Confirmed C2 IP for Cobalt Strike beacon on CORP-PC-022 (see alert TKT-4421)
Owner: firewall-team

Domain Block (DNS Sinkhole)

ACTION: DNS Sinkhole
Target: update.windowsmirror.net
Sinkhole IP: 10.0.0.250 (internal sinkhole address for logging)
Duration: Permanent (attacker-registered domain, no legitimate use)
Risk check: No legitimate business purpose (domain registered 9 days ago, not a vendor)
Additional: Also block at proxy (in case of DoH bypass)
Justification: C2 domain for Cobalt Strike beacon (see alert TKT-4421)
Side effect: Will reveal any other hosts querying this domain — check sinkhole logs
Owner: dns-team

URL Block (Proxy)

ACTION: URL Block at Proxy
Target: https://legitimate-cdn.com/malicious-path/payload.exe
Method: Block full URL (not the domain — domain serves legitimate content)
Duration: 90 days, then review
Risk check: legitimate-cdn.com serves other content — DO NOT block the domain
Justification: Phishing attachment delivery URL — malware download confirmed via sandbox
Owner: proxy-team

What Not to Block (Without Checking First)

TargetRiskSafer Alternative
CDN IPs (Cloudflare, AWS)Blocks thousands of unrelated domainsBlock domain at DNS/proxy
*.microsoft.comBreaks Office 365, AzureBlock specific subdomains only
Large ASNs (e.g., /8 block)Massive collateral damageBlock specific IPs or /24 at most
Google Drive domainBreaks all GDrive accessBlock at CASB; restrict by account
Port 443 outboundBreaks all HTTPSBlock specific IPs/domains only

Sinkhole Monitoring

When you sinkhole a C2 domain, every host that queries it is revealed:

# Sinkhole server logs (10.0.0.250):
14:32:01  query from 10.1.2.3  for windowsmirror.net  → sinkholed
14:32:08  query from 10.4.5.6  for windowsmirror.net  → sinkholed   ← NEW VICTIM
14:32:15  query from 10.1.7.8  for windowsmirror.net  → sinkholed   ← NEW VICTIM

A sinkhole that shows 3 internal hosts querying the C2 domain means 3 infected hosts — not just the one you found originally. The sinkhole turns a single-host investigation into a campaign scope assessment.


Post-Block Validation

After implementing blocks, verify they’re effective and not causing collateral damage:

1. Confirm block is in effect:
   - From an internal test machine: attempt connection to blocked IP/domain
   - Should fail (connection refused or DNS NXDOMAIN from sinkhole)

2. Confirm no collateral damage:
   - Check service monitoring dashboards for alerts in the 10 minutes post-block
   - Check helpdesk for user tickets related to the blocked scope
   - Spot-check that related legitimate domains still resolve

3. Monitor for C2 fallback:
   - After host isolation + C2 block, watch for new outbound connections
     from adjacent hosts — the malware may have already spread