orucova801-cmyk/siem-detection-rules
GitHub: orucova801-cmyk/siem-detection-rules
面向 Splunk 等 SIEM 平台的 OWASP Top 10 检测规则集中管理仓库,通过 Git 版本控制与 REST API 实现规则的自动化部署与更新。
Stars: 0 | Forks: 0
# SIEM 检测规则
该仓库是针对 SIEM 平台(Splunk、QRadar)的检测规则的**集中化来源**。所有规则都在此处编写、版本控制,并通过 REST API 自动部署到各 SIEM 中。
## 架构 / 工作流程
```
┌─────────────┐ git push ┌─────────────┐ REST API ┌─────────────┐
│ GitHub │ ───────────────► │ Deploy VM │ ───────────────► │ SIEM │
│ (mənbə) │ ◄─────────────── │ (skript) │ │ (Splunk) │
└─────────────┘ git pull └─────────────┘ └─────────────┘
```
**原则:** 永远不要直接在 SIEM 本身编辑规则。所有更改都遵循以下顺序:
1. 在此仓库中编写/编辑规则(`.json` 文件)
2. 提交并推送到 GitHub
3. 通过 `git pull` 拉取到 SIEM 服务器
4. `deploy_*.py` 脚本通过 REST API 将规则发送给 SIEM(创建新规则或更新现有规则)
## 仓库结构
```
siem-detection-rules/
├── README.md
└── splunk/
├── deploy_splunk.py # Splunk-a göndərmə/yeniləmə skripti
└── rules/
├── owasp-a01-idor-detection.json
├── owasp-a01-privilege-escalation-detection.json
├── owasp-a02-cleartext-credentials-detection.json
├── owasp-a03-sqli-detection.json
├── owasp-a03-xss-detection.json
├── owasp-a03-command-injection-detection.json
├── owasp-a04-business-logic-abuse-detection.json
├── owasp-a05-sensitive-file-access-detection.json
├── owasp-a06-vulnerable-component-scan-detection.json
├── owasp-a07-brute-force-login-detection.json
├── owasp-a07-credential-stuffing-detection.json
├── owasp-a08-webshell-upload-detection.json
├── owasp-a09-audit-log-tampering-detection.json
├── owasp-a10-ssrf-detection.json
└── network-port-scan-detection.json
```
## Splunk 检测规则 (15)
所有规则涵盖了 OWASP Top 10 (2021) 分类,标记了 MITRE ATT&CK 标签,并考虑了真实 SOC 环境中的误报场景。
| # | 规则名称 | OWASP 分类 | MITRE ATT&CK | 严重性 |
|---|---|---|---|---|
| 1 | OWASP_A03_SQLi_Detection | A03 - Injection | T1190 | 4 |
| 2 | OWASP_A03_XSS_Detection | A03 - Injection | T1059.007 | 4 |
| 3 | OWASP_A03_Command_Injection_Detection | A03 - Injection | T1059 | 5 |
| 4 | OWASP_A01_IDOR_Enumeration_Detection | A01 - Broken Access Control | T1190 | 4 |
| 5 | OWASP_A01_Privilege_Escalation_Detection | A01 - Broken Access Control | T1078, T1098 | 5 |
| 6 | OWASP_A02_Cleartext_Credentials_In_Logs | A02 - Cryptographic Failures | T1552.001 | 4 |
| 7 | OWASP_A04_Excessive_Password_Reset_Requests | A04 - Insecure Design | T1110 | 3 |
| 8 | OWASP_A05_Sensitive_File_Exposure_Attempt | A05 - Security Misconfiguration | T1592 | 5 |
| 9 | OWASP_A06_Vulnerability_Scanner_Detection | A06 - Vulnerable Components | T1595.002 | 4 |
| 10 | OWASP_A07_Brute_Force_Login_Detection | A07 - Authentication Failures | T1110.001 | 4 |
| 11 | OWASP_A07_Credential_Stuffing_Detection | A07 - Authentication Failures | T1110.004 | 5 |
| 12 | OWASP_A08_Webshell_Upload_Detection | A08 - Data Integrity Failures | T1505.003 | 5 |
| 13 | OWASP_A09_Audit_Log_Tampering_Detection | A09 - Logging & Monitoring Failures | T1070.001 | 5 |
| 14 | OWASP_A10_SSRF_Detection | A10 - SSRF | T1190, T1078.004 | 5 |
| 15 | NET_Port_Scan_Reconnaissance_Detection | Network Recon (Pre-Attack) | T1595.001 | 3 |
## 规则文件格式
每个规则都是具有类似 Sigma 结构的 `.json` 文件:
```
{
"name": "Rule_Adi",
"description": "Rule-un nə aşkar etdiyinin izahı",
"search": "Splunk SPL sorğusu",
"severity": 1-5,
"alert_type": "number of events",
"alert_comparator": "greater than",
"alert_threshold": 0,
"earliest_time": "-15m",
"latest_time": "now",
"cron_schedule": "*/5 * * * *",
"mitre_attack": ["T-kodları"],
"owasp_category": "OWASP Top 10 kateqoriyası",
"false_positives": "Bilinən false-positive ssenariləri"
}
```
## 使用说明
```
# 拉取 Repo
git clone https://github.com/orucova801-cmyk/siem-detection-rules.git
cd siem-detection-rules/splunk
# 将 Splunk credential 设置为 environment variable
export SPLUNK_USER="istifadeci_adin"
export SPLUNK_PASS="sifren"
# 将所有 rule 发送到 Splunk(新的会被创建,已存在的会被更新)
python3 deploy_splunk.py ./rules
```
对于每个规则,脚本会自动:
- 如果在 Splunk 中不存在 → **创建** (HTTP 201)
- 如果已存在 → **更新** (HTTP 409 → update)
## 作者
Aytac — 信息安全,MilliSec
标签:Homebrew安装, 安全运营, 扫描框架, 检测规则, 特权提升, 网络安全研究, 网络资产发现, 自动化部署, 逆向工具