eyop/SentinelIQ

GitHub: eyop/SentinelIQ

SentinelIQ 是一个将 CVE/NVD、MITRE ATT&CK 和 Elastic SIEM 日志整合到 RAG 管道中,让安全分析师用自然语言进行威胁情报查询的平台。

Stars: 0 | Forks: 0

# SentinelIQ — AI 驱动的威胁情报平台 [![Python](https://img.shields.io/badge/Python-3.11+-blue)](https://python.org) [![FastAPI](https://img.shields.io/badge/FastAPI-0.111-green)](https://fastapi.tiangolo.com) [![LangChain](https://img.shields.io/badge/LangChain-0.2-purple)](https://langchain.com) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow)](LICENSE) ## 功能简介 SentinelIQ 会获取 CVE/NVD 订阅源、MITRE ATT&CK 报告以及 Elastic SIEM 日志,将它们嵌入到向量存储中,并开放 RAG pipeline,以便安全分析师能够用自然语言提问,并获得基于事实且带有引用的回答。 **查询示例:** *“过去 14 天内是否有影响我们 Docker 技术栈的严重 CVE?”* **回答示例:** *“有 — CVE-2024-21626 (CVSS 8.6) 允许通过 runc 发生 container breakout。修复方案:将 runc 升级至 ≥1.1.12。来源:NVD 2024-02-01。”* ## 架构 ``` NVD/CVE Feeds ─┐ MITRE ATT&CK ─┼─▶ LangChain Loaders ─▶ Normaliser ─▶ Chunker ─▶ OpenAI Embeddings ─▶ Pinecone Elastic SIEM ─┘ │ ▼ React Dashboard ◀── FastAPI (/query /alerts /cve) ◀── LangChain RAG Chain (GPT-4o) ◀── Retriever ``` ## 技术栈 | 层级 | 工具 | |---|---| | 数据获取 | LangChain document loaders | | 任务调度 | APScheduler | | Embeddings | OpenAI `text-embedding-3-small` | | 向量存储 | Pinecone | | LLM | 通过 LangChain 调用 GPT-4o | | SIEM | Elasticsearch Python client | | 后端 | FastAPI + Pydantic v2 | | 前端 | React + TailwindCSS | | 基础设施 | Docker Compose | ## 快速开始 ### 1. 克隆并配置 ``` git clone https://github.com/YOUR_USERNAME/sentineliq.git cd sentineliq cp .env.example .env # 在 .env 中填写你的 API keys ``` ### 2. 使用 Docker 运行(推荐) ``` docker-compose up --build ``` API: http://localhost:8000 文档: http://localhost:8000/docs 仪表盘: http://localhost:3000 ### 3. 本地运行(开发环境) ``` # Backend python -m venv .venv && source .venv/bin/activate pip install -r requirements.txt uvicorn api.main:app --reload # 触发初始 ingestion python scripts/ingest_now.py ``` ## 项目结构 ``` sentineliq/ ├── ingestion/ # Data loaders & normaliser │ ├── nvd_loader.py │ ├── mitre_loader.py │ ├── elastic_loader.py │ └── normaliser.py ├── rag/ # Embedding, vector store, RAG chain │ ├── chunker.py │ ├── embedder.py │ ├── vectorstore.py │ ├── retriever.py │ ├── chain.py │ └── prompts.py ├── siem/ # Elastic SIEM integration │ ├── client.py │ ├── parser.py │ └── correlator.py ├── api/ # FastAPI application │ ├── main.py │ ├── auth.py │ ├── schemas.py │ └── routes/ │ ├── query.py │ ├── alerts.py │ └── cve.py ├── frontend/ # React dashboard ├── scripts/ # One-off utilities │ └── ingest_now.py ├── tests/ ├── docker/ ├── docker-compose.yml ├── requirements.txt └── .env.example ``` ## 环境变量 请参阅 `.env.example` 获取所有必需的变量。 | 变量 | 描述 | |---|---| | `OPENAI_API_KEY` | OpenAI API key | | `PINECONE_API_KEY` | Pinecone API key | | `PINECONE_INDEX` | Pinecone 索引名称(例如 `sentineliq`) | | `ELASTIC_URL` | Elasticsearch URL | | `ELASTIC_API_KEY` | Elastic API key | | `JWT_SECRET` | 用于 JWT 签名的 secret | ## 路线图 - [x] 第一阶段:NVD + MITRE ATT&CK 数据获取 - [x] 第二阶段:OpenAI embeddings + Pinecone 向量存储 - [x] 第三阶段:LangChain RAG pipeline - [ ] 第四阶段:Elastic SIEM 关联引擎 - [ ] 第五阶段:FastAPI 后端完善 - [ ] 第六阶段:React 仪表盘 ## 已申请的相关认证 - Google Cybersecurity — SIEM 集成、日志分析 - IBM AI Engineering — RAG pipeline、embeddings - Elastic SIEM — Elasticsearch 集成 - Fortinet NSE — 威胁分类逻辑 ## 许可证 MIT
标签:AI安全分析, AV绕过, FastAPI, LangChain, 威胁情报, 开发者工具, 检索增强生成, 版权保护, 轻量级, 逆向工具