sudo-amirops/YARA-SIGMA-Rules-Collection

GitHub: sudo-amirops/YARA-SIGMA-Rules-Collection

从12个开源仓库精心筛选、去重并验证的17,548条YARA与Sigma安全检测规则集合,附带完整的来源归属与许可证标注。

Stars: 1 | Forks: 0

# 检测规则 — YARA + Sigma 一套经过精心筛选、去重和验证的 **17,548 条开源检测规则** —— 包含 **13,505 条 YARA** 和 **4,043 条 Sigma** —— 汇集自 12 个公开代码仓库,并已通过当前工具验证。 收集于 **2026-07-30**。每条规则均按其上游原文逐字复制,并带有注明来源、作者和许可证的出处标头。 ## 概览 | | 数量 | 备注 | |:---|---:|:---| | YARA 规则 | 13,505 | 使用 libyara 4.5.4 验证编译 | | Sigma 规则 | 4,043 | 使用 pySigma 验证规范 | | **总计** | **17,548** | 遍布 17,534 个文件 | | 来源代码仓库 | 12 | 所有来源均在下方列出 | | 带有 MITRE ATT&CK 标签的规则 | 4,027 | Sigma `tags:` 字段 | | 不同许可证 | 8 | **请阅读许可证部分** | ## 许可证声明 这些规则**并未**使用同一种许可证。根据以下条款,它们仍归原作者所有。本集合未对其进行重新许可。 | 许可证 | 规则数 | 对您的要求 | |:---|---:|:---| | `DRL-1.1` | 9,687 | 分享时保留作者/引用元数据。 | | `GPL-2.0` | 2,993 | Copyleft。再分发需要提供源代码和声明。 | | `Elastic-2.0` | 2,663 | 源代码可见。允许复制/修改/分发。**不允许**:作为托管或托管服务提供给第三方。必须保留声明。 | | `MIT` | 1,382 | 宽松型。保留版权和许可证声明。 | | `CC0-1.0` | 294 | 公共领域 dedication。无任何条件。 | | `BSD-3-Clause` | 239 | 宽松型。保留声明;未经许可不得背书。 | | `BSD-2-Clause` | 147 | 宽松型。保留声明。 | | `Apache-2.0` | 143 | 宽松型。保留声明;说明更改。 | 其中两个许可证带有实际义务: - **Elastic-2.0(2,663 条规则,**全部来自 `elastic/protections-artifacts`**)** —— 源代码可见。您可以复制、修改和分发,但**不得**将其作为托管服务或受管服务提供给第三方,并且必须保留许可声明。如果您运营多租户检测服务,请首先查阅此协议。 - **GPL-2.0(2,993 条规则,**全部来自 `Yara-Rules/rules`**)** —— 再分发时需承担 copyleft 义务。 每个规则文件都其标头中注明了各自的许可证,因此您提取的任何子集仍是自描述的。要构建仅包含宽松许可的子集,请仅保留标头显示为 `MIT`、`BSD-2-Clause`、`BSD-3-Clause`、`Apache-2.0`、`CC0-1.0` 或 `DRL-1.1` 的文件。 ## 布局 ``` yara/ index.yar <- master index; compiles the whole tree in one go malware_families/ 5,572 generic_capabilities/ 1,768 packers/ 1,729 hacktools/ 1,245 apt/ 985 webshells/ 604 ransomware/ 596 cve_exploits/ 307 crypto/ 272 credential_theft/ 137 maldocs/ 116 exploit_kits/ 74 anti_analysis/ 59 persistence/ 30 mobile/ 11 sigma/ process_creation/ 1,722 security/ 300 registry_event/ 288 file_event/ 279 ps_script/ 179 image_load/ 124 application/ 110 webserver/ 86 system/ 77 network_connection/ 66 cloudtrail/ 57 proxy/ 56 auditd/ 54 auditlogs/ 44 audit/ 41 activitylogs/ 35 ps_module/ 34 process_access/ 30 dns_query/ 28 okta/ 23 pipe_created/ 20 riskdetection/ 19 signinlogs/ 19 windefend/ 19 linux/ 17 dns/ 16 gcp_audit/ 16 create_remote_thread/ 15 aaa/ 13 firewall_as/ 13 threat_management/ 13 ps_classic_start/ 11 appxdeployment_server/ 10 codeintegrity_operational/ 10 driver_load/ 10 ... 79 further categories (189 rules) ``` Sigma 目录映射了 Sigma 自身的 `logsource` 分类体系(`category`,若无则为 `service`,再无则为 `product`)。YARA 目录则源自上游分类体系、命名约定和规则元数据。 ## 使用 YARA 规则 YARA 本质上是可移植的 —— 无需转换。任何接受自定义 YARA 的扫描程序或 EDR 都可以直接加载这些规则。 ``` # 将整个集合编译为一个 bundle yarac yara/index.yar rules.bin yara -C rules.bin /path/to/scan # 或使用单个 category yara -r yara/ransomware/ /path/to/scan ``` 否则,有两个问题会困扰您: **1. 外部变量。** 某些规则需要扫描程序提供具体的值。如果没有这些值,这些规则将无法编译: ``` yara -d filename="sample.exe" -d filepath="/tmp" -d extension="exe" \ -d filetype="EXE" -d owner="root" yara/index.yar sample.exe ``` **2. 辅助规则依赖。** 有 100 条规则引用了在其他文件中定义的私有辅助规则(例如 `is__elf`)。请通过 `yara/index.yar` 进行编译,该文件已按照安全的依赖顺序包含了所有文件。这些依赖在其标头中均有说明。其余规则均可独立编译。 ## 使用 Sigma 规则 Sigma 是一种**通用签名格式,而不是查询语言**。在使用前,必须将规则转换为您的目标平台语法: ``` pip install sigma-cli pysigma-backend-splunk # or -elasticsearch, -opensearch, # -sentinel, -qradar, ... sigma convert -t splunk -p sysmon sigma/process_creation/ ``` **仅有后端是不够的。** Sigma 字段名称是抽象的(`Image`、`CommandLine`)。您的数据会根据采集器(shipper)的不同而使用不同的名称 —— `winlog.event_data.Image`(winlogbeat)、`process.executable`(ECS)等等。您还必须应用一个**处理流水线**(`pysigma-pipeline-sysmon`、`-ecs_windows`、`splunk_windows` 等),以将 Sigma 的分类体系映射到您的 schema 上。 只有当您收集了匹配的遥测数据时,规则才会触发 —— 这里的 1,722 条规则属于 `process_creation`,这需要启用 Sysmon Event ID 1 或开启了命令行审核的 Windows 4688(默认关闭)。 有 14 个文件各包含两份文档 —— 一个基础规则加上一个通过 `name` 引用它的关联规则。请保持这些文件完整;拆分它们会破坏关联性。 ## 来源与归属 每条规则均源自以下项目之一。所有荣誉均归其作者和维护者所有;请在上游支持他们。 | 项目 | 规则数 | 许可证 | |:---|---:|:---| | [Neo23x0/signature-base](https://github.com/Neo23x0/signature-base) | 5,938 | DRL-1.1 | | [SigmaHQ/sigma](https://github.com/SigmaHQ/sigma) | 3,749 | DRL-1.1 | | [Yara-Rules/rules](https://github.com/Yara-Rules/rules) | 2,993 | GPL-2.0 | | [elastic/protections-artifacts](https://github.com/elastic/protections-artifacts) | 2,663 | Elastic-2.0 | | [reversinglabs/reversinglabs-yara-rules](https://github.com/reversinglabs/reversinglabs-yara-rules) | 1,240 | MIT | | [mdecrevoisier/SIGMA-detection-rules](https://github.com/mdecrevoisier/SIGMA-detection-rules) | 294 | CC0-1.0 | | [JPCERTCC/jpcert-yara](https://github.com/JPCERTCC/jpcert-yara) | 239 | BSD-3-Clause | | [advanced-threat-research/Yara-Rules](https://github.com/advanced-threat-research/Yara-Rules) | 142 | Apache-2.0 | | [bartblaze/Yara-rules](https://github.com/bartblaze/Yara-rules) | 142 | MIT | | [volexity/threat-intel](https://github.com/volexity/threat-intel) | 131 | BSD-2-Clause | | [mandiant/red_team_tool_countermeasures](https://github.com/mandiant/red_team_tool_countermeasures) | 16 | BSD-2-Clause | | [chronicle/GCTI](https://github.com/chronicle/GCTI) | 1 | Apache-2.0 | 每个规则文件都带有各自的出处标头: ``` /* * --------------------------------------------------------------- * source repo : Neo23x0/signature-base * source url : https://github.com/Neo23x0/signature-base * source path : yara/apt_apt29_grizzly_steppe.yar * commit : 43b2b2faafda * license : DRL-1.1 -- Detection Rule License 1.1 * collected : 2026-07-30 * rule author : Florian Roth * --------------------------------------------------------------- */ ``` 标头下方的规则主体 —— 包括所有作者、引用、哈希和日期元数据 —— 均**与上游逐字节相同**。唯一的添加内容是标头本身,以及针对 45 条 YARA 规则添加的 `import` 语句(上游文件遗漏了该语句,若缺少它规则将无法编译)。这 45 条规则在其标头中已作说明。
标签:AMSI绕过, YARA, 云资产可视化, 威胁检测, 安全, 安全运营, 扫描框架, 自定义DNS解析器, 超时处理, 逆向工具