sagarsahdesign-a11y/detection-engineering-lab

GitHub: sagarsahdesign-a11y/detection-engineering-lab

一个面向蓝队和检测工程师的实战型安全作品集实验室,通过受控攻击模拟与 SIEM 告警验证展示从威胁建模到检测规则开发的全流程检测工程能力。

Stars: 0 | Forks: 0

# 检测工程实验室 一个实战型网络安全作品集,通过受控的攻击模拟、自定义规则开发、MITRE ATT&CK 映射以及检测差距分析,展示**检测工程**技能。 专为准备申请实习和入门级安全岗位的 SOC 分析师、检测工程师和蓝队专业人员打造。 ## 概述 该实验室利用 [Atomic Red Team](https://github.com/redcanaryco/atomic-red-team) 在 Windows 10 端点上模拟真实世界的对手行为,在 [Wazuh SIEM](https://wazuh.com/) 中验证告警,并记录从假设到规则调优的完整检测生命周期。 | 组件 | 角色 | |-----------|------| | **Wazuh Manager + Dashboard** | 中央 SIEM、规则引擎、告警关联 | | **Windows 10 受害者** | Wazuh agent、Sysmon、PowerShell 日志记录 | | **Atomic Red Team** | 可重复的、映射 ATT&CK 的攻击模拟 | | **Sigma 规则** | 与供应商无关的检测逻辑 | | **自定义 Wazuh 规则** | 特定环境的调优和丰富 | | **Kali Linux(可选)** | 用于横向移动测试的远程攻击源 | ## 实验室架构 ``` flowchart TB subgraph Attacker["Attacker Zone (Optional)"] KALI["Kali Linux"] end subgraph Victim["Victim Zone"] WIN["Windows 10 Endpoint"] AGENT["Wazuh Agent"] SYSMON["Sysmon"] PSLOG["PowerShell Logging"] WIN --> AGENT WIN --> SYSMON WIN --> PSLOG end subgraph SIEM["Detection Zone"] MGR["Wazuh Manager"] RULES["Custom Rules + Sigma"] DASH["Wazuh Dashboard"] MGR --> RULES MGR --> DASH end subgraph Frameworks["Reference Frameworks"] ATTACK["MITRE ATT&CK"] ART["Atomic Red Team"] SIGMA["Sigma"] end KALI -->|"T1021, T1105, T1018"| WIN ART -->|"Invoke-AtomicTest"| WIN AGENT -->|"Security / Sysmon / PowerShell logs"| MGR RULES -->|"Alerts"| DASH ATTACK -.->|"Technique mapping"| RULES SIGMA -.->|"Rule translation"| RULES ``` 完整架构详情:[`docs/architecture.md`](docs/architecture.md) ## MITRE ATT&CK 覆盖范围 | 技术 ID | 名称 | 检测状态 | |--------------|------|------------------| | [T1110](docs/attack-simulations/T1110-brute-force.md) | 暴力破解 | ✅ 已检测 | | [T1059.001](docs/attack-simulations/T1059-powershell.md) | PowerShell | ✅ 已检测 | | [T1547.001](docs/attack-simulations/T1547-persistence.md) | 启动或登录自启动执行 | ✅ 已检测 | | [T1003.001](docs/attack-simulations/T1003-credential-dumping.md) | 操作系统凭据转储 (LSASS) | ✅ 已检测 | | [T1021.001](docs/attack-simulations/T1021-remote-services.md) | 远程桌面协议 | ✅ 已检测 | | [T1078.003](docs/attack-simulations/T1078-valid-accounts.md) | 有效账户(本地) | ⚠️ 部分覆盖 | | [T1105](docs/attack-simulations/T1105-ingress-tool-transfer.md) | 入口工具传输 | ✅ 已检测 | | [T1082](docs/attack-simulations/T1082-system-information-discovery.md) | 系统信息发现 | ⚠️ 部分覆盖 | | [T1018](docs/attack-simulations/T1018-remote-system-discovery.md) | 远程系统发现 | ✅ 已检测 | | [T1047](docs/attack-simulations/T1047-wmi.md) | Windows 管理规范 | ✅ 已检测 | | [T1055.001](docs/attack-simulations/T1055-process-injection.md) | 进程注入 (DLL) | ⚠️ 部分覆盖 | | [T1136.001](docs/attack-simulations/T1136-create-account.md) | 创建账户(本地) | ✅ 已检测 | 完整矩阵:[`docs/mitre-attack-mapping.md`](docs/mitre-attack-mapping.md) ## 仓库结构 ``` detection-engineering-lab/ ├── README.md # Project overview (this file) ├── setup-lab.ps1 # Windows endpoint setup automation script ├── sysmon-config.xml # Tailored Sysmon configuration XML ├── playbooks/ │ └── triage-playbook.md # SOC Incident Response Playbook ├── docs/ │ ├── architecture.md # Lab topology and data flow │ ├── mitre-attack-mapping.md # ATT&CK coverage matrix │ ├── portfolio-guide.md # How to present this project │ ├── attack-simulations/ # Per-technique documentation (12) │ └── templates/ # Reusable documentation templates ├── screenshots/ │ └── checklist.md # Required evidence screenshots ├── custom-rules/ │ ├── local_rules.xml # Upgraded Wazuh detection rules │ └── README.md # Rule deployment guide ├── sigma-rules/ # 12 Sigma rules (YAML) ├── atomic-red-team-tests/ │ └── test-mapping.md # ART test ID reference ├── reports/ │ └── detection-gap-analysis.md # Coverage gaps and recommendations └── assets/ └── .gitkeep ``` ## 攻击模拟 所有模拟均通过 Atomic Red Team 在安装了 Wazuh agent 的 Windows 10 受害者机器上执行。 ``` # 运行单个 Atomic 测试 Invoke-AtomicTest T1003.001 -TestNumbers 1 ``` | # | 技术 | Atomic 测试 | 文档 | |---|-----------|-------------|---------------| | 1 | T1110 暴力破解 | T1110.003 | [查看](docs/attack-simulations/T1110-brute-force.md) | | 2 | T1059.001 PowerShell | T1059.001 | [查看](docs/attack-simulations/T1059-powershell.md) | | 3 | T1547.001 持久化 | T1547.001 | [查看](docs/attack-simulations/T1547-persistence.md) | | 4 | T1003.001 凭据转储 | T1003.001 | [查看](docs/attack-simulations/T1003-credential-dumping.md) | | 5 | T1021.001 远程服务 | T1021.001 | [查看](docs/attack-simulations/T1021-remote-services.md) | | 6 | T1078.003 有效账户 | T1078.003 | [查看](docs/attack-simulations/T1078-valid-accounts.md) | | 7 | T1105 入口工具传输 | T1105 | [查看](docs/attack-simulations/T1105-ingress-tool-transfer.md) | | 8 | T1082 系统信息发现 | T1082 | [查看](docs/attack-simulations/T1082-system-information-discovery.md) | | 9 | T1018 远程系统发现 | T1018 | [查看](docs/attack-simulations/T1018-remote-system-discovery.md) | | 10 | T1047 WMI | T1047 | [查看](docs/attack-simulations/T1047-wmi.md) | | 11 | T1055.001 进程注入 | T1055.001 | [查看](docs/attack-simulations/T1055-process-injection.md) | | 12 | T1136.001 创建账户 | T1136.001 | [查看](docs/attack-simulations/T1136-create-account.md) | ART 测试参考:[`atomic-red-team-tests/test-mapping.md`](atomic-red-team-tests/test-mapping.md) ## 检测规则 ### Sigma 规则 位于 [`sigma-rules/`](sigma-rules/) 中的与供应商无关的检测逻辑。兼容通过 [Sigma CLI](https://github.com/SigmaHQ/sigma) 转换为 Wazuh、Splunk、Elastic 和其他 SIEM。 ### 自定义 Wazuh 规则 位于 [`custom-rules/local_rules.xml`](custom-rules/local_rules.xml) 中的环境调优规则。部署至: ``` /var/ossec/etc/rules/local_rules.xml ``` 安装步骤请参阅 [`custom-rules/README.md`](custom-rules/README.md)。 ## 主要发现 摘自 [`reports/detection-gap-analysis.md`](reports/detection-gap-analysis.md): - **12 项技术中有 9 项**通过默认和自定义规则实现了可靠检测 - **3 项技术**(T1078、T1082、T1055)需要额外的遥测或调优 - 主要差距:没有脚本块日志记录的 PowerShell、良性的发现噪音、没有 Sysmon Event ID 8 的注入 - 建议改进:启用 Script Block Logging、使用 SwiftOnSecurity 配置部署 Sysmon、添加 Windows Audit Policy 基线 ## 自动化实验室设置与遥测配置 为了简化所需审计策略、日志工具和主机遥测的部署,提供了一个自动化脚本。 请在提权的 PowerShell 会话中运行安装脚本: ``` Set-ExecutionPolicy Bypass -Scope Process -Force .\setup-lab.ps1 ``` 此脚本自动化执行以下操作: 1. **管理员权限验证** 2. **高级安全审计**:配置命令行审计(Process Creation Event ID 4688)、登录成功/失败以及用户/安全组管理。 3. **PowerShell 日志配置**:在注册表中启用模块日志记录(Event ID 4103)和脚本块日志记录(Event ID 4104)。 4. **Sysmon 部署**:使用自定义的 [`sysmon-config.xml`](sysmon-config.xml) 配置模板,自动下载、解压并安装 Microsoft Sysmon。 5. **Wazuh Agent 健康检查**:如果禁用,则验证并启动 Wazuh Agent 服务。 ## SOC 事件响应手册 为了弥合检测工程和安全运营之间的差距,为 SOC 分析师提供了分诊和事件响应程序: * [`playbooks/triage-playbook.md`](playbooks/triage-playbook.md) — 针对 LSASS 凭据转储、进程注入和暴力破解攻击的逐步遏制、分诊和调查工作流。 ## 实验室前置条件 | 要求 | 版本 / 说明 | |-------------|-----------------| | Wazuh Manager | 4.x | | Wazuh Agent | 安装在 Windows 10 受害者机器上 | | Sysmon | 可选,但建议使用(进程注入、LSASS) | | PowerShell | 5.1+,启用模块日志记录 | | Atomic Red Team | [安装指南](https://github.com/redcanaryco/invoke-atomicredteam) | | Windows Audit Policy | 登录失败、账户管理、进程创建 | ## 展示的技能 - MITRE ATT&CK 技术映射和威胁建模 - Atomic Red Team 攻击模拟和验证 - Sigma 规则编写和 SIEM 转换 - Wazuh 自定义规则开发 (XML) - Windows 事件日志分析(安全、Sysmon、PowerShell) - 检测差距分析和补救规划 - 安全文档和作品集展示 ## 截图 用于作品集和面试的证据清单:[`screenshots/checklist.md`](screenshots/checklist.md) 请使用清单中定义的命名规则将捕获的图像放置在 `screenshots/` 中。 ### 实验室证据 ![Wazuh 告警概述](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/a53b5cc51f122420.png) ![T1003 LSASS 检测](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/372b5c3d05122425.png) ![ATT&CK Navigator 层级](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/881d9d6519122430.png) ## 文档模板 用于扩展实验室的可重用模板: - [`docs/templates/attack-simulation-template.md`](docs/templates/attack-simulation-template.md) - [`docs/templates/detection-rule-template.md`](docs/templates/detection-rule-template.md) - [`docs/templates/incident-report-template.md`](docs/templates/incident-report-template.md) ## 作品集展示 用于简历、LinkedIn 和面试的指南:[`docs/portfolio-guide.md`](docs/portfolio-guide.md) ## 免责声明 所有攻击模拟均在作者拥有的**独立实验室环境**中进行。此处记录的技术仅供**防御性安全研究和教育使用**。请勿对您不拥有或未获得明确测试授权的系统执行 Atomic Red Team 测试。 ## 作者 检测工程实验室 — 作品集项目 *专为 SOC / 检测工程 / 蓝队职位准备* ## 许可证 本项目提供用于教育和作品集目的。Atomic Red Team 测试受 [Red Canary 的许可证](https://github.com/redcanaryco/atomic-red-team/blob/master/LICENSE.txt) 约束。Sigma 规则遵循 [Detection Rule License (DRL) 1.1](https://github.com/SigmaHQ/sigma/blob/master/LICENSE.Detection.Rules.md)。
标签:AI合规, Libemu, PE 加载器, Wazuh, 安全运营, 扫描框架, 攻击模拟, 网络信息收集, 网络安全, 隐私保护, 驱动签名利用