The culmination of everything you have learned — bringing together monitoring, detection, response, forensics, and hardening into a single integrated defense operation, augmented by AI at every step.
Full lifecycle defense against a multi-stage attack using every tool and technique from Lessons 1-9
Defend a live network, detect intrusions, respond, recover, and write the final report
This capstone combines all defensive techniques from the course. These skills are for authorized security operations and CTF competitions. Always follow your organization's security policies and procedures.
Everything in this lesson assumes you are operating within a sanctioned environment — your own lab, an authorized engagement, or a CTF competition. Unauthorized use of these techniques against systems you do not own is illegal.
| Lesson | Core Skill | Capstone Role |
|---|---|---|
| 1 — SOC Fundamentals | Alert triage & SIEM basics | Initial detection layer |
| 2 — Log Analysis | Pattern recognition in logs | Evidence collection |
| 3 — Network Defense | Traffic analysis & IDS | Network monitoring |
| 4 — Endpoint Security | Host-based detection | Endpoint protection |
| 5 — Threat Intelligence | IOC feeds & enrichment | Contextual awareness |
| 6 — Incident Response | Containment & eradication | Active response |
| 7 — Digital Forensics | Evidence preservation & analysis | Post-incident analysis |
| 8 — AI-Augmented Defense | LLM-powered analysis | AI at every stage |
| 9 — Hardening & Prevention | Configuration & patching | Post-incident hardening |
No single control stops a determined attacker. Defense-in-depth layers multiple controls so that failure at one layer is caught by the next.
┌──────────────────────────────────┐
│ AI CORRELATION │
│ (LLM analysis across layers) │
└────────────────┬─────────────────┘
│
┌────────────┬──────────────┬────┴──────┬──────────────┬────────────┐
│ │ │ │ │ │
┌───┴───┐ ┌────┴────┐ ┌─────┴─────┐ ┌───┴───┐ ┌──────┴──────┐ ┌───┴───┐
│Perim- │ │ Network │ │ Endpoint │ │ App │ │ Data │ │ Human │
│eter │ │ │ │ │ │ │ │ │ │ │
│-------│ │---------│ │-----------│ │-------│ │-------------│ │-------│
│FW/WAF │ │IDS/IPS │ │EDR/AV │ │AuthN │ │Encryption │ │Train │
│DDoS │ │Segm. │ │Whitelist │ │AuthZ │ │DLP │ │Phish │
│DNS │ │NetFlow │ │Hardening │ │Input │ │Backups │ │Review │
└───────┘ └─────────┘ └───────────┘ └───────┘ └─────────────┘ └───────┘
Each layer feeds telemetry into the centralized SIEM, where the AI correlation engine connects dots across layers in real time.
A modern Security Operations Center operates in a continuous loop. AI enhances each phase without replacing human judgment.
| SOC Tier | Role | AI Augmentation |
|---|---|---|
| Tier 1 — Alert Analyst | Initial triage, ticket creation | Auto-classification, severity scoring, context enrichment |
| Tier 2 — Incident Responder | Deep investigation, containment | Attack chain reconstruction, IOC correlation, suggested actions |
| Tier 3 — Threat Hunter | Proactive hunting, tool development | Anomaly detection, hypothesis generation, query building |
| SOC Manager | Metrics, reporting, staffing | Automated KPI dashboards, trend analysis, executive summaries |
Every defense scenario follows this cycle. The capstone challenge will test your ability to execute each phase under pressure.
MONITOR ──→ DETECT ──→ RESPOND ──→ FORENSICS ──→ HARDEN
↑ │
└────────────── CONTINUOUS IMPROVEMENT ──────────────┘
You are the lead blue team analyst for Nexus Financial Corp. At 02:47 UTC, your SIEM fires a cluster of alerts. Over the next several hours, a sophisticated threat actor executes a multi-stage attack across your infrastructure. Your mission: detect every phase, contain the damage, preserve evidence, and harden the environment — using AI assistance at every step.
Before you can detect anomalies, you need to know what "normal" looks like. Your monitoring stack must cover every layer.
# Monitoring stack configuration
log_sources:
network:
- zeek_conn_logs # Connection metadata
- suricata_alerts # IDS signature matches
- netflow_v9 # Traffic flow records
- dns_query_logs # DNS resolution tracking
endpoint:
- windows_security_log # Event IDs 4624, 4625, 4688, etc.
- sysmon_events # Process creation, network, file
- linux_auditd # Syscall auditing
- edr_telemetry # CrowdStrike/Defender events
application:
- nginx_access_log # Web request logs
- nginx_error_log # Server errors
- auth_service_log # Authentication events
- database_audit_log # SQL query auditing
cloud:
- aws_cloudtrail # API call history
- vpc_flow_logs # Network flows in AWS
- s3_access_logs # Bucket access tracking
Use an LLM to analyze your baseline and flag deviations before traditional rules catch them.
import anthropic
def ai_baseline_analysis(current_metrics, baseline_stats):
"""Use AI to compare current metrics against established baselines."""
client = anthropic.Anthropic()
prompt = f"""Analyze these current network metrics against our baseline.
Flag anything anomalous and explain why it matters.
BASELINE (30-day average):
{baseline_stats}
CURRENT (last 15 minutes):
{current_metrics}
For each anomaly found, provide:
1. Metric name and current vs expected value
2. Deviation severity (low/medium/high/critical)
3. Possible benign explanation
4. Possible malicious explanation
5. Recommended investigation steps"""
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=2000,
messages=[{"role": "user", "content": prompt}]
)
return response.content[0].text
Alert 1: Suricata — ET EXPLOIT Apache Struts RCE Attempt (10.0.1.50)
Alert 2: Suricata — ET EXPLOIT Apache Struts RCE Attempt (10.0.1.50)
Alert 3: Sysmon — Suspicious PowerShell Encoded Command (WS-042)
Alert 4: Zeek — Unusual DNS TXT Query Volume (internal → external)
Alert 5: CloudTrail — AssumeRole from unusual IP (198.51.100.47)
Five alerts in 3 minutes. A Tier 1 analyst might treat these as separate events. AI correlation reveals they are one attack with multiple fronts.
def correlate_alerts_with_ai(alerts):
"""Feed multiple alerts to AI for cross-layer correlation."""
client = anthropic.Anthropic()
alert_text = "\n".join([
f"[{a['timestamp']}] {a['source']}: {a['description']} "
f"(src={a['src_ip']}, dst={a['dst_ip']})"
for a in alerts
])
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=3000,
messages=[{"role": "user", "content": f"""You are a SOC analyst.
Correlate these alerts and determine if they represent:
A) Unrelated events B) Related campaign C) Active multi-stage attack
ALERTS:
{alert_text}
Provide:
1. Correlation assessment with confidence level
2. Attack chain hypothesis (MITRE ATT&CK mapping)
3. Predicted next attacker moves
4. Immediate containment recommendations
5. Evidence to preserve NOW before it is lost"""}]
)
return response.content[0].text
The AI identifies this as a coordinated attack: web exploitation + lateral movement + data staging + cloud pivot. Confidence: 94%.
| Tactic | Technique | Evidence |
|---|---|---|
| Initial Access | T1190 — Exploit Public-Facing App | Struts RCE attempts on web server |
| Execution | T1059.001 — PowerShell | Encoded command on WS-042 |
| Persistence | T1053.005 — Scheduled Task | New task on compromised host |
| Defense Evasion | T1027 — Obfuscated Files | Base64 PowerShell, packed binaries |
| Lateral Movement | T1021.002 — SMB/Admin Shares | Unusual SMB connections |
| Collection | T1560 — Archive Collected Data | 7zip activity on file server |
| Exfiltration | T1048.001 — Exfil Over DNS | High-volume DNS TXT queries |
| Cloud | T1078.004 — Cloud Accounts | AssumeRole from attacker IP |
With the attack confirmed, containment must be swift and surgical. Contain too broadly and you disrupt business; too narrowly and the attacker pivots.
# Emergency firewall block
sudo iptables -I INPUT -s 198.51.100.47 -j DROP
sudo iptables -I OUTPUT -d 198.51.100.47 -j DROP
# DNS sinkhole entry
echo "198.51.100.47 exfil-c2.evil.example" >> /etc/hosts
# AWS session revocation
aws iam put-role-policy --role-name CompromisedRole \
--policy-name EmergencyDeny \
--policy-document '{"Version":"2012-10-17","Statement":[{"Effect":"Deny","Action":"*","Resource":"*","Condition":{"DateLessThan":{"aws:TokenIssueTime":"2026-04-09T03:00:00Z"}}}]}'
def generate_response_playbook(incident_summary, environment_context):
"""Generate a tailored IR playbook using AI."""
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=4000,
messages=[{"role": "user", "content": f"""As a senior incident responder,
generate a step-by-step playbook for this incident.
INCIDENT SUMMARY:
{incident_summary}
ENVIRONMENT:
{environment_context}
Include for EACH step:
- Action to take (specific commands where possible)
- Purpose / what this achieves
- Risk if skipped
- Verification check (how to confirm success)
- Estimated time to complete
Organize by priority: P0 (immediate), P1 (within 1 hour), P2 (within 4 hours)."""}]
)
return response.content[0].text
Static playbooks cannot anticipate every scenario. AI generates context-specific steps based on the exact attack chain, environment topology, and available tools — then updates in real time as the situation evolves.
After containment stops the bleeding, eradication removes every trace of the attacker from the environment.
# Find and remove attacker scheduled tasks (Windows)
Get-ScheduledTask | Where-Object {
$_.Date -gt "2026-04-08" -and
$_.Author -notmatch "SYSTEM|Microsoft"
} | ForEach-Object {
Write-Host "Removing suspicious task: $($_.TaskName)"
Unregister-ScheduledTask -TaskName $_.TaskName -Confirm:$false
}
Forensics runs in parallel with response. The golden rule: preserve first, analyze second.
| Priority | Evidence Type | Volatility | Collection Method |
|---|---|---|---|
| 1 | Memory dumps | Highest | winpmem / LiME |
| 2 | Network captures | High | Full PCAP from tap/span |
| 3 | Running processes | High | volatility3 analysis |
| 4 | Log files | Medium | SIEM export + raw copy |
| 5 | Disk images | Low | dd / FTK Imager |
| 6 | Cloud logs | Low | CloudTrail S3 export |
def build_attack_timeline(log_entries, memory_artifacts, network_captures):
"""Use AI to reconstruct a unified attack timeline."""
client = anthropic.Anthropic()
evidence = f"""LOG ENTRIES (sorted by time):
{log_entries}
MEMORY ARTIFACTS:
{memory_artifacts}
NETWORK CAPTURES (summary):
{network_captures}"""
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=4000,
messages=[{"role": "user", "content": f"""Reconstruct a forensic timeline
from this evidence. For each event:
- Timestamp (UTC)
- Source of evidence
- Action taken by attacker
- MITRE ATT&CK technique
- Confidence level (confirmed/probable/possible)
- Gaps or missing evidence
Also identify:
- Earliest confirmed compromise time
- Dwell time estimate
- Data at risk / confirmed exfiltrated
- Any evidence of anti-forensics
{evidence}"""}]
)
return response.content[0].text
| Time (UTC) | Event | Layer |
|---|---|---|
| 02:31 | Reconnaissance — port scan from 198.51.100.47 | Network |
| 02:38 | Vulnerability scan targeting Apache Struts | Application |
| 02:44 | Successful RCE exploit on web server 10.0.1.50 | Application |
| 02:45 | Reverse shell established, C2 beacon activated | Network |
| 02:47 | First SIEM alerts fire (detection point) | SOC |
| 02:52 | Credential harvesting via Mimikatz on web server | Endpoint |
| 03:01 | Lateral movement to WS-042 via stolen credentials | Endpoint |
| 03:08 | Pivot to file server, data staging begins | Endpoint |
| 03:15 | DNS exfiltration channel established | Network |
| 03:22 | Cloud pivot — AssumeRole with stolen keys | Cloud |
| 03:30 | Containment actions initiated by blue team | SOC |
Dwell time before detection: 3 minutes. Dwell time before containment: 46 minutes.
After the incident, use threat modeling to understand what went wrong and what else could go wrong.
def ai_threat_model(system_description, known_vulnerabilities):
"""Use AI to perform STRIDE/DREAD analysis."""
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=4000,
messages=[{"role": "user", "content": f"""Perform a threat model for this system.
SYSTEM:
{system_description}
KNOWN VULNERABILITIES / RECENT INCIDENTS:
{known_vulnerabilities}
For each component, apply STRIDE analysis:
1. Identify threats per STRIDE category
2. Score each using DREAD (1-10 per dimension)
3. Calculate overall risk score
4. Recommend mitigations prioritized by risk
5. Identify trust boundaries and data flows at risk
Format as a structured report suitable for both
technical and management audiences."""}]
)
return response.content[0].text
| STRIDE Category | Threat Identified | DREAD Score | Mitigation |
|---|---|---|---|
| Spoofing | Stolen credentials used for lateral movement | 8.2 | MFA everywhere, credential monitoring |
| Tampering | Attacker modified scheduled tasks | 6.8 | File integrity monitoring, GPO lockdown |
| Repudiation | Cloud audit logs could be disabled | 5.4 | Immutable logging, log forwarding |
| Info Disclosure | Data exfiltrated via DNS tunneling | 9.1 | DNS monitoring, DLP, encryption at rest |
| Denial of Service | Web server taken offline during response | 4.6 | Redundancy, failover, WAF |
| Elevation | RCE to admin via unpatched Struts | 9.4 | Patching SLA, WAF rules, least privilege |
A production-grade security monitoring stack integrates open-source and commercial tools, unified by a central SIEM with AI analytics.
# Complete security monitoring stack
monitoring_stack:
siem:
primary: "Elastic Security (ELK)"
retention: "90 days hot, 1 year warm, 7 years cold"
ai_integration: "LLM API for alert enrichment"
network:
ids: "Suricata"
traffic_analysis: "Zeek"
flow_collection: "ntopng / NetFlow"
packet_capture: "Arkime (full PCAP)"
dns_monitoring: "passivedns + Pi-hole logs"
endpoint:
edr: "Wazuh / CrowdStrike"
sysmon: "SwiftOnSecurity config"
auditd: "STIG-compliant rules"
fim: "OSSEC file integrity"
cloud:
aws: "CloudTrail + GuardDuty + Config"
log_aggregation: "CloudWatch → Elastic"
threat_intel:
feeds: ["MISP", "AlienVault OTX", "abuse.ch"]
enrichment: "AI-powered IOC correlation"
automation:
soar: "Shuffle / TheHive + Cortex"
playbooks: "AI-generated, human-approved"
┌─────────────┐ ┌──────────────┐ ┌──────────────┐
│ Endpoints │ │ Network │ │ Cloud │
│ (Sysmon, │ │ (Suricata, │ │ (CloudTrail, │
│ Wazuh) │ │ Zeek) │ │ GuardDuty) │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
└─────────────────┼─────────────────┘
▼
┌─────────────────────┐
│ Log Aggregation │
│ (Logstash/Fluentd) │
└──────────┬──────────┘
▼
┌─────────────────────┐
│ Elastic Security │◄──── Threat Intel Feeds
│ (SIEM) │ (MISP, OTX)
└──────────┬──────────┘
▼
┌─────────────────────┐
│ AI Correlation │
│ (LLM Analysis) │
└──────────┬──────────┘
▼
┌─────────────────────┐
│ SOAR Platform │──── Automated Playbooks
│ (TheHive + Cortex) │──── Analyst Notifications
└─────────────────────┘
You cannot improve what you do not measure. These metrics prove the value of your SOC and guide investment decisions.
| Metric | Definition | Target | Our Scenario |
|---|---|---|---|
| MTTD | Mean Time To Detect | < 5 min | 3 min |
| MTTR | Mean Time To Respond | < 60 min | 43 min |
| MTTC | Mean Time To Contain | < 30 min | 46 min |
| FPR | False Positive Rate | < 10% | 8% |
| Alert Volume | Alerts per analyst per day | < 50 | 35 |
| Dwell Time | Attacker presence duration | < 24 hrs | 46 min |
| Coverage | ATT&CK techniques detected | > 70% | 82% |
AI does not just make analysts faster — it fundamentally changes what a SOC team can achieve. These numbers are the language that justifies budget to leadership.
Every incident is a lesson. Hardening transforms incident findings into permanent defensive improvements.
def generate_detection_rules(incident_ttps, log_format="sigma"):
"""Generate new detection rules from incident findings."""
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=4000,
messages=[{"role": "user", "content": f"""Based on these TTPs observed
during an incident, generate detection rules in {log_format} format.
OBSERVED TTPs:
{incident_ttps}
For each rule provide:
1. Rule in {log_format} format
2. MITRE ATT&CK mapping
3. Expected false positive sources
4. Tuning recommendations
5. Severity and confidence levels
Generate rules that would have caught this attack EARLIER."""}]
)
return response.content[0].text
title: DNS TXT Query Volume Anomaly
status: experimental
description: Detects high volume DNS TXT queries indicating possible data exfil
logsource:
category: dns
detection:
selection:
query_type: "TXT"
timeframe: 5m
condition: selection | count(query) by src_ip > 50
level: high
tags:
- attack.exfiltration
- attack.t1048.001
Static defenses lose effectiveness over time. Continuous improvement means your defenses evolve as fast as the threat landscape.
def update_detections_from_threat_intel(new_iocs, existing_rules):
"""Use AI to merge new threat intel into existing detection rules."""
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=3000,
messages=[{"role": "user", "content": f"""Review these new IOCs from
threat intelligence feeds and recommend updates to our detection rules.
NEW THREAT INTELLIGENCE:
{new_iocs}
EXISTING RULES (summary):
{existing_rules}
For each recommendation:
1. Which existing rule to update (or new rule needed)
2. Specific changes to make
3. Rationale tied to threat actor behavior
4. Risk of false positives from the change
5. Priority (deploy immediately / next maintenance window / backlog)"""}]
)
return response.content[0].text
MISP (community IOCs), AlienVault OTX (open threat exchange), abuse.ch (malware/botnet tracking), VirusTotal (file/URL reputation), Shodan (exposure monitoring), and sector-specific ISACs.
Every incident ends with a report. The executive summary is what leadership reads. The technical appendix is what your peers review.
def generate_executive_summary(incident_data):
"""Generate an executive-friendly incident summary."""
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=2000,
messages=[{"role": "user", "content": f"""Write an executive summary
for this security incident. The audience is C-suite and board members.
INCIDENT DATA:
{incident_data}
Requirements:
- No jargon — explain technical terms in business language
- Lead with business impact (financial, operational, reputational)
- Include timeline with key milestones
- State what data was at risk and what was confirmed compromised
- Summarize response actions and their effectiveness
- List top 3 investment recommendations with cost/benefit
- Keep under 500 words
- Professional, factual tone — no speculation without labeling it"""}]
)
return response.content[0].text
The capstone challenge requires you to use every major tool and technique from the course. Here is the integrated toolkit.
| Phase | Tools | AI Role |
|---|---|---|
| Monitor | ELK, Zeek, Suricata, Sysmon, CloudTrail | Baseline anomaly detection |
| Detect | SIEM rules, Sigma, YARA, Snort | Alert correlation & prioritization |
| Respond | TheHive, Cortex, iptables, AWS CLI | Playbook generation & guidance |
| Forensics | Volatility, Autopsy, Wireshark, plaso | Timeline reconstruction & analysis |
| Harden | CIS Benchmarks, Ansible, Terraform | Rule generation & config review |
| Report | Markdown, LaTeX, JIRA | Drafting & summarization |
You are the blue team for MedTech Industries. An active, multi-stage attack is underway against your healthcare infrastructure. Patient data, research IP, and operational systems are all at risk. Detect, respond, and recover using AI at every step. You have 4 hours.
The ransomware (Stage 7) is a distraction. The real objective was data theft in Stages 5-6. Can your team identify the true threat while managing the visible crisis?
You have full access to the Claude API throughout the challenge. How you use it is part of the evaluation. Be strategic — document every AI interaction and how it influenced your decisions.
| Criterion | Points | Description |
|---|---|---|
| Attack stages identified | 20 | Each of 7 stages correctly identified (partial credit for incomplete) |
| MITRE ATT&CK mapping | 15 | Accurate technique IDs for each stage |
| IOC extraction | 10 | Complete list of IPs, domains, hashes, file paths |
| AI-assisted correlation | 10 | Effective use of AI for cross-log correlation |
| False flag identification | 5 | Recognizing ransomware as diversion |
Phase A Total: 60 points
| Criterion | Points | Description |
|---|---|---|
| Containment actions | 15 | Appropriate, timely, well-scoped containment |
| Eradication completeness | 10 | All persistence mechanisms identified and removed |
| AI playbook quality | 10 | Context-specific, actionable, prioritized steps |
| Business continuity | 5 | Minimized operational disruption during response |
| Command documentation | 5 | Every response command logged with timestamp |
Phase B Total: 45 points
| Criterion | Points | Description |
|---|---|---|
| Timeline accuracy | 15 | Complete, chronologically correct attack timeline |
| Evidence handling | 10 | Proper chain of custody, hash verification |
| Memory analysis | 10 | Artifacts extracted from RAM dump (processes, network, injected code) |
| Data exposure assessment | 5 | Accurate determination of what data was accessed/exfiltrated |
| AI-assisted analysis | 5 | Effective use of AI for artifact interpretation |
| Criterion | Points | Description |
|---|---|---|
| Detection rules | 10 | Valid Sigma/YARA rules for observed TTPs |
| 90-day hardening plan | 10 | Prioritized, realistic, addresses root causes |
| Executive summary | 10 | Clear, non-technical, business-impact focused |
| Technical report | 10 | Complete, evidence-backed, properly structured |
| AI documentation | 10 | Clear record of how AI was used and its impact on outcomes |
Grand Total: 200 points
| Grade | Points | Description |
|---|---|---|
| Distinguished | 180-200 | Exceptional defense; identified all attack stages including the diversion; professional-quality reports |
| Proficient | 140-179 | Solid defense; detected most stages; effective containment and good documentation |
| Developing | 100-139 | Adequate defense; missed some attack stages or containment gaps; reports need improvement |
| Beginning | < 100 | Significant gaps in detection or response; incomplete analysis and reporting |
Over 10 lessons, you have built a complete defensive skill set enhanced by AI at every stage. Here is what you now know how to do:
You do not just know how to use security tools — you know how to think like a defender, leverage AI as a force multiplier, and communicate your findings effectively. That combination is rare and valuable.