Hectorajm2001/SentinelOps
GitHub: Hectorajm2001/SentinelOps
基于四个 AI 智能体级联协作的实时网络安全事件自主检测与响应平台,将调查时间从数小时缩短到秒级。
Stars: 0 | Forks: 0
# SentinelOps
SentinelOps 是一个实时网络安全事件自主检测与响应的多智能体系统。它通过在 AMD MI300X 上基于 Llama 70B(使用 vLLM,未量化)运行四个专门的智能体,将原本需要 2-8 小时的调查时间缩短至约 40 秒。人类分析师可以通过 dashboard 保留最终控制权。
## 架构 (ASCII)
```
flowchart LR
%% =======================
%% INGESTIÓN
%% =======================
subgraph INGESTION["🔌 Data Ingestion Layer"]
A1[Syslog]
A2[Log Files]
A3[Mock Generator]
end
%% =======================
%% COLA / STREAM
%% =======================
subgraph STREAM["⚡ Event Streaming"]
B[Redis Event Queue]
end
%% =======================
%% AI AGENTS
%% =======================
subgraph AI["🧠 AI Multi-Agent Pipeline"]
C1[Security Classifier]
C2[Threat Investigator]
C3[Event Correlator]
C4[Playbook Generator]
end
%% =======================
%% STORAGE
%% =======================
subgraph STORAGE["💾 Persistence Layer"]
D[(PostgreSQL)]
end
%% =======================
%% FRONTEND
%% =======================
subgraph UI["🖥️ Visualization Layer"]
E[React Dashboard
WebSockets] end %% ======================= %% FLOW %% ======================= A1 --> B A2 --> B A3 --> B B --> C1 C1 --> C2 C2 --> C3 C3 --> C4 C4 --> D D --> E %% ======================= %% STYLES %% ======================= classDef ingestion fill:#0f172a,color:#fff,stroke:#38bdf8,stroke-width:2px; classDef stream fill:#1e293b,color:#fff,stroke:#22c55e,stroke-width:2px; classDef ai fill:#111827,color:#fff,stroke:#a78bfa,stroke-width:2px; classDef storage fill:#020617,color:#fff,stroke:#f59e0b,stroke-width:2px; classDef ui fill:#0b1120,color:#fff,stroke:#f43f5e,stroke-width:2px; class A1,A2,A3 ingestion; class B stream; class C1,C2,C3,C4 ai; class D storage; class E ui; ``` ## 快速设置(不到 10 分钟) 环境要求:Docker Desktop、Python 3.11、Node 18。 1. 复制 .env.example 为 .env,并根据需要调整密钥。 2. 启动服务: - docker compose up --build 3. 打开 UI: - http://localhost:3000 ### 按角色设置 - Product Lead:验证 README,打开 UI 并检查 TASKS.md。 - Cyber Security Expert:检查 data/sample_logs 并调整 agents/tools 中的规则。 - ML Engineer:将 VLLM_BASE_URL 指向 AMD vLLM,并在 agents/prompts 中测试提示词。 - Backend Developer:在 http://localhost:8000/docs 验证 endpoint,并在 /ws/alerts 验证 WebSocket。 - Frontend Developer:通过设置 REACT_APP_DEMO_MODE=true 检查演示模式及响应式布局。 ## 主要环境变量 - VLLM_BASE_URL:兼容 OpenAI 的 endpoint(例如:http://amd-vllm:8000/v1) - VLLM_MODEL_NAME:模型名称(例如:llama-70b) - VIRUSTOTAL_API_KEY、ABUSEIPDB_API_KEY:外部凭证 - REDIS_URL:事件队列(redis://redis:6379/0) - DATABASE_URL:历史记录(postgresql://sentinel:sentinel@postgres:5432/sentinelops) - CORS_ORIGINS:允许的 UI 来源 - API_SECRET_KEY:用于未来签名/授权的密钥 - REACT_APP_DEMO_MODE:设置为 true 可在无后端的情况下运行 UI ## 攻击模拟器(演示) 运行以下脚本以注入一次完整的攻击: python scripts/simulate_attack.py --base-url http://localhost:8000 该脚本将打印各阶段的进度,并将日志发送至 endpoint /api/logs/ingest。 ## 项目结构(附注释) ``` flowchart LR %% ======================= %% BACKEND %% ======================= subgraph BACKEND["⚙️ Backend (FastAPI)"] B1[main.py] B2[routers] B3[models] B4[services] B5[utils] B2 -->|REST + WS| B1 B3 --> B1 B4 --> B1 B5 --> B1 end %% ======================= %% AGENTS %% ======================= subgraph AGENTS["🧠 AI Agents (CrewAI)"] A1[crew.py] A2[tools] A3[prompts] A1 --> A2 A1 --> A3 end %% ======================= %% FRONTEND %% ======================= subgraph FRONTEND["🖥️ Frontend (React)"] F1[App.jsx] F2[components] F3[hooks] F4[data] F1 --> F2 F1 --> F3 F1 --> F4 end %% ======================= %% DATA %% ======================= subgraph DATA["📂 Data & Simulation"] D1[sample_logs] D2[mock_attacks] D3[simulate_attack.py] end %% ======================= %% INFRA %% ======================= subgraph INFRA["🐳 Infraestructura"] I1[docker-compose] I2[PostgreSQL] I3[Redis] I4[vLLM Mock Server] end %% ======================= %% FLOW RELATIONS %% ======================= D3 --> D1 D1 --> B2 B4 --> A1 A1 --> B4 B1 --> F1 B4 --> I2 B4 --> I3 A1 --> I4 I1 --> BACKEND I1 --> FRONTEND I1 --> AGENTS %% ======================= %% STYLES %% ======================= classDef backend fill:#0f172a,color:#fff,stroke:#38bdf8,stroke-width:2px; classDef agents fill:#111827,color:#fff,stroke:#a78bfa,stroke-width:2px; classDef frontend fill:#0b1120,color:#fff,stroke:#22c55e,stroke-width:2px; classDef data fill:#020617,color:#fff,stroke:#f59e0b,stroke-width:2px; classDef infra fill:#1e293b,color:#fff,stroke:#f43f5e,stroke-width:2px; class B1,B2,B3,B4,B5 backend; class A1,A2,A3 agents; class F1,F2,F3,F4 frontend; class D1,D2,D3 data; class I1,I2,I3,I4 infra; ```
WebSockets] end %% ======================= %% FLOW %% ======================= A1 --> B A2 --> B A3 --> B B --> C1 C1 --> C2 C2 --> C3 C3 --> C4 C4 --> D D --> E %% ======================= %% STYLES %% ======================= classDef ingestion fill:#0f172a,color:#fff,stroke:#38bdf8,stroke-width:2px; classDef stream fill:#1e293b,color:#fff,stroke:#22c55e,stroke-width:2px; classDef ai fill:#111827,color:#fff,stroke:#a78bfa,stroke-width:2px; classDef storage fill:#020617,color:#fff,stroke:#f59e0b,stroke-width:2px; classDef ui fill:#0b1120,color:#fff,stroke:#f43f5e,stroke-width:2px; class A1,A2,A3 ingestion; class B stream; class C1,C2,C3,C4 ai; class D storage; class E ui; ``` ## 快速设置(不到 10 分钟) 环境要求:Docker Desktop、Python 3.11、Node 18。 1. 复制 .env.example 为 .env,并根据需要调整密钥。 2. 启动服务: - docker compose up --build 3. 打开 UI: - http://localhost:3000 ### 按角色设置 - Product Lead:验证 README,打开 UI 并检查 TASKS.md。 - Cyber Security Expert:检查 data/sample_logs 并调整 agents/tools 中的规则。 - ML Engineer:将 VLLM_BASE_URL 指向 AMD vLLM,并在 agents/prompts 中测试提示词。 - Backend Developer:在 http://localhost:8000/docs 验证 endpoint,并在 /ws/alerts 验证 WebSocket。 - Frontend Developer:通过设置 REACT_APP_DEMO_MODE=true 检查演示模式及响应式布局。 ## 主要环境变量 - VLLM_BASE_URL:兼容 OpenAI 的 endpoint(例如:http://amd-vllm:8000/v1) - VLLM_MODEL_NAME:模型名称(例如:llama-70b) - VIRUSTOTAL_API_KEY、ABUSEIPDB_API_KEY:外部凭证 - REDIS_URL:事件队列(redis://redis:6379/0) - DATABASE_URL:历史记录(postgresql://sentinel:sentinel@postgres:5432/sentinelops) - CORS_ORIGINS:允许的 UI 来源 - API_SECRET_KEY:用于未来签名/授权的密钥 - REACT_APP_DEMO_MODE:设置为 true 可在无后端的情况下运行 UI ## 攻击模拟器(演示) 运行以下脚本以注入一次完整的攻击: python scripts/simulate_attack.py --base-url http://localhost:8000 该脚本将打印各阶段的进度,并将日志发送至 endpoint /api/logs/ingest。 ## 项目结构(附注释) ``` flowchart LR %% ======================= %% BACKEND %% ======================= subgraph BACKEND["⚙️ Backend (FastAPI)"] B1[main.py] B2[routers] B3[models] B4[services] B5[utils] B2 -->|REST + WS| B1 B3 --> B1 B4 --> B1 B5 --> B1 end %% ======================= %% AGENTS %% ======================= subgraph AGENTS["🧠 AI Agents (CrewAI)"] A1[crew.py] A2[tools] A3[prompts] A1 --> A2 A1 --> A3 end %% ======================= %% FRONTEND %% ======================= subgraph FRONTEND["🖥️ Frontend (React)"] F1[App.jsx] F2[components] F3[hooks] F4[data] F1 --> F2 F1 --> F3 F1 --> F4 end %% ======================= %% DATA %% ======================= subgraph DATA["📂 Data & Simulation"] D1[sample_logs] D2[mock_attacks] D3[simulate_attack.py] end %% ======================= %% INFRA %% ======================= subgraph INFRA["🐳 Infraestructura"] I1[docker-compose] I2[PostgreSQL] I3[Redis] I4[vLLM Mock Server] end %% ======================= %% FLOW RELATIONS %% ======================= D3 --> D1 D1 --> B2 B4 --> A1 A1 --> B4 B1 --> F1 B4 --> I2 B4 --> I3 A1 --> I4 I1 --> BACKEND I1 --> FRONTEND I1 --> AGENTS %% ======================= %% STYLES %% ======================= classDef backend fill:#0f172a,color:#fff,stroke:#38bdf8,stroke-width:2px; classDef agents fill:#111827,color:#fff,stroke:#a78bfa,stroke-width:2px; classDef frontend fill:#0b1120,color:#fff,stroke:#22c55e,stroke-width:2px; classDef data fill:#020617,color:#fff,stroke:#f59e0b,stroke-width:2px; classDef infra fill:#1e293b,color:#fff,stroke:#f43f5e,stroke-width:2px; class B1,B2,B3,B4,B5 backend; class A1,A2,A3 agents; class F1,F2,F3,F4 frontend; class D1,D2,D3 data; class I1,I2,I3,I4 infra; ```
标签:AI智能体, AMD MI300X, DLL 劫持, Llama 70B, PostgreSQL, PyRIT, React, Redis, SOAR, Syscalls, Syslog, vLLM, WebSockets, 事件关联, 剧本生成, 多智能体系统, 大语言模型, 威胁情报, 安全事件调查, 安全运营, 实时威胁检测, 开发者工具, 扫描框架, 搜索引擎查询, 测试用例, 网络安全, 自动驾驶响应, 请求拦截, 逆向工具, 隐私保护