Ctum0/SOC-Foundation-Lab
GitHub: Ctum0/SOC-Foundation-Lab
基于 Wazuh SIEM 构建的端到端 SOC 实验室,涵盖检测工程、事件调查与 AI 辅助告警分诊的完整流程。
Stars: 0 | Forks: 0
# SOC 基础实验室
一个基于开源 SIEM/XDR 平台 Wazuh 构建的实用安全运营中心 (SOC) 实验室。本仓库记录了一个以 Linux 为中心的构建过程,包含六个可用的检测项、完整的恶意软件调查以及自定义的 AI 分诊集成,所有内容均截取自真实部署环境。
## 实验室演示内容
- 通过对 `/root` 进行实时 `syscheck` 实现文件完整性监控
- 使用 Suricata 进行网络入侵检测(Nmap 扫描检测)
- 针对实时软件清单的持续漏洞检测
- 使用 `auditd` 和 CDB 列表丰富功能进行 Root 命令审计
- 通过自动 `firewall-drop` 主动响应进行 SSH 暴力破解检测
- 通过触发自定义 FIM 规则的 VirusTotal 集成进行恶意软件检测
- 将告警转化为结构化分析师报告的 AI 辅助分诊层
## 技术栈
- Wazuh 4.x:manager、indexer (OpenSearch) 和 dashboard 部署在 Ubuntu 22.04 上
- Suricata IDS,使用 Emerging Threats 规则集
- auditd 内核审计
- 使用 Groq API (`llama-3.3-70b-versatile`) 的 Python 3 自定义集成(AI 分诊)
- VirusTotal 信誉 API
- 模拟工具:Nmap、Hydra、EICAR 测试文件
## 仓库结构
```
.
├── README.md
├── screenshots/ # Evidence images used across detections
├── raw-notes/ # Wazuh.md, the original lab notes log
├── architecture/ # Topology, components, and data flow
├── wazuh/
│ ├── configuration/ # Manager and agent ossec.conf additions
│ ├── rules/ # local_rules.xml (custom rules)
│ └── lists/ # CDB lists (audit-keys)
├── endpoints/
│ └── linux/ # audit.rules for root command auditing
├── detections/ # One folder per detection, 01 to 06
├── investigations/ # Full case writeup with evidence
└── automation/
└── ai-agent/ # Custom AI triage integration
```
## 检测项
| # | 检测项 | 遥测数据 | 触发方式 |
|---|-----------|-----------|---------|
| 01 | [文件完整性监控](detections/01-file-integrity-monitoring/README.md) | syscheck | `touch /root/samplefile.txt` |
| 02 | [网络入侵(Nmap 扫描)](detections/02-network-intrusion-suricata/README.md) | Suricata `eve.json` | `nmap -sS` / `nmap -A` |
| 03 | [漏洞检测](detections/03-vulnerability-detection/README.md) | `vulnerability-detection` 模块 | 被动,基于清单驱动 |
| 04 | [恶意命令执行](detections/04-malicious-command-execution/README.md) | auditd | root `execve` (如 `netstat`) |
| 05 | [SSH 暴力破解 + 封禁](detections/05-ssh-bruteforce-active-response/README.md) | sshd syslog | `hydra -l root ... ssh://` |
| 06 | [恶意软件检测](detections/06-malware-detection-virustotal/README.md) | FIM 到 VirusTotal | `curl` EICAR 样本到 `/root` |
每个检测文件夹都遵循相同的模板:模拟攻击、遥测数据源、检测规则、MITRE ATT&CK 映射、证据截图和测试说明。
## 调查
[`investigations/malware-case/`](investigations/malware-case/) 是一个完整的案例:投放至 `/root` 的 EICAR 样本、FIM 告警、VirusTotal 判定结果以及 AI 分诊报告。它包含一个[时间线](investigations/malware-case/timeline.md)、一份[调查记录](investigations/malware-case/investigation.md)、一份[最终报告](investigations/malware-case/final-report.md)以及位于 `evidence/` 中的原始告警证据。
## 自动化
[`automation/ai-agent/`](automation/ai-agent/README.md) 包含了用于生成 AI 分诊报告的自定义 Wazuh 集成。它包括已部署的脚本、真实的示例报告、报告文件名格式文档以及部署说明。
## 安全提示
本仓库中的所有 API 密钥均已脱敏。在 `wazuh/configuration/manager-ossec-additions.conf` 和 `automation/ai-agent/` 中,真实的 VirusTotal 和 Groq 密钥已被替换为 `YOUR_API_KEY_HERE` 和 `YOUR_GROQ_API_KEY_HERE` 占位符。有关密钥处理策略,请参见 `.gitignore`。
## 设置与复现
本仓库记录的是一个已完成的实验室,而非安装指南,但包含了所有构建模块:
1. Manager 和 Agent 的 `ossec.conf` 追加配置:`wazuh/configuration/`
2. 自定义规则:`wazuh/rules/local_rules.xml`(合并至 Manager 的 `/var/ossec/etc/rules/` 中)
3. CDB 列表:`wazuh/lists/audit-keys`(放置在 `etc/lists/` 中并在 `` 中引用)
4. 审计规则:`endpoints/linux/audit.rules`(复制到 `/etc/audit/audit.rules` 并使用 `auditctl -R` 应用)
5. AI 分诊集成:请参见 `automation/ai-agent/README.md`
前置条件:一个单节点 Wazuh 堆栈(manager、indexer、dashboard)以及一个 Linux Agent。在部署之前,请将每个 `YOUR_*_KEY_HERE` 占位符替换为您自己的密钥。要复现某项检测,请运行该检测 README 中的触发命令,并在 Wazuh Discover 中确认告警。
标签:DNS 反向解析, Metaprompt, Sysdig, Wazuh, x64dbg, 安全实验环境, 安全运营, 库, 应急响应, 扫描框架, 插件系统, 自动化防御, 自定义DNS解析器