TerminalsandCoffee/detection-engineering-lab
GitHub: TerminalsandCoffee/detection-engineering-lab
基于 Wazuh SIEM 的威胁检测工程实验室,集成了规则开发、MITRE ATT&CK 映射、基础设施即代码和理论文档,用于系统学习和实践现代检测工程方法。
Stars: 1 | Forks: 0
# 威胁检测实验室
一个使用 Wazuh SIEM 构建、部署和验证威胁检测规则的实践实验室 —— 包含通过 Terraform 部署的攻击/防御基础设施以及 MITRE ATT&CK 映射。
## 概述
本代码库是一个完整的检测工程实验室环境。它包括 TOML 格式的检测规则、通过 Terraform 在 AWS 上部署的 Wazuh SIEM(含 Windows 目标机和 Kali 攻击机),以及用于验证、报告和 CI/CD 的 Python 工具。
你将获得:
- 映射到 MITRE ATT&CK 战术和技术的**检测规则**
- 通过 Terraform 在 AWS 上部署的**实验室基础设施**(Wazuh Manager + Windows Server + Kali Linux)
- 用于验证、MITRE 映射检查和指标生成的**开发工具**
- 涵盖检测工程工作流和安全框架的**理论文档**
现代检测程序还强调:
- **检测即代码 (Detection-as-code)** 实践(版本控制、CI 验证、同行评审)
- **模式标准化 (Schema normalization)**(ECS、OCSF 或同等标准)以保持规则的可移植性
- **威胁模拟覆盖 (Threat emulation coverage)**(Atomic Red Team、CALDERA)以验证逻辑
- **遥测质量 (Telemetry quality)**(字段完整性、日志记录策略和数据漂移监控)
## 仓库结构
```
├── detections/ # TOML-formatted detection rules
├── development/ # Python scripts for validation and conversion
├── metrics/ # Generated metrics, reports, and visualizations
├── setup/ # Lab infrastructure (Terraform for Wazuh, Windows, Kali)
├── theory/ # Documentation on detection engineering concepts
└── .github/workflows/ # GitHub Actions workflows (currently disabled)
```
## 检测格式
每个检测规则都存储为具有以下结构的 TOML 文件:
```
[metadata]
creation_date = "YYYY/MM/DD"
[rule]
author = ["Author Name"]
description = "Detection description"
name = "Detection Name"
risk_score = 50
severity = "medium"
type = "query"
rule_id = "unique-uuid"
query = "your detection query here"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
```
## 理论与文档
在 `theory/` 目录中探索检测工程概念:
- **[安全运营](theory/security-operations.md)**:SecOps 功能概述
- **[检测工程工作流](theory/detection-engineering-workflow.md)**:工作流文档
- **[框架](theory/frameworks.md)**:安全框架(MITRE ATT&CK、Cyber Kill Chain、F3EAD)
### 检测要求
- 有效的 TOML 语法
- 所有必填字段均已填写
- 有效的 MITRE ATT&CK 技术/战术映射
- 适用时包含子技术
- 唯一的 `rule_id`(UUID 格式)
- 描述性的 `name` 和 `description`
- 适当的 `risk_score` 和 `severity`
- 记录在案的数据源和假设(规则依赖哪些日志/字段)
## 许可证
MIT 许可证 - 详情请参阅 [LICENSE](LICENSE) 文件。
## 资源
- [MITRE ATT&CK 框架](https://attack.mitre.org/)
- [Wazuh 文档](https://documentation.wazuh.com/)
- [检测工程最佳实践](https://github.com/DetectionEngineering)
## 概述
本代码库是一个完整的检测工程实验室环境。它包括 TOML 格式的检测规则、通过 Terraform 在 AWS 上部署的 Wazuh SIEM(含 Windows 目标机和 Kali 攻击机),以及用于验证、报告和 CI/CD 的 Python 工具。
你将获得:
- 映射到 MITRE ATT&CK 战术和技术的**检测规则**
- 通过 Terraform 在 AWS 上部署的**实验室基础设施**(Wazuh Manager + Windows Server + Kali Linux)
- 用于验证、MITRE 映射检查和指标生成的**开发工具**
- 涵盖检测工程工作流和安全框架的**理论文档**
现代检测程序还强调:
- **检测即代码 (Detection-as-code)** 实践(版本控制、CI 验证、同行评审)
- **模式标准化 (Schema normalization)**(ECS、OCSF 或同等标准)以保持规则的可移植性
- **威胁模拟覆盖 (Threat emulation coverage)**(Atomic Red Team、CALDERA)以验证逻辑
- **遥测质量 (Telemetry quality)**(字段完整性、日志记录策略和数据漂移监控)
## 仓库结构
```
├── detections/ # TOML-formatted detection rules
├── development/ # Python scripts for validation and conversion
├── metrics/ # Generated metrics, reports, and visualizations
├── setup/ # Lab infrastructure (Terraform for Wazuh, Windows, Kali)
├── theory/ # Documentation on detection engineering concepts
└── .github/workflows/ # GitHub Actions workflows (currently disabled)
```
## 检测格式
每个检测规则都存储为具有以下结构的 TOML 文件:
```
[metadata]
creation_date = "YYYY/MM/DD"
[rule]
author = ["Author Name"]
description = "Detection description"
name = "Detection Name"
risk_score = 50
severity = "medium"
type = "query"
rule_id = "unique-uuid"
query = "your detection query here"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
```
## 理论与文档
在 `theory/` 目录中探索检测工程概念:
- **[安全运营](theory/security-operations.md)**:SecOps 功能概述
- **[检测工程工作流](theory/detection-engineering-workflow.md)**:工作流文档
- **[框架](theory/frameworks.md)**:安全框架(MITRE ATT&CK、Cyber Kill Chain、F3EAD)
### 检测要求
- 有效的 TOML 语法
- 所有必填字段均已填写
- 有效的 MITRE ATT&CK 技术/战术映射
- 适用时包含子技术
- 唯一的 `rule_id`(UUID 格式)
- 描述性的 `name` 和 `description`
- 适当的 `risk_score` 和 `severity`
- 记录在案的数据源和假设(规则依赖哪些日志/字段)
## 许可证
MIT 许可证 - 详情请参阅 [LICENSE](LICENSE) 文件。
## 资源
- [MITRE ATT&CK 框架](https://attack.mitre.org/)
- [Wazuh 文档](https://documentation.wazuh.com/)
- [检测工程最佳实践](https://github.com/DetectionEngineering)标签:AMSI绕过, AWS, Cloudflare, DevSecOps, DPI, ECS, ECS, GitHub Actions, HTTP/HTTPS抓包, MITRE ATT&CK, Python, Python安全, Terraform, Terraform, TOML, Wazuh, Windows Server, 上游代理, 代码化检测, 原子红队, 威胁检测, 安全合规, 安全实验室, 安全运营, 实验室环境, 态势感知, 扫描框架, 攻击模拟, 数据规范化, 无后门, 漏洞利用检测, 红队仿真, 网络代理, 网络安全, 自动笔记, 规则映射, 逆向工具, 防御工程, 隐私保护, 驱动签名利用