adityavatsaedu-rgb/Threat-Detection-SIEM-repository

GitHub: adityavatsaedu-rgb/Threat-Detection-SIEM-repository

面向 SOC 团队的生产级威胁检测与 SIEM 框架,基于 Sigma/YARA 规则与 MITRE ATT&CK 映射实现多源日志的标准化分析、检测与告警。

Stars: 0 | Forks: 0

# 🛡️ 威胁检测与 SIEM 框架

## 📋 目录 - [概述](#overview) - [架构](#architecture) - [检测覆盖范围](#detection-coverage) - [组件](#components) - [快速开始](#quick-start) - [检测规则](#detection-rules) - [日志解析器](#log-parsers) - [告警 Pipeline](#alerting-pipeline) - [MITRE ATT&CK 覆盖范围](#mitre-attck-coverage) - [部署](#deployment) - [贡献](#contributing) ## 🔍 概述 一款专为 SOC 团队设计的生产级、开源 **威胁检测与 SIEM 框架**。它提供: - 具备标准化 schema(兼容 ECS)的**多源日志接入** - 支持实时与批量评估的 **Sigma 规则引擎** - 集成到 pipeline 中的**基于 YARA 的文件/内存扫描** - 跨越 15+ 战术类别的 **MITRE ATT&CK 映射检测** - **可插拔告警**(Slack、PagerDuty、JIRA、电子邮件、Webhook) - 通过 MISP、OTX、VirusTotal 进行的**威胁情报富化** - 适用于 Kibana、Grafana 和 Splunk 的**仪表盘** ## 🏗️ 架构 ``` ┌──────────────────────────────────────────────────────────────────┐ │ LOG SOURCES │ │ Windows Events │ Linux Syslog │ AWS CloudTrail │ Firewall/IDS │ └────────────────────────────┬─────────────────────────────────────┘ │ ┌────────▼────────┐ │ Log Ingestion │ (Filebeat / Fluentd / API) │ & Parsing │ └────────┬────────┘ │ Normalized ECS Events ┌────────▼────────┐ │ Enrichment │ (GeoIP, TI Feeds, WHOIS) │ Engine │ └────────┬────────┘ │ ┌──────────────▼──────────────┐ │ Detection Engine │ │ ┌──────────┐ ┌──────────┐ │ │ │ Sigma │ │ YARA │ │ │ │ Rules │ │ Rules │ │ │ └──────────┘ └──────────┘ │ │ ┌──────────┐ ┌──────────┐ │ │ │ Snort/ │ │ Anomaly │ │ │ │ Suric. │ │ Baseline │ │ │ └──────────┘ └──────────┘ │ └──────────────┬──────────────┘ │ Alerts ┌────────▼────────┐ │ Alerting │ (Slack / PagerDuty / JIRA) │ Pipeline │ └────────┬────────┘ │ ┌────────▼────────┐ │ Dashboards │ (Kibana / Grafana / Splunk) └─────────────────┘ ``` ## 🎯 检测覆盖范围 | 类别 | 规则数 | MITRE 技术 | |---|---|---| | 凭证访问 | 18 | T1003, T1110, T1555, T1212 | | 横向移动 | 14 | T1021, T1076, T1091, T1534 | | 执行 | 22 | T1059, T1106, T1204, T1569 | | 持久化 | 16 | T1053, T1098, T1136, T1543 | | 防御规避 | 20 | T1070, T1112, T1218, T1562 | | 数据窃取 | 12 | T1041, T1048, T1052, T1567 | | 命令与控制 | 15 | T1071, T1095, T1105, T1571 | | 发现 | 10 | T1016, T1018, T1057, T1082 | | **总计** | **127** | **50+ 项技术** | ## 🧩 组件 ``` threat-detection-siem/ ├── detectors/ # Core detection engine │ ├── sigma_engine.py # Sigma rule evaluator │ ├── yara_scanner.py # YARA rule scanner │ ├── anomaly_detector.py # Statistical anomaly detection │ └── correlation_engine.py # Multi-event correlation ├── rules/ │ ├── sigma/ # Sigma detection rules (.yml) │ │ ├── windows/ │ │ ├── linux/ │ │ ├── cloud/ │ │ └── network/ │ ├── yara/ # YARA rules (.yar) │ └── snort/ # Snort/Suricata rules (.rules) ├── parsers/ │ ├── windows_event_parser.py │ ├── syslog_parser.py │ ├── cloudtrail_parser.py │ └── firewall_parser.py ├── enrichment/ │ ├── geoip_enricher.py │ ├── threat_intel.py # MISP, OTX, VT integration │ └── asset_context.py ├── alerting/ │ ├── alert_manager.py │ ├── slack_notifier.py │ ├── pagerduty_notifier.py │ └── jira_notifier.py ├── dashboards/ │ ├── kibana/ │ ├── grafana/ │ └── splunk/ ├── scripts/ │ ├── ingest_logs.py │ ├── tune_rules.py │ └── generate_report.py ├── tests/ ├── docs/ └── .github/workflows/ ``` ## 🚀 快速开始 ### 前置条件 ``` python >= 3.11 docker & docker-compose ``` ### 1. 克隆并安装 ``` git clone https://github.com/YOUR_USERNAME/threat-detection-siem.git cd threat-detection-siem python -m venv venv && source venv/bin/activate pip install -r requirements.txt ``` ### 2. 配置 ``` cp config/config.example.yaml config/config.yaml # 使用你的 SIEM endpoint、TI API keys 和 alert destinations 编辑 config.yaml ``` ### 3. 运行检测引擎 ``` # Real-time mode(tail 日志) python -m detectors.sigma_engine --mode realtime --source /var/log/ # Batch mode(分析日志归档) python -m detectors.sigma_engine --mode batch --input logs/archive.jsonl # 带 enrichment python -m detectors.sigma_engine --mode realtime --enrich geoip,threatintel ``` ### 4. Docker 栈 ``` docker-compose up -d # Kibana: http://localhost:5601 # Grafana: http://localhost:3000 ``` ## 📜 检测规则 规则遵循 **Sigma** 规范,并按平台和 MITRE 战术进行组织。 示例 — 暴力破解检测: ``` # rules/sigma/windows/credential_access/brute_force_rdp.yml title: RDP Brute Force Attack id: a3f1b2c4-... status: stable description: Detects multiple failed RDP authentication attempts from a single source references: - https://attack.mitre.org/techniques/T1110/ tags: - attack.credential_access - attack.t1110.001 logsource: product: windows service: security detection: selection: EventID: 4625 LogonType: 10 timeframe: 5m condition: selection | count(TargetUserName) by IpAddress > 10 falsepositives: - Legitimate admin automation level: high ``` 有关全部 127 条规则,请参见 [`rules/sigma/`](rules/sigma/)。 ## 🔎 日志解析器 所有解析器都标准化为 **Elastic Common Schema (ECS)** 以确保跨平台兼容性。 支持的来源: - Windows 安全/系统/应用程序事件日志 - Linux syslog、auditd、auth.log - AWS CloudTrail、GuardDuty、VPC Flow Logs - Azure AD 登录日志、活动日志 - Palo Alto、Cisco ASA、Fortinet 防火墙日志 - Zeek/Bro 网络日志 ## 🔔 告警 Pipeline 告警根据严重程度和规则标签进行路由: | 严重程度 | SLA | 目标地址 | |---|---|---| | 严重 | 立即 | PagerDuty + Slack + JIRA | | 高 | < 15 分钟 | Slack + JIRA | | 中 | < 1 小时 | Slack | | 低 | 每日摘要 | 电子邮件 | ## 🗺️ MITRE ATT&CK 覆盖范围 ![MITRE ATT&CK Navigator](https://raw.githubusercontent.com/adityavatsaedu-rgb/Threat-Detection-SIEM-repository/main/docs/images/attack_navigator.png) Navigator 层文件:[`docs/attack_navigator_layer.json`](docs/attack_navigator_layer.json) ## 🚢 部署 ### 生产环境 ``` docker-compose -f docker-compose.prod.yml up -d ``` ### Kubernetes ``` kubectl apply -f k8s/ ``` ### Standalone ``` python scripts/ingest_logs.py --config config/config.yaml ``` ## 📄 许可证 MIT License © 2026 Aditya Vatsa — 为防御者社区而构建。

© 2026 Aditya Vatsa • 为现代防御者而构建

标签:AMSI绕过, ECS标准化, Metaprompt, Sigma规则, YARA, 云资产可视化, 威胁检测, 子域名突变, 安全运营中心, 目标导入, 网络映射, 请求拦截, 越狱测试, 逆向工具