ibu-cyx0/CTI-Automation-Platform

GitHub: ibu-cyx0/CTI-Automation-Platform

一个自动化的网络威胁情报管道,用于从多个公开情报源收集 IOC 并与 Splunk 日志进行关联匹配,在实时仪表板上可视化展示活跃威胁。

Stars: 1 | Forks: 0

# 🛡️ CTI 自动化平台 ![Python](https://img.shields.io/badge/Python-3.10+-blue?logo=python&logoColor=white) ![Splunk](https://img.shields.io/badge/Splunk-SIEM-green?logo=splunk&logoColor=white) ![Threat Intel](https://img.shields.io/badge/Threat%20Intel-CTI-red) ![License](https://img.shields.io/badge/License-MIT-yellow) ![Status](https://img.shields.io/badge/Status-Active-brightgreen) ## 📌 概述 一个完全自动化的**网络威胁情报 (CTI) pipeline**,它可以: 1. 从 3 个实时威胁情报源**收集 IOC**(入侵指标) 2. 将它们与 Splunk 安全日志进行**关联**,以检测活跃威胁 3. 在实时暗色主题的威胁仪表板上将一切**可视化** 旨在展示企业蓝队环境下的 **SOC Tier 2** 和 **CTI Analyst** 级别的技能。 ## 🎯 功能 | 功能 | 描述 | |---|---| | 🔗 多源收集 | 同时从 OTX、AbuseIPDB、URLhaus 拉取 IOC | | 🔍 Splunk 关联 | 通过 REST API 将 IOC 与真实的 Splunk 日志事件进行匹配 | | 📊 实时仪表板 | 带有严重程度分类的实时威胁信息流 | | 🌐 威胁来源地图 | 可视化攻击者的地理分布 | | ⚡ 自动严重程度分级 | 将告警分类为 CRITICAL / HIGH / MEDIUM / LOW | | 🔄 演示模式 | 无需 API 密钥即可完全离线运行 | ## 🏗️ 架构 ``` ┌─────────────────────────────────────────────────────┐ │ CTI AUTOMATION PLATFORM │ ├──────────────┬──────────────┬───────────────────────┤ │ AlienVault │ AbuseIPDB │ URLhaus │ │ OTX │ Blacklist │ Malicious URLs │ └──────┬───────┴──────┬───────┴──────────┬────────────┘ │ │ │ └──────────────▼──────────────────┘ feeds/collector.py (IOC Aggregator + Deduplication) │ ▼ data/iocs.json ◄──── Stored IOCs │ ▼ correlator/splunk_correlator.py (Splunk REST API / Offline Correlation) │ ▼ data/correlation_hits.json │ ▼ dashboard/index.html (Live Threat Intelligence Dashboard) ``` ## 📁 项目结构 ``` cti-platform/ ├── feeds/ │ └── collector.py # IOC collection from 3 threat feeds ├── correlator/ │ └── splunk_correlator.py # Splunk REST API correlation engine ├── dashboard/ │ └── index.html # Live dark-themed threat dashboard ├── data/ │ ├── iocs.json # Collected IOCs (auto-generated) │ ├── correlation_hits.json # Alert matches (auto-generated) │ └── sample/ │ └── sample_logs.json # Sample log events for demo ├── main.py # Main orchestrator ├── requirements.txt # Python dependencies └── README.md ``` ## ⚙️ 设置与安装 ### 前置条件 - Python 3.10+ - Splunk Enterprise(可选 — 演示模式无需此项即可运行) ### 1. 克隆仓库 ``` git clone https://github.com/ibu-cyx0/cti-automation-platform cd cti-automation-platform ``` ### 2. 安装依赖项 ``` pip install -r requirements.txt ``` ### 3. 配置 API 密钥(实时模式可选) ``` export OTX_API_KEY="your_otx_key_here" export ABUSEIPDB_API_KEY="your_abuseipdb_key_here" # URLhaus 不需要 API key ``` ### 4. 运行 ``` # Demo 模式(不需要 API key) python main.py # Live 模式(包含 API key + Splunk) export SPLUNK_HOST="localhost" export SPLUNK_USER="admin" export SPLUNK_PASS="yourpassword" python main.py ``` ### 5. 打开仪表板 ``` Open dashboard/index.html in your browser ``` ## 🔐 使用的威胁情报源 | 情报源 | 类型 | 数据 | 是否需要 API | |---|---|---|---| | [AlienVault OTX](https://otx.alienvault.com) | 社区 | IP、域名、哈希、URL | ✅ 免费 | | [AbuseIPDB](https://www.abuseipdb.com) | 众包 | 带有置信度评分的恶意 IP | ✅ 免费 | | [URLhaus](https://urlhaus.abuse.ch) | 恶意软件 | 活跃的恶意软件分发 URL | ❌ 无需密钥 | ## 🔍 使用的示例 SPL 查询 ``` # 在 firewall logs 中检测 IOC match index=firewall (src_ip="185.220.101.47" OR dest_ip="185.220.101.47") | table _time, src_ip, dest_ip, action, host # 将所有 blocked IP 与 IOC list 进行关联 index=* action=blocked | lookup ioc_lookup ip AS src_ip OUTPUT threat_name, severity | where isnotnull(threat_name) | stats count BY src_ip, threat_name, severity # 检测到与已知 C2 domains 的出站连接 index=proxy_logs | rex field=url "(?P[^/]+)" | lookup ioc_lookup domain AS domain OUTPUT threat_name | where isnotnull(threat_name) | table _time, src_ip, url, threat_name ``` ## 📊 仪表板功能 - **实时 IOC 源表格** — 每秒流式传输新威胁 - **严重程度环形图** — CRITICAL / HIGH / MEDIUM / LOW 分布 - **来源柱状图** — 按威胁源统计 IOC 数量 - **威胁来源地图** — 攻击者地理分布 - **系统日志终端** — 实时事件记录 - **自动刷新** — 每 30 秒重复一次 ## 🛠️ 技术栈 - **Python** — 情报源收集、关联逻辑 - **Splunk REST API** — 日志关联 (`/services/search/jobs/export`) - **AlienVault OTX API** — 威胁 pulse + IOC 收集 - **AbuseIPDB API** — 恶意 IP 黑名单 - **URLhaus API** — 活跃恶意软件 URL 源 - **HTML/CSS/JS** — 实时威胁情报仪表板 - **Docker**(可选) — 容器化部署 ## 🗺️ 路线图 - [ ] 集成 MISP 用于威胁共享 - [ ] 自动邮件告警 (SMTP) - [ ] 支持 Elasticsearch - [ ] 支持 STIX/TAXII 情报源 - [ ] 基于 ML 的 IOC 优先级排序 ## 👤 作者 **Mohamed Ibrahim H** EC-Council 认证 SOC Analyst (CSA) | Splunk Core 认证用户 | Cisco Cyber Ops Associate - GitHub: [@ibu-cyx0](https://github.com/ibu-cyx0) - TryHackMe: [@IbrahimCyb3r4](https://tryhackme.com/p/IbrahimCyb3r4) - Email: ibrahim.cybrx@gmail.com ## 📄 许可证 MIT 许可证 — 可免费使用、修改和分发。
标签:Python, 多模态安全, 威胁情报, 安全运营, 开发者工具, 扫描框架, 数据可视化, 无后门, 请求拦截, 逆向工具