ExelR8ight/ATT-CK-Detection-Library

GitHub: ExelR8ight/ATT-CK-Detection-Library

一个将 Sigma 检测规则映射到 MITRE ATT&CK 框架、经 Atomic Red Team 验证并转换为 Splunk SPL 和 Elastic DSL 的版本控制安全检测规则库。

Stars: 0 | Forks: 0

ATT&CK Detection Library Banner

🛡️ ATT&CK 映射检测库

一个版本控制的 Sigma 检测规则库,映射到 MITRE ATT&CK,通过 Atomic Red Team 进行验证,并转换为 Splunk SPL 和 Elastic Query DSL。

Rules Techniques Tactics Validated License

## 📋 概述 本仓库包含一个精选的、版本控制的 **Sigma 检测规则**库,映射到 [MITRE ATT&CK 框架](https://attack.mitre.org/)。每条规则: - 🎯 映射到特定的 **ATT&CK Technique** 和 **Tactic** - ✅ 已通过执行相应的 [Atomic Red Team](https://github.com/redcanaryco/atomic-red-team) 测试进行了**验证** - 🔄 已**转换**为可直接用于生产环境的 **Splunk SPL** 和 **Elastic Query DSL** 格式 - 📊 包含用于复现的**覆盖矩阵** ## 🗺️ 覆盖矩阵 | # | Sigma 规则 | ATT&CK Technique | Tactic | 严重程度 | 已验证 | |---|-----------|-------------------|--------|----------|-----------| | 1 | `reconnaissance_port_scan.yml` | T1046 — Network Service Scanning | Discovery | 🔴 高 | ✅ | | 2 | `suspicious_powershell.yml` | T1059.001 — PowerShell | Execution | 🔴 高 | ✅ | | 3 | `encoded_powershell.yml` | T1059.001 — Encoded Command | Execution | 🔴 高 | ✅ | | 4 | `brute_force.yml` | T1110.001 — Password Guessing | Credential Access | 🔴 高 | ✅ | | 5 | `credential_dumping.yml` | T1003 — OS Credential Dumping | Credential Access | 🟠 严重 | ✅ | | 6 | `data_exfiltration.yml` | T1048 — Exfiltration Over Alt. Protocol | Exfiltration | 🟠 严重 | ✅ | | 7 | `defense_evasion.yml` | T1055 — Process Injection | Defense Evasion | 🟠 严重 | ✅ | | 8 | `lolbin_execution.yml` | T1218 — System Binary Proxy Execution | Defense Evasion | 🔴 高 | ✅ | | 9 | `malware_execution.yml` | T1059 — Command & Scripting Interpreter | Execution | 🟠 严重 | ✅ | | 10 | `lateral_movement.yml` | T1021 — Remote Services | Lateral Movement | 🔴 高 | ✅ | | 11 | `insider_threat.yml` | T1078 — Valid Accounts | Persistence | 🔴 高 | ✅ | | 12 | `phishing-document.yml` | T1566.001 — Spearphishing Attachment | Initial Access | 🟠 严重 | ✅ | | 13 | `ddos_network_flood.yml` | T1498 — Network Denial of Service | Impact | 🔴 高 | ✅ | ## 📁 仓库结构 ``` ATT-CK-Detection-Library/ ├── README.md ├── LICENSE ├── sigma-rules/ # 📝 Original Sigma YAML rules │ ├── execution/ │ │ ├── suspicious_powershell.yml │ │ ├── encoded_powershell.yml │ │ └── malware_execution.yml │ ├── credential-access/ │ │ ├── brute_force.yml │ │ └── credential_dumping.yml │ ├── defense-evasion/ │ │ ├── defense_evasion.yml │ │ └── lolbin_execution.yml │ ├── discovery/ │ │ └── reconnaissance_port_scan.yml │ ├── exfiltration/ │ │ └── data_exfiltration.yml │ ├── lateral-movement/ │ │ └── lateral_movement.yml │ ├── persistence/ │ │ └── insider_threat.yml │ ├── initial-access/ │ │ └── phishing_document.yml │ └── impact/ │ └── ddos_network_flood.yml ├── splunk-spl/ # 🔍 Translated Splunk SPL queries │ └── *.spl ├── elastic-queries/ # 🔍 Translated Elastic Query DSL │ └── *.json ├── validation/ # ✅ Atomic Red Team test results │ ├── test-results/ │ └── run_validations.ps1 ├── coverage-matrix/ # 📊 ATT&CK Navigator layer │ └── coverage.json └── assets/ # 🎨 Images and diagrams └── banner.png ``` ## 🚀 快速开始 ### 1. 克隆仓库 ``` git clone https://github.com/ExelR8ight/ATT-CK-Detection-Library.git cd ATT-CK-Detection-Library ``` ### 2. 将规则部署到 Splunk ``` # 从 splunk-spl/ 复制 SPL 查询并创建 Saved Search # 示例:检测编码的 PowerShell 执行 index=main sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" | where like(CommandLine, "%-encodedCommand%") OR like(CommandLine, "%-enc %") | stats count by host, Image, CommandLine, _time | where count > 3 ``` ### 3. 使用 Atomic Red Team 进行验证 ``` # 安装 Atomic Red Team IEX (IWR 'https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/install-atomicredteam.ps1' -UseBasicParsing) # 执行测试(例如,T1059.001 - PowerShell) Invoke-AtomicTest T1059.001 ``` ## 🔧 规则的构建方式 ``` ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ │ MITRE ATT&CK │───▶│ Sigma YAML Rule │───▶│ Atomic Red Team │ │ Technique ID │ │ (Detection │ │ Validation │ │ + Tactic │ │ Logic) │ │ (Fire & Confirm)│ └──────────────────┘ └──────────────────┘ └──────────────────┘ │ ┌───────────┼───────────┐ ▼ ▼ ┌──────────────┐ ┌──────────────┐ │ Splunk SPL │ │ Elastic DSL │ │ Translation │ │ Translation │ └──────────────┘ └──────────────┘ ``` 每个检测都遵循以下生命周期: 1. **识别**要检测的 ATT&CK technique 2. **编写**具有明确检测逻辑的 Sigma YAML 规则 3. **转换**为 Splunk SPL 和 Elastic Query DSL 4. 通过在实验室中执行 Atomic Red Team 测试进行**验证** 5. 将结果**记录**在覆盖矩阵中 ## 📄 Sigma 规则格式 每条规则都遵循一致的 YAML schema: ``` title: Encoded PowerShell Execution id: sigma-exec-002 status: active description: > Detects Base64-encoded PowerShell commands commonly used for defense evasion and payload delivery. severity: high confidence: high mitre_attack: - technique: T1059.001 tactic: Execution name: "Command and Scripting Interpreter: PowerShell" detection: condition: any features: encoded_command_count: gte: 1 powershell_count: gte: 5 incident_type: Suspicious PowerShell Activity reason_template: > Encoded PowerShell execution detected: {encoded_command_count} encoded commands, {powershell_count} total PowerShell executions. ``` ## 🔧 误报调优 真正的检测工程不仅是编写规则,还包括对它们进行调优以减少噪音。以下是本库中应用的一些误报调优示例: | 规则 | 误报场景 | 应用的调优 | |------|------------------------|----------------| | `suspicious_powershell.yml` | 合法的管理脚本(SCCM、GPO)触发了规则 | 添加了对匹配 `svchost.exe` 和 `gpscript.exe` 的 `ParentImage` 的排除 | | `reconnaissance_port_scan.yml` | 漏洞扫描器(Nessus、Qualys)触发了规则 | 为授权的扫描器 IP 添加了 `src_ip` 白名单 | | `credential_dumping.yml` | Windows Defender (`MsMpEng.exe`) 合法访问 LSASS | 为已知的 AV 进程添加了 `SourceImage` 排除 | | `lolbin_execution.yml` | 系统管理员使用 `certutil` 安装证书 | 添加了要求网络活动的条件(`-urlcache` 标志) | ## 🗺️ ATT&CK Navigator 覆盖 `coverage-matrix/coverage.json` 文件可以直接导入到 [MITRE ATT&CK Navigator](https://mitre-attack.github.io/attack-navigator/) 中,以可视化展示此检测库覆盖了哪些 technique。 **要查看热力图:** 1. 打开 [ATT&CK Navigator](https://mitre-attack.github.io/attack-navigator/) 2. 点击 **Open Existing Layer** → **Upload from local** 3. 选择 `coverage-matrix/coverage.json` 4. 绿色单元格 = 存在已验证的检测 此覆盖范围跨越了 **6 个 tactic**:Execution、Credential Access、Defense Evasion、Discovery、Exfiltration 和 Lateral Movement。 ## 📜 许可证 本项目基于 MIT 许可证授权 — 详见 [LICENSE](LICENSE)。 ## 👤 作者 **Ankit Singh** 📧 ankisinsen152@gmail.com 🔗 [LinkedIn](https://linkedin.com/in/ankit-singh-1b0632265) · [GitHub](https://github.com/ExelR8ight)
标签:AI合规, Atomic Red Team, Cloudflare, Elastic DSL, Homebrew安装, Libemu, MITRE ATT&CK, OpenCanary, Sigma规则, Splunk SPL, URL发现, 安全检测, 插件系统, 数据泄露检测, 检测即代码, 目标导入