Nyx-Sentinel/threatintel-daily

GitHub: Nyx-Sentinel/threatintel-daily

一个轻量级、自托管的个人威胁情报聚合器,帮助用户整合多源情报以监控和响应针对自身数字资产的安全威胁。

Stars: 1 | Forks: 1

# ThreatIntel 每日 🛡️ 一个**个人威胁情报聚合器**,监控您的数字足迹并提醒您关注重要威胁。自托管、隐私优先、可扩展。 ## 功能概述 ThreatIntel Daily 自动执行以下操作: - **监控影响您软件/服务的 CVE** - **追踪与您电子邮件地址和域名相关的泄露凭据** - **标记攻击您基础设施的恶意 IP/域名**(通过日志或自定义订阅源) - **关联多个公共威胁订阅源的威胁** - **在相关威胁出现时通过电子邮件、Webhook 或 CLI 向您发出警报** - **与您的实验室集成**(T-Pot 蜜罐、FortiGate 日志、Wazuh 等) ## 核心差异 大多数威胁情报工具面向**企业规模**,价格昂贵且对个人用户而言过于复杂。ThreatIntel Daily 则具备以下特点: - ✅ **轻量级** — 可在 Raspberry Pi、Docker 容器或本地机器上运行 - ✅ **隐私优先** — 所有数据本地存储,无云厂商锁定 - ✅ **多源聚合** — 整合 NVD、OSV、HaveIBeenPwned、AbuseIPDB、URLhaus 及自定义订阅源 - ✅ **实验室感知** — 从 Wazuh 拉取警报、解析 FortiGate 防火墙日志、T-Pot 蜜罐事件 - ✅ **易于扩展** — 提供简洁的 Python API 用于自定义集成 - ✅ **无订阅费用** — 完全开源,采用 MIT 许可证 ## 功能特性 ### 🔍 威胁监控 - **CVE 监控** — 监控您技术栈(Python 包、操作系统、服务)中的漏洞 - **凭据泄露** — 立即知晓您的电子邮件/域名是否出现在数据泄露中 - **IP 信誉** — 通过 AbuseIPDB、Shodan、URLhaus 追踪恶意 IP 及域名 - **STIX/TAXII 订阅源** — 导入来自您组织的自定义威胁订阅源 ### 🚨 警报通知 - 电子邮件通知(即时、摘要或每小时) - Webhook POST 至 Slack、Microsoft Teams、Discord 或自定义端点 - Web 仪表板供您随时查看威胁 - CLI 工具适用于无头/实验室环境 ### 🏠 实验室集成 - 导入 **Wazuh** 警报并与外部威胁关联 - 解析 **FortiGate** 防火墙日志(NetFlow、IPS 事件) - 监控 **T-Pot** 蜜罐交互 - 为您的自定义工具提供日志解析器 ### 📊 分析功能 - 趋势图表:哪些威胁类型最频繁地影响您? - 主要来源:攻击源自何处? - 误报学习:将警报标记为误报,系统将自动学习 - 导出报告(JSON、CSV)供您自行分析 ## 安装方式 ### 方案一:Docker(推荐) ``` git clone https://github.com/Nyx-Sentinel/threatintel-daily.git cd threatintel-daily cp config.example.yml config.yml # 使用你的 API 密钥和监控域名编辑 config.yml docker-compose up -d ``` 访问 `http://localhost:8080` 进入仪表板。 ### 方案二:本地安装(Linux/macOS) **系统要求:** Python 3.9+ ``` git clone https://github.com/Nyx-Sentinel/threatintel-daily.git cd threatintel-daily python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt cp config.example.yml config.yml ``` 编辑 `config.yml` 文件配置您的设置,然后运行: ``` # 运行聚合器(每小时拉取威胁) python -m threatintel_daily.main # 或使用 CLI 命令 python -m threatintel_daily.cli check-cves python -m threatintel_daily.cli check-breaches python -m threatintel_daily.cli monitor --interval 3600 ``` ### 方案三:Raspberry Pi / 低功耗设备 ``` # 与选项 2 相同,但: pip install -r requirements-minimal.txt # Lighter dependencies # 编辑 config.yml 以禁用未使用的功能(例如 Shodan)以节省 API 配额 ``` ## 快速入门 ### 1. 配置威胁源 ``` # config.yml monitored: emails: - your-email@example.com - work-email@company.com domains: - example.com - company.com subdomains: # Monitor all *.example.com - example.com services: - software: "python" version: "3.11.x" - software: "nginx" version: "1.24.x" feeds: nvd: enabled: true api_key: "" # Get free key at https://nvd.nist.gov/developers/request-an-api-key haveibeenpwned: enabled: true api_key: "YOUR_HIBP_API_KEY" # https://haveibeenpwned.com/API/v3 abuseipdb: enabled: true api_key: "YOUR_ABUSEIPDB_KEY" # https://www.abuseipdb.com/api custom_feeds: - url: "https://your-org.com/threat-feed.json" format: "stix2" frequency: "daily" alerts: email: enabled: true from: "threatintel-daily@example.com" to: - "your-email@example.com" smtp_server: "smtp.gmail.com" smtp_port: 587 username: "your-email@gmail.com" password: "YOUR_APP_PASSWORD" # NOT your real password digest: "daily" # or "immediate", "hourly" webhook: enabled: true url: "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK" service: "slack" # or "teams", "discord", "custom" dashboard: enabled: true port: 8080 username: "admin" password: "CHANGE_ME" lab_integration: wazuh: enabled: false api_url: "https://wazuh-manager.local:55000" api_user: "wazuh_user" api_pass: "wazuh_pass" fortigate: enabled: false device_ip: "192.168.1.1" api_token: "YOUR_FORTIGATE_TOKEN" tpot: enabled: false api_url: "http://tpot.local:64297" api_key: "YOUR_TPOT_KEY" ``` ### 2. 运行程序 ``` # 一次性检查 python -m threatintel_daily.cli check-all # 持续监控(默认每小时运行一次) python -m threatintel_daily.main ``` ### 3. 查看结果 - **仪表板:** `http://localhost:8080`(若已启用) - **电子邮件:** 摘要或即时警报发送至您的收件箱 - **Slack/Teams:** 实时 Webhook 推送 - **CLI:** `python -m threatintel_daily.cli list-threats` ## 所需 API 密钥 | 服务 | 监控内容 | 费用 | 链接 | |------|----------|------|------| | **NVD** | CVE/漏洞 | 免费 | https://nvd.nist.gov/developers/request-an-api-key | | **HaveIBeenPwned** | 数据泄露数据库 | 免费或付费层级 | https://haveibeenpwned.com/API/v3 | | **AbuseIPDB** | 恶意 IP | 免费(每日 15,000 次) | https://www.abuseipdb.com/api | | **URLhaus** | 恶意软件 URL | 免费(无需密钥) | https://urlhaus-api.abuse.ch/docs/ | | **Shodan** | 全网扫描 | 付费(可选) | https://www.shodan.io/ | | **OSV** | 开源漏洞 | 免费 | https://api.osv.dev/ | ## 实验室集成示例 ### Wazuh 配置完成后,ThreatIntel Daily 将: 1. 每 30 分钟轮询 Wazuh 获取新警报 2. 将警报中的 IP/域名与 AbuseIPDB 及 URLhaus 交叉比对 3. 当内部警报与已知恶意软件 IP 匹配时标记警告 ``` # 测试集成 python -m threatintel_daily.cli test-wazuh ``` ### FortiGate 解析 IPS 事件、DDoS 日志及被阻止的连接: ``` # 从 FortiGate 获取最后 100 个 IPS 事件 python -m threatintel_daily.cli fortigate-logs --limit 100 ``` ### T-Pot 监控蜜罐交互(SSH、HTTP、Telnet 攻击): ``` # 实时监视 T-Pot python -m threatintel_daily.cli tpot-monitor --live ``` ## 使用示例 ### "若我的电子邮件出现在数据泄露中,请提醒我" ``` python -m threatintel_daily.cli check-breaches --email your-email@example.com ``` ### "显示过去 24 小时内的所有威胁" ``` python -m threatintel_daily.cli list-threats --since 24h ``` ### "将威胁导出为 JSON 格式以供进一步分析" ``` python -m threatintel_daily.cli export-threats --format json --output threats.json ``` ### "将某个域名的误报静音" ``` python -m threatintel_daily.cli silence-domain example-spam.com --reason "spam filter test" ``` ### "检查我的 Raspberry Pi IP 是否被列入黑名单" ``` python -m threatintel_daily.cli check-ip 192.168.1.50 ``` ## 项目结构 ``` threatintel-daily/ ├── README.md ├── LICENSE (MIT) ├── requirements.txt ├── requirements-minimal.txt ├── config.example.yml ├── docker-compose.yml ├── Dockerfile ├── setup.py ├── threatintel_daily/ │ ├── __init__.py │ ├── main.py # Scheduler + entry point │ ├── cli.py # Command-line interface │ ├── database.py # SQLite local storage │ ├── alerts.py # Email, webhook, dashboard │ ├── feeds/ │ │ ├── __init__.py │ │ ├── nvd.py # NVD CVE API │ │ ├── hibp.py # HaveIBeenPwned │ │ ├── abuseipdb.py # AbuseIPDB │ │ ├── urlhaus.py # URLhaus malware │ │ ├── osv.py # Open-source vulnerabilities │ │ └── stix.py # Custom STIX/TAXII feeds │ ├── labs/ │ │ ├── __init__.py │ │ ├── wazuh.py # Wazuh integration │ │ ├── fortigate.py # FortiGate integration │ │ └── tpot.py # T-Pot honeypot │ ├── api/ │ │ ├── __init__.py │ │ ├── routes.py # FastAPI routes for dashboard │ │ └── auth.py # Basic auth │ ├── utils/ │ │ ├── __init__.py │ │ ├── config.py # Config parsing │ │ ├── logger.py # Logging setup │ │ └── models.py # Data models (Threat, Alert, etc.) │ └── dashboard/ # React frontend (optional) │ ├── public/ │ └── src/ └── tests/ ├── test_feeds.py ├── test_alerts.py └── test_labs.py ``` ## 开发路线图 - [x] 核心架构 + CLI - [x] 多源订阅聚合 - [x] 本地 SQLite 存储 - [x] 邮件 + Webhook 警报 - [ ] Web 仪表板(React) - [ ] Wazuh 集成 - [ ] FortiGate 集成 - [ ] T-Pot 集成 - [ ] 机器学习误报分类器 - [ ] MISP 集成 - [ ] 移动应用(React Native) - [ ] Kubernetes Helm chart - [ ] 威胁关联引擎(MITRE ATT&CK 映射) ## 许可证 MIT 许可证 — 详见 LICENSE 文件。 ## 支持渠道 - **问题反馈:** GitHub Issues 选项卡 - **讨论交流:** GitHub Discussions **由网络安全爱好者为网络安全爱好者构建。** 🔒
标签:Docker容器, GPT, IP信誉检查, Python安全工具, Raspberry Pi应用, STIX/TAXII, Webhook集成, Web仪表板, 个人安全, 凭证泄露检测, 多源聚合, 威胁情报, 威胁馈送, 安全事件管理, 实验室集成, 开发者工具, 开源安全工具, 恶意IP/域名标记, 攻击面发现, 数字足迹监控, 数据泄露监控, 漏洞管理, 电子邮件通知, 网络安全, 警报系统, 请求拦截, 轻量级安全, 逆向工具, 逆向工程平台, 隐私优先, 隐私保护