develku/Detection-Engineering-Lab

GitHub: develku/Detection-Engineering-Lab

一套面向 Splunk 及多平台 SIEM 的检测规则与调优工程库,包含 13 条映射 MITRE ATT&CK 的规则、Sigma 转换文件及显著的误报缩减实践报告。

Stars: 0 | Forks: 0

# 检测工程实验室 三条高频检测规则开箱即用的真阳性率平均为 6.5%。分析师每天需要调查约 236 条误报。经过系统性调优:误报减少了 73-87%,真阳性无一遗漏,且分析师对这三条规则的分类时间从每天约 20 小时缩短至不到 3 小时。 本仓库包含 13 条 Splunk SPL 检测规则,映射到 MITRE ATT&CK 的 5 个战术阶段;提供适用于任何 SIEM 的厂商中立 Sigma 等效规则;包含 5 个运营仪表盘;以及记录了完整调优前后指标的调优报告。 为 [SIEM-Detection-Lab](https://github.com/develku/SIEM-Detection-Lab) Splunk 环境构建。针对 [Attack-Simulation-Lab](https://github.com/develku/Attack-Simulation-Lab) 的 adversary 模拟进行了验证。 ## 这展示了什么 - **误报减少 87%** — LSASS 访问规则从每天 47 条警报调优至 6 条,TP 率从 8.5% 提升至 66.7% - **零检测盲区** — 每条调优后的规则均针对 Atomic Red Team 测试和手动规避尝试重新进行了验证 - **每天节省约 17 小时分析师时间** — 涵盖三条规则,通过用高置信度警报替代噪音实现 - **13 项检测规则,适配任何 SIEM** — Splunk 的 SPL,适用于 Elasticsearch、Sentinel 或任何 sigma-cli 支持平台的 Sigma YAML ## 警报调优结果 编写检测规则只是完成了前 50% 的工作 — 对其进行调优以适应真实环境则是另外 50%。未调优的规则会产生分析师渐渐忽略的噪音,而这正是真实攻击被遗漏的原因。 | 规则 | 警报/天 | TP 率 | FP 减少 | 报告 | |---|---|---|---|---| | LSASS 访问 | 47 → 6 | 8.5% → 66.7% | -87% | [报告](tuning/lsass-access-tuning.md) | | 暴力破解 | 120 → 32 | 7.5% → 28.1% | -73% | [报告](tuning/brute-force-tuning.md) | | 服务创建 | 85 → 12 | 3.5% → 25.0% | -86% | [报告](tuning/service-creation-tuning.md) | 每份调优报告涵盖了完整过程:7 天警报分析、误报源分类、带有每项排除理由的调优后 SPL 查询、攻击模拟重新测试,以及用于验证排除项无法被绕过的规避测试。 方法论:[调优方法论](docs/tuning-methodology.md) ## MITRE ATT&CK 覆盖范围 跨 5 个战术阶段的 13 条规则: | 战术 | 技术 | 规则 | 严重性 | 日志源 | |---|---|---|---|---| | **凭证访问** | T1003.001 | [LSASS Memory Dump](detections/credential-access/lsass-memory-dump.spl) | 严重 | Sysmon 10 | | | T1003.001 | [comsvcs DLL Dump](detections/credential-access/comsvcs-dll-dump.spl) | 严重 | Sysmon 1 | | | T1003.006 | [DCSync Detection](detections/credential-access/dcsync-detection.spl) | 严重 | Security 4662 | | | T1003.003 | [NTDS Shadow Copy](detections/credential-access/ntds-shadow-copy.spl) | 高 | Sysmon 1 | | **横向移动** | T1570 | [PsExec Execution](detections/lateral-movement/psexec-execution.spl) | 高 | Sysmon 1 + Security 4624 | | | T1021.001 | [RDP Lateral Movement](detections/lateral-movement/rdp-lateral-movement.spl) | 中 | Security 4624 | | | T1047 | [WMI Remote Execution](detections/lateral-movement/wmi-remote-execution.spl) | 高 | Sysmon 1 | | **持久化** | T1543.003 | [New Service Created](detections/persistence/new-service-created.spl) | 中 | System 7045 | | | T1547.001 | [Registry Run Key](detections/persistence/registry-run-key.spl) | 中 | Sysmon 13 | | **权限提升** | T1078.002 | [Admin Group Modification](detections/privilege-escalation/admin-group-modification.spl) | 高 | Security 4728/4732/4756 | | | T1053.005 | [Scheduled Task Created](detections/privilege-escalation/scheduled-task-created.spl) | 中 | Sysmon 1 | | **防御规避** | T1070.001 | [Event Log Cleared](detections/defense-evasion/event-log-cleared.spl) | 严重 | Security 1102 / System 104 | | | T1055 | [Process Injection](detections/defense-evasion/process-injection.spl) | 高 | Sysmon 8 | 每个 SPL 文件都包含内联的 `# LEARNING:` 注释,解释了每个查询组件——它的作用、重要性,以及攻击者如何利用被检测到的技术。 完整规则文档:[检测规则指南](docs/detection-rules.md) ## Sigma 规则 每条 SPL 检测规则都有一个 YAML 格式的匹配 [Sigma](https://sigmahq.io/) 规则。Sigma 是检测规则的厂商中立标准——编写一次,即可转换为任何 SIEM: ``` # 转换为 Splunk SPL sigma convert -t splunk sigma/credential-access/lsass-memory-dump.yml # 转换为 Elasticsearch sigma convert -t elasticsearch sigma/credential-access/lsass-memory-dump.yml # 转换为 Microsoft Sentinel (KQL) sigma convert -t microsoft365defender sigma/credential-access/lsass-memory-dump.yml ``` | Sigma 规则 | 对应的 SPL | |---|---| | [`sigma/credential-access/`](sigma/credential-access/) | [`detections/credential-access/`](detections/credential-access/) | | [`sigma/lateral-movement/`](sigma/lateral-movement/) | [`detections/lateral-movement/`](detections/lateral-movement/) | | [`sigma/persistence/`](sigma/persistence/) | [`detections/persistence/`](detections/persistence/) | | [`sigma/privilege-escalation/`](sigma/privilege-escalation/) | [`detections/privilege-escalation/`](detections/privilege-escalation/) | | [`sigma/defense-evasion/`](sigma/defense-evasion/) | [`detections/defense-evasion/`](detections/defense-evasion/) | ## 仪表盘 适用于 Splunk (XML) 的 5 个运营仪表盘: | 仪表盘 | 用途 | |---|---| | [Authentication Overview](dashboards/authentication-overview.xml) | 登录模式、失败身份验证、暴力破解指标 | | [Endpoint Process Activity](dashboards/endpoint-process-activity.xml) | 可疑进程执行、父子关系 | | [Network Connections](dashboards/network-connections.xml) | 横向移动指标、异常连接 | | [Persistence Mechanisms](dashboards/persistence-mechanisms.xml) | 注册表修改、新服务、计划任务 | | [Alert Summary](dashboards/alert-summary.xml) | 跨所有检测规则的聚合警报视图 | ## 前置条件 - **Splunk**(或通过 Sigma 转换支持的任何 SIEM) - 终端上的 **Sysmon**,并启用 Event ID 1(进程创建)、8 (CreateRemoteThread)、10 (ProcessAccess) 和 13 (RegistryEvent) - 转发至 Splunk 的 **Windows Security 日志** — Event ID 1102, 4624, 4625, 4662, 4728, 4732, 4756 - 转发至 Splunk 的 **Windows System 日志** — Event ID 104, 7045 - **[sigma-cli](https://github.com/SigmaHQ/sigma-cli)**(可选,用于将 Sigma 规则转换为非 Splunk 的 SIEM) [SIEM-Detection-Lab](https://github.com/develku/SIEM-Detection-Lab) 涵盖了完整的 Splunk 部署和日志收集设置。 ## 项目结构 ``` Detection-Engineering-Lab/ ├── detections/ SPL detection queries by ATT&CK tactic │ ├── credential-access/ (4 rules) │ ├── lateral-movement/ (3 rules) │ ├── persistence/ (2 rules) │ ├── privilege-escalation/(2 rules) │ └── defense-evasion/ (2 rules) ├── sigma/ Sigma YAML equivalents (same structure) ├── dashboards/ Splunk XML dashboards (5) ├── tuning/ Tuning reports with quantified results └── docs/ Detection and tuning methodology ``` ## 相关项目 本仓库是多项目 SOC 环境的一部分: | 项目 | 用途 | |---|---| | [AD-Lab-Setup](https://github.com/develku/AD-Lab-Setup) | Windows Active Directory 基础设施 | | [SIEM-Detection-Lab](https://github.com/develku/SIEM-Detection-Lab) | Splunk SIEM 部署和日志收集 | | **Detection-Engineering-Lab** (本仓库) | 检测规则、仪表盘和调优 | | [Attack-Simulation-Lab](https://github.com/develku/Attack-Simulation-Lab) | Adversary 仿真和攻击验证 |
标签:AMSI绕过, Atomic Red Team, Cloudflare, Elasticsearch, LSASS访问, MITRE ATT&CK, PoC, Sentinel, Sigma规则, SPL, YAML, 仪表盘, 告警调优, 威胁检测, 安全库, 安全运营, 扫描框架, 攻防模拟, 数据泄露检测, 暴力破解, 服务创建, 目标导入, 网络安全, 误报消除, 隐私保护, 高置信度