端到端SOC自动化项目

总结
该项目展示了全自动安全运营中心(SOC)管道的设计和实施。我构建了一个虚拟化环境来模拟真实的企业防御工作流程。该系统检测网络威胁,使用威胁情报协调丰富内容,通过票务系统管理案件,并利用本地生成人工智能进行事件分析。
目标: 模拟现代SOC环境,通过自动化Tier 1 Analyst任务,重点消除警报疲劳并大幅缩短平均响应时间(MTTR)。
______________________________________________________________________
建筑与技术
- 端点: Windows 10(目标计算机)+系统
- 我们: Splunk Enterprise(日志管理和检测)
- 猛增: n8n(工作流自动化)
- 威胁英特尔: 滥用IPDB和VirusTotal(富集)
- 案例管理: DFIR-IRIS
- 警报: 向SOC团队发送的通知延迟
- AI分析师: OpenAI(Triage)和Claude MCP(基于聊天的日志分析)
- 指挥与控制: 原子红队(攻击模拟)
______________________________________________________________________
项目详解
1.实验室设置和基础设施
我使用VMware Workstation Pro建立了一个安全的虚拟化实验室环境,托管了Kali Linux攻击者机器、Windows 10目标和用于安全堆栈的Ubuntu服务器。
已配置 inputs.conf 在Splunk Universal Forwarder上接收Sysmon、应用程序、安全和系统日志。
Fig 1: The multi-OS virtualized lab environment.
______________________________________________________________________
2.攻击模拟与检测工程
为了验证管道,我使用原子红队模拟了凭证转储攻击(MITRE T1003),并开发了一个自定义检测规则来捕捉它。
进攻(红队): 我处决了 Invoke-AtomicTest T1059.001 (Mimikatz)在Windows 10端点上。此脚本试图转储内存以提取明文密码,模拟常见的对手技术。
Fig 2: PowerShell output showing successful execution of the Mimikatz simulation.
检测(蓝队): 我配置了Splunk警报,以摄取PowerShell操作日志并识别此攻击的特定特征。
Splunk处理语言(SPL):
index=mydfir-project "invoke-mimikatz" EventCode=4104 source="*PowerShell/Operational*"
| stats count min(_time) as first_seen max(_time) as last_seen by user, ComputerName
| sort - countFig 3: Verifying that Splunk successfully ingested Mimikatz execution logs.
警报配置和逻辑: 我用特定关键字配置了警报(invoke-mimikatz),源过滤(PowerShell/Operational)以及24小时油门。这减少了误报,同时确保了真正的Mimikatz攻击被检测到并立即报告,而不会让分析师被重复的票淹没。
我将严重性设置为HIGH,因为Mimikatz是用于凭据提取的关键威胁工具。这确保了自动化管道将其视为需要立即进行人工智能分析的紧急事件。
Fig 4: Tuning the alert logic to prevent alert fatigue while maintaining high severity for critical threats.
______________________________________________________________________
3.编排和自动化(n8n)
我通过Docker部署了n8n来编排事件响应工作流。这充当了连接不同安全工具的“胶水”。
- 丰富: 该工作流提取IP和哈希,并查询VirusTotal/AbuseIPDB。
- 人工智能分析: 它将数据推送到LLM(OpenAI),以生成人类可读的摘要和建议的操作。
Fig 5: End-to-End SOC automation workflow: Splunk detection → AI analysis → enrichment → IRIS ticket + Slack alert.
交付成果: 自动化机器人向Slack发布结构化警报,使SOC团队无需登录SIEM即可查看威胁摘要、富集数据和严重程度。
Fig 6: Final alert delivered to the analyst with AI-generated summary and recommendations.
AI提示配置
n8n工作流中的OpenAI节点使用以下提示来确保一致、高质量的威胁分析:
Act as a Tier 1 SOC analyst assistant. When provided with a security alert or incident details (including indicators of compromise, logs, or metadata), perform the following steps:
Summarize the alert – Provide a clear summary of what triggered the alert, which systems/users are affected, and the nature of the activity (e.g., suspicious login, malware detection, lateral movement).
Enrich with threat intelligence – Correlate any IOCs (IP addresses, domains, hashes) with known threat intel sources. For any IP enrichment use the tool named 'AbuseIPDB-Enrichment'. For any File Hash use the tool named 'VirusTotal-Hash' and use the URL: 'https://www.virustotal.com/api/v3/files/{id}' but replace the '{id}' in the url with an actual file hash. Highlight if the indicators are associated with known malware or threat actors.
Assess severity – Based on MITRE ATT&CK mapping, identify tactics/techniques, and provide an initial severity rating (Low, Medium, High, Critical).
Recommend next actions – Suggest investigation steps and potential containment actions.
Format output clearly – Return findings in a structured format (Summary, IOC Enrichment, Severity Assessment, Recommended Actions).
**ALERT DATA:**
Alert: {{ $json.body.search_name }}
Alert Details: {{ JSON.stringify($json.body.result, ['_time', 'user', 'ComputerName', 'src_ip'], 2) }}
File Hash: {{ $json.body.file_hash }}
Source IP: {{ $json.body.src_ip }}
**ENRICHMENT DATA:**
AbuseIPDB Results: {{ JSON.stringify($('AbuseIPDB-Enrichment').item.json) }}
VirusTotal Results: {{ JSON.stringify($('VirusTotal-Hash').item.json) }}此提示确保AI:
- 为每个警报提供结构化、一致的分析
- 整合了来自AbuseIPDB和VirusTotal的威胁情报
- 将威胁映射到MITRE ATT&CK框架
- 为SOC分析师提供可操作的建议
______________________________________________________________________
4.案例管理(DFIR-IRIS)
为了超越简单的警报,我集成了DFIR-IRIS进行正式的病例跟踪。
配置n8n工作流程,通过API将JSON警报数据直接映射到IRIS数据库中。
这确保了为每个检测到的事件创建不可变的审计跟踪。
Fig 7: Automated ticket creation in IRIS Case Management with IOC enrichment populated.
______________________________________________________________________
5.高级AI集成(Claude MCP服务器)
作为一项高级功能,我实现了模型上下文协议(MCP),将Claude Desktop与我的本地Splunk实例连接起来。这启用了“与您的数据聊天”功能。
基础设施代码: 我配置了 claude_desktop_config.json 以允许LLM针对Splunk API安全地执行Python脚本。
Fig 8: Configuring the JSON bridge between the LLM and the local Splunk server.
Fig 9: Verifying that the local MCP server is running and connected.
AI分析师: 我现在可以问Claude自然语言问题,比如“显示最后一个小时的可疑活动”,人工智能会生成SPL,查询数据库,并在不编写代码的情况下总结结果。
Fig 10: AI Agent independently querying Splunk and summarizing the Credential Dumping attack.
______________________________________________________________________
核心技术能力
- SIEM管理: 日志解析、通用转发器配置和SPL查询。
- 检测工程: 调整警报以减少误报,并分配适当的风险评分。
- SOAR开发: 构建基于API的工作流并处理JSON数据结构。
- 基础设施: Docker容器管理、Linux CLI管理和VMware网络。
- 人工智能工程: 通过模型上下文协议(MCP)实现本地LLM集成。
- 威胁情报: 通过API自动进行信誉检查。
