Harikagolusu/ThreatLens-AI

GitHub: Harikagolusu/ThreatLens-AI

基于 RAG 架构的智能网络安全问答助手,结合 MITRE ATT&CK 知识库与 Google Gemini 模型为安全分析师提供准确的威胁情报对话式查询服务。

Stars: 0 | Forks: 0

# ThreatLens AI 一个基于 AI 的网络安全助手,它使用 **Retrieval-Augmented Generation (RAG)** 基于官方 [MITRE ATT&CK Enterprise](https://attack.mitre.org/) 知识库来回答用户的问题。 ThreatLens AI 会提取官方的 MITRE ATT&CK Enterprise STIX 数据集,将其索引到 FAISS 向量数据库中,并利用 Google Gemini API 为网络安全查询提供准确且结合上下文的响应。 ## 功能(已实现与规划中) - **RAG Pipeline** — 摄取、分块、嵌入并检索 MITRE ATT&CK Enterprise STIX 数据 - **FastAPI 后端** — 用于处理查询和健康监控的 RESTful API - **React 前端** — 使用 Vite 和 Tailwind CSS 为网络安全分析师构建的交互式现代聊天界面 - **Google Gemini API** — 利用 Google 的高级语言模型实现高性能生成 - **FAISS 向量搜索** — 对 ATT&CK 技术、战术和缓解措施进行高效的语义搜索 - **语音交互** *(未来规划)* — 支持 speech-to-text 和 text-to-speech ## 目录结构 ``` threatlens-ai/ ├── backend/ # FastAPI application source code │ ├── api/ # API route handlers and routers │ ├── rag/ # RAG pipeline (ingestion, retrieval, generation) │ ├── services/ # Business logic and orchestration layer │ ├── models/ # Pydantic schemas and domain models │ ├── utils/ # Shared utilities and helpers │ ├── config.py # Application configuration (Pydantic Settings) │ ├── .env.example # Backend environment variable template │ └── main.py # FastAPI application entry point ├── frontend/ # React frontend built with Vite and Tailwind CSS ├── data/ │ ├── raw/ # Raw MITRE ATT&CK STIX dataset downloads │ ├── processed/ # Cleaned and normalized dataset files │ └── chunks/ # Document chunks ready for embedding ├── vector_db/ # FAISS vector index storage ├── docs/ # Project documentation ├── tests/ # Unit and integration tests ├── requirements.txt # Python dependencies ├── package.json # Frontend Node dependencies (in frontend/) ├── .gitignore # Project git ignore └── README.md ``` ## 技术栈 | 组件 | 技术 | |------------------|-------------------------------| | 语言 | Python 3.11+ & Node.js | | 后端 API | FastAPI + Uvicorn | | 前端 | React (Vite) + Tailwind CSS | | RAG 框架 | LangChain | | 向量数据库 | FAISS | | LLM | Google Gemini API | | 数据验证 | Pydantic | | 配置 | python-dotenv | ## 安装说明 ### 前置条件 - Python 3.11 或更高版本 - Node.js(用于前端) - Git ### 设置 1. **克隆代码库** git clone cd threatlens-ai 2. **后端设置** # 创建并激活虚拟环境 python -m venv .venv # Windows .venv\Scripts\activate # macOS / Linux source .venv/bin/activate # 安装 Python 依赖 pip install -r requirements.txt 3. **前端设置** cd frontend npm install 4. **配置环境变量** # 复制示例后端配置 cp backend/.env.example backend/.env # 重要提示:编辑 backend/.env 并添加你的 GEMINI_API_KEY ## 运行 ### 启动 FastAPI 后端 在项目根目录下(确保你的虚拟环境已激活): ``` uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000 ``` ### 验证 API - 根 endpoint:[http://localhost:8000/](http://localhost:8000/) - 健康检查:[http://localhost:8000/health](http://localhost:8000/health) - 交互式文档:[http://localhost:8000/docs](http://localhost:8000/docs) ### 启动 React 前端 打开一个新的终端窗口,导航到 `frontend` 目录: ``` cd frontend npm run dev ``` 前端将可以通过终端中提供的 URL 访问(通常是 `http://localhost:5173`)。 ## License 待定
标签:AV绕过, FastAPI, MITM代理, React, Syscalls, 人工智能, 检索增强生成(RAG), 用户模式Hook绕过, 网络安全助手, 逆向工具