nimra-pixel/sentinel-cyber-defense

GitHub: brainlytlabs/sentinel-cyber-defense

基于 LangGraph 七智能体架构的 AI 网络安全平台,能够从多种日志中自动检测威胁、映射 MITRE ATT&CK 框架、评估风险并生成事件响应报告与处置剧本。

Stars: 0 | Forks: 0

# 🛡️ SENTINEL — AI 网络防御情报平台 [![Streamlit](https://img.shields.io/badge/Streamlit-FF4B4B?style=flat&logo=streamlit&logoColor=white)](https://streamlit.io) [![LangGraph](https://img.shields.io/badge/LangGraph-000000?style=flat&logo=langchain&logoColor=white)](https://langchain-ai.github.io/langgraph/) [![Groq](https://img.shields.io/badge/Groq-000000?style=flat&logoColor=white)](https://groq.com) [![Python](https://img.shields.io/badge/Python-3776AB?style=flat&logo=python&logoColor=white)](https://python.org) ## 🏗️ 架构 — LangGraph 7-Agent Pipeline ``` Raw Security Logs │ ▼ ┌─────────────────────────────────────────────────────────────────┐ │ LangGraph StateGraph │ │ │ │ [Log Parser] ──► [Threat Hunter] ──► [Reasoning Agent] │ │ │ │ │ ▼ │ │ [IR Reporter] ◄── [Responder] ◄── [MITRE Mapper] ◄── [Risk Scorer] │ │ │ │ │ ▼ │ │ END │ └─────────────────────────────────────────────────────────────────┘ │ ▼ Incident Report + Response Playbook ``` ## 🤖 7个 Agent | Agent | 职责 | 输出 | |---|---|---| | 🔍 **Log Parser** | 标准化所有日志格式 | 结构化事件、IP、协议 | | 🕵️ **Threat Hunter** | 检测攻击特征及 IOC | 威胁列表、恶意 IP、命令 | | 🧠 **Reasoning Agent** | 构建完整的攻击链叙述 | 逐步攻击故事 | | 📊 **Risk Scorer** | 类 CVSS 的严重性评分 | 0-10 评分、严重性级别 | | 🗺️ **MITRE Mapper** | 映射至 MITRE ATT&CK 框架 | 战术、技术、杀伤链 | | 🛡️ **Response Agent** | 生成 IR 剧本 | Shell 命令、遏制步骤 | | 📝 **Incident Reporter** | 创建可下载的 IR 报告 | 完整的专业报告 | ## ✨ 特性 - **LangGraph StateGraph** — Agent 共享类型化 state,每个 Agent 都在先前输出的基础上进行构建 - **4种攻击场景** — SSH 暴力破解、SQL 注入、端口扫描、勒索软件 - **上传任意日志文件** — syslog、auth.log、Apache、Windows Event、IDS/IPS、防火墙 - **CVSS 风险评分** — 自动评估严重性:CRITICAL / HIGH / MEDIUM / LOW - **MITRE ATT&CK 映射** — 带有描述的战术和技术 ID - **IR 剧本** — 包含实际 shell 命令的优先级操作 - **可下载的 IR 报告** — 专业的 .txt 事件报告 - **深色网络安全 UI** — 带有扫描动画的终端美学 - **自动回退** — 如果 LangGraph 遇到错误,将回退到直接 pipeline ## 🚀 快速开始 ``` # 1. Clone the repo git clone https://github.com/nimra-pixel/sentinel-cyber-defense.git cd sentinel-cyber-defense # 2. Install dependencies pip install -r requirements.txt # 3. Run streamlit run app.py ``` 在侧边栏粘贴您免费的 Groq API 密钥 → [console.groq.com](https://console.groq.com) ## ☁️ 部署至 Streamlit Cloud ``` git add . && git commit -m "deploy" && git push ``` 在 [share.streamlit.io](https://share.streamlit.io): - Main file: `app.py` - Secrets: `GROQ_API_KEY = "gsk_..."` ## 📁 文件结构 ``` sentinel-cyber-defense/ ├── app.py # Streamlit UI — 5 tabs ├── cyber_graph.py # LangGraph pipeline — 7 agents ├── cyber_agents.py # Direct pipeline (fallback) ├── cyber_config.py # Agent prompts, sample logs, config ├── requirements.txt # Dependencies └── README.md ``` ## 🧰 技术栈 - **[LangGraph](https://langchain-ai.github.io/langgraph/)** — 具有共享 state 的 Agent 编排 - **[Groq](https://groq.com)** — 免费的超高速 LLM 推理 - **[Llama 3.3 70B](https://llama.meta.com)** — AI 推理引擎 - **[Streamlit](https://streamlit.io)** — Web UI - **Python** — 核心语言 ## 🎯 支持的日志类型 - Linux syslog / auth.log / kern.log - Apache / Nginx access & error logs - Windows Event Logs - 防火墙日志 (iptables, UFW, Palo Alto) - IDS/IPS 警报 (Snort, Suricata) - 自定义应用日志 ## 👩‍💻 构建者 **Nimra** — AI 工程师兼助理教授,Superior University 🔗 [GitHub](https://github.com/nimra-pixel) ## 📄 许可证 MIT License — 免费使用、修改和分发。
标签:Agent, AMSI绕过, Kubernetes, LangGraph, LLM, Unmanaged PE, 人工智能, 威胁检测, 库, 应急响应, 用户模式Hook绕过, 网络安全, 逆向工具, 隐私保护