Rootless-Ghost/SigmaForge

GitHub: Rootless-Ghost/SigmaForge

一款基于Web和CLI的Sigma检测规则生成与转换工具,支持生成、验证规则并导出为Splunk、Elastic、Sentinel等主流SIEM查询语言。

Stars: 1 | Forks: 0

# 🔷 SigmaForge ### 厂商无关的 Sigma 规则生成器 [![Python](https://img.shields.io/badge/Python-3.8+-3776AB?style=flat-square&logo=python&logoColor=white)](https://python.org) [![Flask](https://img.shields.io/badge/Flask-3.x-000000?style=flat-square&logo=flask&logoColor=white)](https://flask.palletsprojects.com) [![License](https://img.shields.io/badge/License-MIT-green?style=flat-square)](LICENSE) [![Sigma](https://img.shields.io/badge/Sigma-Detection--as--Code-06b6d4?style=flat-square)](https://sigmahq.io) 一款用于生成、验证 Sigma 规则并将其转换为多种 SIEM 查询语言的检测工程工具。构建带有 MITRE ATT&CK 映射的厂商无关检测规则,并可转换为 **Splunk SPL**、**Elastic KQL**、**Elastic EQL** 以及 **Microsoft Sentinel KQL**。 [功能特性](#features) · [截图](#screenshots) · [快速开始](#quick-start) · [CLI 使用](#cli-usage) · [Web UI](#web-ui) · [模板](#pre-built-templates)
## 概述 SigmaForge 通过提供 **深色主题 Web 界面** 和 **CLI 工具** 来简化检测规则的编写流程,用于创建 Sigma 规则 —— 这是厂商无关 SIEM 检测的行业标准。一次编写,即可转换为任何 SIEM 平台。 它是 **检测工程工具包** 的一部分,该工具包还包括 [YaraForge](https://github.com/Rootless-Ghost/YaraForge) (YARA 规则) 和 [SnortForge](https://github.com/Rootless-Ghost/SnortForge) (Snort IDS 规则)。 ## 截图 ### 规则构建器 *通过可视化方式构建带有 MITRE ATT&CK 映射和检测逻辑的 Sigma 规则* ![Rule Builder](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/5d0ba4dccd100100.png) ### 生成的输出 *YAML 输出,包含 Splunk SPL、Elastic KQL、EQL 和 Sentinel KQL 转换结果* ![Generated Output](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/8b60d26ac7100113.png) ### 模板 *12 个涵盖常见攻击技术的预置检测模板* ![Templates](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/30b90761b7100124.png) ### 验证器 *粘贴任意 Sigma YAML 以进行语法检查和 SIEM 转换* ![Validator](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/703391e955100134.png) ### 规则库 *保存、加载、导出和管理生成的规则* ![Rule Library](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/4f58df94da100146.png) ## 功能特性 - **Sigma 规则生成器** — 具备检测逻辑、字段修饰符和布尔条件的可视化规则构建器 - **SIEM 转换** — 将规则转换为 Splunk SPL、Elastic/Lucene KQL、Elastic EQL 和 Microsoft Sentinel KQL - **MITRE ATT&CK 映射** — 使用技术 ID 和战术自动标记规则(120+ 项技术) - **规则验证器** — 依据 Sigma 规范进行语法检查 - **预置模板** — 12 个针对常见威胁的现成检测模板 - **规则库** — 保存、加载、导出和管理生成的规则 - **CLI 界面** — 通过命令行生成、验证和转换规则 - **13 种日志来源** — 进程创建、Windows 安全、Sysmon、PowerShell、DNS、防火墙、代理、注册表、网络连接、文件事件和 Linux ## 快速开始 ``` # 克隆 repository git clone https://github.com/Rootless-Ghost/SigmaForge.git cd SigmaForge # 创建 virtual environment python -m venv venv source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows # 安装 dependencies pip install -r requirements.txt # 运行 Web Interface python app.py # 打开 http://localhost:5000 ``` ## CLI 使用 ``` # 列出可用 templates python cli.py templates # 从 template 生成 python cli.py template suspicious_powershell python cli.py template mimikatz_execution --output mimikatz.yml # 生成自定义 rule python cli.py generate \ --title "Suspicious CMD Execution" \ --logsource process_creation \ --level high \ --field "Image|endswith=\\cmd.exe" \ --field "ParentImage|endswith=\\excel.exe,\\winword.exe" \ --mitre T1059.003 \ --output suspicious_cmd.yml # 验证 rule python cli.py validate my_rule.yml # 转换为特定 SIEM python cli.py convert my_rule.yml --backend splunk python cli.py convert my_rule.yml --backend elastic python cli.py convert my_rule.yml --backend eql python cli.py convert my_rule.yml --backend sentinel # 列出可用 log sources python cli.py logsources ``` ## Web UI 基于 Flask 的 Web 界面提供四个主要部分: - **规则构建器** — 可视化表单,包含元数据、MITRE ATT&CK 选择器、检测逻辑构建器,以及带有 SIEM 转换选项卡(Splunk SPL、Elastic KQL、Elastic EQL、Sentinel KQL)的实时输出 - **模板** — 浏览并加载 12 个涵盖常见攻击技术的预置检测模板 - **验证器** — 粘贴任意 Sigma YAML 并根据规范进行验证,然后转换为 SIEM 查询 - **规则库** — 保存生成的规则、重新加载、导出为 JSON 包 ## 预置模板 | 模板 | 级别 | MITRE ATT&CK | 描述 | |----------|-------|---------------|-------------| | Suspicious PowerShell | High | T1059.001 | 编码命令、下载陷阱、AMSI 绕过 | | Mimikatz Execution | Critical | T1003.001 | 通过 Mimikatz 进行凭据转储 | | Scheduled Task Persistence | Medium | T1053.005 | 可疑的计划任务创建 | | Brute Force Detection | Medium | T1110 | 多次登录失败尝试 | | Event Log Clearing | High | T1070.001 | Windows 事件日志被清除 | | Suspicious DNS Query | Medium | T1071.004 | 对已知恶意 TLD 的查询 | | LOLBin Execution | Medium | T1218 | Certutil、mshta、rundll32、regsvr32 滥用 | | Port Scan Detection | Medium | T1046 | 大量被拒绝的防火墙连接 | | Suspicious User Agent | Medium | T1071.001 | 代理中已知的工具/恶意软件 User Agent | | Registry Persistence | Medium | T1547.001 | Run 键修改 | | Non-Standard Port Connection | Low | T1095 | 到可疑端口的外连连接 | | Linux Reverse Shell | Critical | T1059.004 | Bash、netcat、Python 反向 Shell 模式 | ## 支持的日志来源 | Key | 描述 | 产品 | |-----|-------------|---------| | `process_creation` | 进程创建 (Sysmon EID 1 / Security 4688) | Windows | | `windows_security` | Windows 安全事件日志 | Windows | | `sysmon` | Sysmon 操作日志 | Windows | | `powershell` | PowerShell 脚本块/模块日志 | Windows | | `powershell_classic` | Windows PowerShell (经典) | Windows | | `dns_query` | DNS 查询事件 (Sysmon EID 22) | Windows | | `network_connection` | 网络连接 (Sysmon EID 3) | Windows | | `file_event` | 文件创建/修改 (Sysmon EID 11) | Windows | | `registry_event` | 注册表值设置 (Sysmon EID 13) | Windows | | `firewall` | 防火墙日志 (厂商无关) | Any | | `proxy` | Web 代理 / HTTP 日志 | Any | | `linux_process` | Linux 进程创建 (auditd) | Linux | | `linux_auth` | Linux 认证日志 | Linux | ## 项目结构 ``` SigmaForge/ ├── app.py # Flask web application ├── cli.py # CLI interface ├── requirements.txt # Python dependencies ├── src/ │ ├── __init__.py │ └── sigma_engine.py # Core engine (generator, validator, converter) ├── templates/ │ └── index.html # Web UI template ├── static/ │ ├── css/style.css # Dark theme stylesheet │ └── js/app.js # Frontend JavaScript ├── rules/ # Saved rule library ├── SECURITY.md ├── LICENSE └── README.md ``` ## API 端点 | 端点 | 方法 | 描述 | |----------|--------|-------------| | `/api/generate` | POST | 根据表单数据生成规则 | | `/api/template/` | GET | 加载预置模板 | | `/api/validate` | POST | 验证 Sigma YAML | | `/api/convert` | POST | 转换为 SIEM 查询 | | `/api/library/save` | POST | 保存规则到库 | | `/api/library/list` | GET | 列出已保存的规则 | | `/api/library/load/` | GET | 从库中加载规则 | | `/api/library/delete/` | DELETE | 删除已保存的规则 | | `/api/library/export` | GET | 将所有规则导出为 JSON | | `/api/log-sources` | GET | 列出可用的日志来源 | | `/api/mitre` | GET | MITRE ATT&CK 技术映射 | | `/api/templates` | GET | 列出可用的模板 | ## 相关工具 | 工具 | 用途 | 链接 | |------|---------|------| | **YaraForge** | 用于恶意软件/文件检测的 YARA 规则生成 | [GitHub](https://github.com/Rootless-Ghost/YaraForge) | | **SnortForge** | 用于网络检测的 Snort IDS/IPS 规则生成 | [GitHub](https://github.com/Rootless-Ghost/SnortForge) | | **SigmaForge** | 用于 SIEM 检测的 Sigma 规则生成 | 本仓库 | | **SIREN** | NIST 800-61 事件响应报告生成器 | [GitHub](https://github.com/Rootless-Ghost/SIREN) | ## 许可证 本项目基于 MIT 许可证授权 —— 详见 [LICENSE](LICENSE)。
由 [Rootless-Ghost](https://github.com/Rootless-Ghost) 构建
标签:AMSI绕过, Cloudflare, Detection-as-Code, Elastic EQL, Elastic KQL, Flask, FTP漏洞扫描, KQL, Microsoft Sentinel, MITRE ATT&CK, Python, Sigma 规则, Splunk SPL, TCP SYN 扫描, Web UI, YAML, 代码转换, 域名分析, 威胁检测, 安全库, 安全编排, 无后门, 网络安全, 规则生成器, 逆向工具, 隐私保护