Fennek115/separatio
GitHub: Fennek115/separatio
基于 Miniflux RSS 聚合和本地 Ollama 大模型的自动化威胁情报分析管道,从海量安全资讯中自动提取关键威胁信息并生成每日简报。
Stars: 0 | Forks: 0
# 威胁情报 Pipeline
使用 Miniflux + Ollama (qwen3.5) 的自动化安全威胁分析 Pipeline。
## 安装
```
pip install -r requirements.txt
```
在 Ollama 中安装模型:
```
ollama pull qwen3.5:4b # Stage 2 — resúmenes por artículo (~3.2 GB RAM)
ollama pull qwen3.5:9b # Stage 3 — informe consolidado (~7.2 GB RAM)
```
## 配置
编辑 `config.py`:
```
OLLAMA_HOST = "http://:11434"
MINIFLUX_URL = "http://localhost:8080"
MINIFLUX_USERNAME = "threat_user"
MINIFLUX_PASSWORD = "tu_password"
# 推荐的替代方案 (Miniflux UI 中的 Settings → API Keys):
# MINIFLUX_API_TOKEN = "tu-api-token"
```
在 Miniflux 中创建用户(UI → Settings → Users)并导入 `threat-analysis-feeds.opml`。
验证环境:
```
python setup_check.py
```
## 使用方法
```
python pipeline.py # ejecución completa
python pipeline.py --dry-run # sin llamadas a Ollama (prueba de fetch)
python pipeline.py --limit 10 # limitar artículos (útil para pruebas)
python pipeline.py --report-only # regenerar informe desde caché JSON del día
python pipeline.py --no-mark-read # no marcar como leídos en Miniflux
```
## 架构
```
Miniflux API (artículos no leídos)
│
▼ extractor.py
Prioridad: contenido del feed → trafilatura → BeautifulSoup → título
Truncado a ~800 tokens
│ (2 workers en paralelo)
▼ analyzer.py → qwen3.5:4b (think=False, num_ctx=2048)
Extrae JSON: threat_type, severity, actors, CVEs, IOCs → ArticleSummary
Caché: reports/summaries-cache-YYYY-MM-DD.json
│ (swap de modelo)
▼ analyzer.py → qwen3.5:9b (think=True, num_ctx=16384)
Genera informe con secciones: Resumen Ejecutivo, Amenazas Críticas,
Vulnerabilidades, Actores APT, Contexto LATAM, Acciones Recomendadas
▼ reporter.py
reports/threat-briefing-YYYY-MM-DD.{md,html}
```
模型按**顺序**加载(绝不并发运行)。在 LXC 中峰值内存:10 GB 可用内存中约占 ~7.2 GB。
## 预估性能 (i7-10510U, 仅 CPU)
| 阶段 | 100 篇文章 |
|-------|---------------|
| 抓取 + 采集 | 3–8 分钟 |
| 摘要 qwen3.5:4b (2 workers) | 20–35 分钟 |
| 报告 qwen3.5:9b | 8–15 分钟 |
| **总计** | **约 35–55 分钟** |
## Cron (LXC 112)
```
30 6 * * * root cd /opt/threat-pipeline && source venv/bin/activate && python pipeline.py >> /var/log/threat-pipeline.log 2>&1
```
标签:AI风险缓解, APT分析, CVE提取, DLL 劫持, HTML报告, IOC提取, LLM评估, Miniflux, Ollama, Python, Qwen3.5, RSS订阅, Splunk, 信号分离, 大语言模型, 威胁分析, 威胁情报, 安全报告生成, 安全架构, 实时处理, 开发者工具, 情报流水线, 文本摘要, 无后门, 本地部署, 网络安全, 自动化侦查工具, 逆向工具, 隐私保护