sauravkumar-secOps/threat-intel-pipeline

GitHub: sauravkumar-secOps/threat-intel-pipeline

开源威胁情报聚合管道,将多源 OSINT 订阅、IOC 检查、VirusTotal 富化以及向 Rapid7 和 SentinelOne 平台推送整合为统一的自动化工作流。

Stars: 0 | Forks: 0

# 威胁情报 Pipeline 开源威胁情报源聚合器,具备 IOC 检查、多源情报富化以及针对 Rapid7 InsightIDR、SentinelOne 和 VirusTotal 的平台推送能力。 ## 功能 - **7 个 OSINT 情报源**,来自 abuse.ch、BinaryDefense 和 Emerging Threats - **基于累积主列表的即时 IOC 查询** (`check`) - **多源情报富化**,结合情报源数据与 VirusTotal (`enrich --vt`) - **统一的置信度评分**(HIGH / MEDIUM / LOW / CLEAN / UNKNOWN) - **平台推送**,支持推送到 R7 自定义威胁列表和 S1 黑名单(默认 dry-run) - **S1 Deep Visibility 批量关联**,适用于 IP 和域名 - **定时 Pipeline**,支持渐进式摄取、剔除跟踪和 Slack 通知 - **推送操作后的覆盖范围验证** ## 安装 ``` # 来自 GitHub pip install git+https://github.com/sauravkumar-secOps/threat-intel-pipeline.git@main # 本地开发 git clone https://github.com/sauravkumar-secOps/threat-intel-pipeline.git cd threat-intel-pipeline pip install -e . ``` ## 使用说明 ### CLI ``` # 列出已配置的 feeds threat-intel feeds # 获取并解析所有 feeds threat-intel fetch threat-intel parse # 对照 master list 检查 IOCs (亚秒级) threat-intel check 1.2.3.4 evil.com abc123... threat-intel check --file iocs.txt # Enrich IOCs (master list + 可选的 VirusTotal) threat-intel enrich 1.2.3.4 sha256hash... --vt threat-intel enrich --file iocs.txt --vt --output report.md # 完整 pipeline:获取 + 解析 + 关联 + 导出 threat-intel run # 计划的 headless 运行 (用于 CI/CD) threat-intel scheduled --state-file .cache/last_run.json --output-dir reports/ --force --notify ``` 你也可以使用 `python -m threat_intel_pipeline `。 ### 库 ``` from threat_intel_pipeline.ioc_checker import check_iocs from threat_intel_pipeline.enrichment import enrich_iocs # 对照 master feed list 进行即时检查 results = check_iocs(["1.2.3.4", "evil.com"]) for r in results: print(f"{r.value}: {r.status}") # ACTIVE_THREAT / PREVIOUSLY_SEEN / NOT_FOUND # 使用 VirusTotal 进行完整 enrichment enriched = enrich_iocs(["sha256hash..."], use_vt=True) for e in enriched: print(f"{e.value}: {e.confidence} — {e.assessment}") ``` ## 已配置的情报源 | 情报源 | IOC 类型 | 来源 | 置信度 | |------|----------|--------|------------| | Feodo Tracker C2 IPs | IP | abuse.ch | High | | Binary Defense Ban List | IP | binarydefense.com | High | | Emerging Threats Compromised IPs | IP | emergingthreats.net | High | | URLhaus Recent | Domain/URL | abuse.ch | High | | ThreatFox Recent | Mixed | abuse.ch | Medium | | MalwareBazaar SHA256 | Hash | abuse.ch | High | | MalwareBazaar SHA1 | Hash | abuse.ch | High | ## 环境变量 | 变量 | 适用场景 | 描述 | |----------|-------------|-------------| | `VT_API_KEY` | `enrich --vt` | VirusTotal API 密钥(免费版:4 次请求/分钟) | | `RAPID7_API_KEY` | `push-r7` | Rapid7 InsightIDR API 密钥 | | `RAPID7_IDR_BASE` | `push-r7` | R7 API 基础 URL(默认:`https://us2.api.insight.rapid7.com`) | | `SENTINELONE_API_TOKEN` | `push-s1`, `correlate-s1` | SentinelOne API token | | `SENTINELONE_BASE_URL` | `push-s1`, `correlate-s1` | S1 控制台 URL | | `SLACK_WEBHOOK_URL` | `scheduled --notify` | Slack 入站 webhook URL | ## 置信度评分 `enrich` 命令结合了来自主情报源列表和 VirusTotal 的信号: | 信号 | 分数 | |--------|-------| | 在 OSINT 情报源中活跃 | +3 | | 曾出现过(已从情报源中剔除) | +1 | | VT 10+ 次检测 | +4 | | VT 3-9 次检测 | +2 | | VT 1-2 次检测 | +1 | **阈值标准:** >= 5 = HIGH,>= 3 = MEDIUM,>= 1 = LOW,0 且 VT 判定为安全 = CLEAN,其他情况为 UNKNOWN。 ## 许可证 MIT
标签:IOC检测, Python, 威胁情报, 开发者工具, 文档结构分析, 无后门, 逆向工具