π Detection & Threat Hunting Query Repository
Production KQL, Sigma, and Splunk hunts covering MITRE ATLAS AI attacks and 2026 active compromise tradecraft.
Detects AI assistants/agents invoking high-privilege outbound tools (email send, webhook POST, file export) immediately after ingesting untrusted external documents or RAG context.
AIAgentAuditLogs
| where TimeGenerated > ago(24h)
| where ActionType in ("ToolInvocation", "PluginExecution", "MCP_Call")
| where ToolName has_any ("SendEmail", "HttpPost", "ExportData", "GraphMail", "SlackPost")
| extend PromptSource = tostring(AdditionalFields.contextSource)
| where PromptSource has_any ("ExternalDocument", "SharedDrive", "WebScrape", "UntrustedEmail")
| project TimeGenerated, UserPrincipalName, AgentName, ToolName, PromptSource, TargetURI = tostring(AdditionalFields.targetUrl)
| sort by TimeGenerated desc
Hunts for shell spawning or outbound transfers of .safetensors / .gguf / .bin model weights from LLM inference processes.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where InitiatingProcessCommandLine has_any ("sglang", "vllm", "ollama", "tritonserver", "torchserve")
| where FileName in~ ("sh", "bash", "curl", "wget", "python3", "nc", "rclone", "aws")
or ProcessCommandLine has_any (".safetensors", ".gguf", "/root/.ssh", "169.254.169.254")
| project Timestamp, DeviceName, AccountName, InitiatingProcessCommandLine, FileName, ProcessCommandLine
Identifies high-volume outbound POST requests from non-approved workstations or service accounts to external AI inference APIs.
CommonSecurityLog
| where TimeGenerated > ago(24h)
| where DestinationHostName has_any ("api.openai.com", "api.anthropic.com", "generativelanguage.googleapis.com", "api.deepseek.com", "openrouter.ai", "huggingface.co")
| where SentBytes > 524288
| summarize TotalMB = round(sum(SentBytes)/1048576.0, 2), SessionCount = count() by SourceIP, SourceUserName, DestinationHostName
| where TotalMB > 5.0
| sort by TotalMB desc
Detects unauthorized Content-Security-Policy (CSP) script-src / connect-src violations or DOM wallet-swapping loaders injected via third-party experimentation/CDN tags.
W3CIISLog
| where TimeGenerated > ago(24h)
| where csUriStem has "csp-report" or csUserAgent has "CSP"
| extend BlockedURI = extract("blocked-uri[\"']?:\\s*[\"']([^\"']+)", 1, csUriQuery)
| where isnotempty(BlockedURI)
| where BlockedURI !has_any ("google-analytics.com", "googletagmanager.com", "cloudflareinsights.com")
| summarize HitCount = count(), SamplePages = make_set(cReferrer, 5) by BlockedURI
| sort by HitCount desc
Detects high-risk OAuth permissions granted or replayed from unfamiliar ASN/hosting IPs following credential/token breaches.
AuditLogs
| where TimeGenerated > ago(7d)
| where OperationName has_any ("Consent to application", "Add OAuth2PermissionGrant", "Add app role assignment")
| extend AppName = tostring(TargetResources[0].displayName), Initiator = tostring(InitiatedBy.user.userPrincipalName), IP = tostring(InitiatedBy.user.ipAddress)
| where tostring(TargetResources[0].modifiedProperties) has_any ("Mail.Read", "Files.Read.All", "offline_access", "Directory.ReadWrite.All")
| project TimeGenerated, Initiator, IP, AppName, OperationName
Upgrade to Jedi Knight or Jedi Master to download exportable Sigma/KQL rule packs and test them inside Kasm & Matterhorn labs.
Unlock Jedi Knight Tier →π SOC Management, Operational KPIs & NICE Role Matrix
Operational metrics, shift governance benchmarks, and core workforce expectations mapped to the CISA NICCS / NICE Cybersecurity Workforce Framework.
Extended SOC Governance & Quality KPIs
| KPI Metric | Target Benchmark | Measurement Formula | Operational Owner |
|---|---|---|---|
| True Positive Escalation Accuracy | ≥ 90% | Confirmed Incidents / Total Tier-1 Escalations |
SOC Analysts (PD-WRL-001) |
| MITRE ATT&CK / ATLAS Coverage | ≥ 75% Priority TTPs | Active Tested Rules / Relevant Threat Profile Techniques |
Detection Engineering & Threat Analysis |
| Forensic Triage Turnaround | < 4 hrs (Volatile) | Time from Escalation to Memory/Disk Artifact Acquisition |
Digital Forensics Specialists (PD-WRL-002) |
| Playbook Automation Rate (SOAR) | ≥ 45% L1 Alerts | Auto-Enriched & Auto-Closed Alerts / Total Alert Volume |
SOC Manager & Infrastructure Support |
| Post-Incident Review (PIR) SLA | ≤ 5 Business Days | Root Cause + Detection Gap Report Delivered Post-Closure |
Incident Response Manager (PD-WRL-003) |
ποΈ Core Role Expectations & Abilities (CISA NICCS / NICE Framework)
Reference: CISA NICCS Career Pathways →Standardized expectations, core abilities, and measurable deliverables across SOC Analysts, Digital Forensics Specialists, and Incident Response Managers.
| SOC Group / NICE Role | Core NICE Abilities & Competencies | Day-to-Day Operational Expectations | Primary Deliverables & KPIs |
|---|---|---|---|
|
Cyber Defense Analysts Defensive Cybersecurity PD-WRL-001 / PD-WRL-006 |
β’ Correlate SIEM, EDR, network flow, and identity logs to separate benign anomalies from true intrusions. β’ Map observed activity to MITRE ATT&CK & ATLAS tactics. β’ Perform proactive hypothesis-driven threat hunting. |
β’ Acknowledge P1/P2 alerts within 10 minutes. β’ Enrich IOCs (hashes, IPs, OAuth app IDs, domains) before escalating. β’ Submit weekly rule-tuning feedback to reduce alert fatigue. |
β’ Triage tickets with clear timeline & IOC summary. β’ ≥ 90% escalation accuracy. β’ 1+ validated threat hunt query per sprint. |
|
Forensics Specialists Digital Forensics PD-WRL-002 / IN-WRL-002 |
β’ Acquire and preserve volatile memory, disk images, cloud audit trails, and container snapshots with strict chain-of-custody. β’ Reconstruct attacker lateral movement, persistence, and malware execution timelines. β’ Extract actionable host/network IOCs from binaries and scripts. |
β’ Preserve forensic integrity before system reimaging or remediation. β’ Conduct deep-dive root cause analysis on escalated P1 intrusions. β’ Maintain court-admissible evidence logs and cryptographic hashes. |
β’ Chain-of-custody & forensic acquisition logs. β’ Master attack timeline & root-cause report. β’ Extracted YARA/Sigma signatures for SOC deployment. |
|
Incident Managers Incident Response PD-WRL-003 / OG-WRL-002 |
β’ Command end-to-end incident lifecycle (Preparation, Detection, Containment, Eradication, Recovery, Post-Incident). β’ Coordinate across IT, Legal, Executive Leadership, PR, and external regulators. β’ Assess business impact, regulatory notification clocks, and containment risk. |
β’ Lead war-room bridge calls and assign clear containment workstreams. β’ Approve high-impact containment actions (network segmentation, tenant-wide token revocation). β’ Drive blameless Post-Incident Reviews and control remediation tracking. |
β’ Executive situation reports (SITREPs) on cadence. β’ Containment within < 60m SLA. β’ Formal PIR & control-gap action plan within 5 days. |
π― Threat Library & Enterprise Attack Vectors
Tactical breakdown of high-frequency adversary tradecraft across Email, Identity, Cloud/AI, and Web infrastructure.
| Vector | Adversary Technique | Primary Detection Focus |
|---|---|---|
| AI & LLM Pipelines | Indirect Prompt Injection & Inference RCE (ATLAS) | Monitor AI agent outbound tool calls & inference container child processes. |
| Identity & OAuth | Illicit OAuth App Consent & Session Token Replay | Audit high-privilege Graph/GitHub scopes & anomalous ASN token usage. |
| Web & Supply Chain | Third-Party CDN / Tag Manager JS Skimming | Enforce strict CSP headers, Subresource Integrity (SRI), and CSP violation alerts. |
| Email & BEC | Quishing (QR), SVG Smuggling & Hidden Inbox Rules | Audit New-InboxRule forwarders & inspect base64/SVG attachments. |
| Host & Ransomware | BYOVD Driver Abuse & Shadow Copy Deletion | Block vulnerable drivers via WDAC/HVCI & alert on vssadmin / wbadmin. |
π¬ Standard Operating Procedures (Investigation SOPs)
17 step-by-step containment, scoping, and eradication runbooks for SOC analysts and incident responders.
- Contain: Revoke active refresh tokens and OAuth application grants immediately in Entra ID / Authentik / GitHub.
- Scope: Query 7-day sign-in and audit logs for unfamiliar ASNs, device registrations, or MFA method changes.
- Eradicate: Reset credentials, rotate exposed API secrets/SSH keys, and remove unauthorized mailbox forwarding rules.
- Verify: Confirm zero subsequent token replay attempts over the next 24 hours.
- Isolate: Quarantine the inference container/pod (SGLang/vLLM/Ollama) while preserving memory and container filesystem layers.
- Inspect Prompts & RAG Sources: Review recent retrieved documents and tool-call execution logs for indirect prompt injection payloads.
- Audit Egress: Check firewall/proxy logs for unauthorized outbound connections or model-weight (
.safetensors/.gguf) transfers.
- Isolate: Trigger immediate EDR network containment on affected hosts and block SMB (TCP/445) / RDP lateral segments at the firewall.
- Preserve Forensics: Capture volatile RAM before rebooting; inspect
vssadmin,wbadmin, and RMM tool execution logs. - Identify Patient Zero: Pivot on the initiating binary hash, scheduled task, or compromised domain admin account across all endpoints.
- Protect Backups: Verify immutable backup repositories and isolate backup management interfaces from production AD.
- Contain: Revoke active Exchange/M365/Google Workspace sessions and reset the compromised user's password.
- Inspect Rules & Delegates: Audit
New-InboxRule,Set-Mailboxforwarding addresses, and delegated mailbox permissions. - Scope Financial Fraud: Search sent items for wire-transfer/invoice-change lures sent to vendors or finance staff and alert counterparties immediately.
- Purge Lures: Content-search and purge inbound phishing messages across all tenant mailboxes.
- Detect Replay: Correlate sign-ins where the initial MFA challenge and subsequent session token use originate from different ASNs/user-agents.
- Revoke Tokens: Invalidate all refresh tokens (
Revoke-MgUserSignInSession) and clear persistent browser session cookies. - Audit MFA Methods: Remove any newly registered FIDO2 keys, authenticator apps, or SMS numbers added during the attacker session.
- Contain: Isolate the endpoint via EDR and block outbound RMM relay domains/ports at the perimeter proxy.
- Trace Delivery: Inspect browser downloads, email attachments, or PowerShell/MSIEXEC parent processes to determine initial execution.
- Sweep Fleet: Query EDR software inventory and service creation logs (Event ID 7045) for rogue RMM binaries across all hosts.
- Detect: Review Security Event ID 4769 (RC4-HMAC TGS spikes) and Event ID 4662 (
DS-Replication-Get-Changes-Allfrom non-DC IPs). - Contain: Isolate the source workstation/server immediately and disable the compromised service or privileged account.
- Reset KRBTGT: If DCSync succeeded, execute a double
krbtgtpassword reset (spaced 10+ hours apart) and rotate all service account passwords.
- Contain: Remove or pin the compromised third-party script/CDN tag and enforce a strict
Content-Security-Policy(CSP) blocking unauthorizedconnect-srcdomains. - Preserve Payload: Download and hash the tampered JS file before purging CDN caches so indicators can be extracted.
- Assess Exposure: Audit web access logs during the injection window to identify impacted checkout/wallet pages and notify affected users.
- Contain: Restrict management plane exposure from WAN immediately and apply vendor emergency patches/mitigations.
- Inspect Integrity: Run vendor integrity verification tools, check for unauthorized local admin accounts, web shells, or modified SSL-VPN portals.
- Pivot Internally: Hunt for LDAP/RADIUS credential harvesting or lateral movement originating from the appliance's internal LAN IP.
- Contain: Deactivate or delete the exposed IAM access key / PAT token immediately before rotating replacement secrets.
- Audit CloudTrail / Activity Logs: Query all API calls made by the key IDβfocusing on
CreateUser,AttachUserPolicy,GetSecretValue, and S3/Blob reads. - Eradicate Persistence: Remove any rogue IAM users, roles, or compute instances spun up during the exposure window.
- Contain: Block egress to cloud storage/file-sharing endpoints at the firewall and isolate the staging host via EDR.
- Quantify Scope: Inspect NetFlow/proxy byte counts, archive staging directories (
.7z,.rar,.zip), andrclone.conffiles to determine what data left the network. - Notify Legal/IR Lead: Escalate confirmed exfiltration volumes and affected file shares immediately for regulatory assessment.
- Identify Process: Correlate the internal source IP/port in firewall/Zeek logs with EDR network connection telemetry to pinpoint the beaconing binary.
- Sinkhole / Block: Sinkhole the C2 domain in internal DNS and block destination IPs/JA4 TLS fingerprints at the perimeter.
- Dump & Analyze: Capture process memory and binary sample for sandbox detonation in Kasm/CAPE to extract fallback C2 infrastructure.
- Detect: Hunt for web server worker processes (
w3wp.exe,nginx,php-fpm,java) spawning command shells (cmd.exe,powershell,/bin/sh). - Contain: Take the compromised web node out of the load balancer pool and isolate host egress.
- Diff Web Root: Compare web root files against clean Git/CI build artifacts to uncover injected
.aspx/.php/.jspshells and backdoored libraries.
- Freeze Pipelines: Pause affected GitHub Actions / GitLab CI runners and quarantine builds that pulled the tainted npm/PyPI/Docker package.
- Rotate Runner Secrets: Assume all environment variables, signing keys, and cloud OIDC tokens exposed to the build runner are compromised and rotate immediately.
- Pin Hashes: Enforce lockfile integrity hashes and private registry namespace scoping before resuming deployments.
- Isolate & Revoke: Isolate the infected endpoint and revoke all active SSO, VPN, and SaaS sessions for the logged-in user.
- Assume Browser Vault Compromise: Treat every saved browser password, session cookie, and local SSH/AWS config file on the host as exfiltrated.
- Reimage & Reset: Perform a full OS wipe/reimage (do not rely on AV cleanup alone) and force password resets across all accessed corporate apps.
- Contain: Apply a deny-all
NetworkPolicyto the suspect namespace/pod and cordon the underlying worker node. - Inspect Admission & Audit Logs: Check K8s API audit logs for privileged pod creations,
hostPathmounts, or service account token reads. - Rotate Cluster Secrets: Rotate compromised service account tokens, image pull secrets, and cloud metadata IAM roles.
- Contain: Temporarily disable external document ingestion pipelines into the vector database (Qdrant/Pinecone/pgvector) and restrict API write tokens.
- Audit Embeddings & Chunks: Scan recently indexed documents for hidden instruction-override text, white-on-white PDF text, or adversarial markdown links.
- Re-Index Clean Corpus: Purge poisoned document IDs, sanitize ingestion parsers, and rebuild affected vector collections from verified sources.
π SOC Regex & Log Extraction Repository
(?i)(ignore\s+(all\s+)?(previous|prior|above)\s+instructions|disregard\s+system\s+prompt|you\s+are\s+now\s+in\s+developer\s+mode|exfiltrate|reveal\s+your\s+system\s+instructions)
\b(0x[a-fA-F0-9]{40}|[13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[ac-hj-np-z02-9]{11,71}|T[A-Za-z1-9]{33})\b
(eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}|gh[pousr]_[A-Za-z0-9]{36}|sk-[A-Za-z0-9]{32,})
π§° Recommended Blue Team & SOC Defense Stack
Core open-source and self-hosted defensive tools integrated with AI CSOC workflows.
Unified SIEM & XDR with MITRE ATT&CK and MITRE ATLAS detection rule coverage.
Endpoint visibility and rapid VQL forensic artifact collection across fleets.
Automated STIX/TAXII indicator enrichment and real-time alert correlation.