robertpreshyl/security-intelligence-engine

GitHub: robertpreshyl/security-intelligence-engine

面向 Wazuh SIEM 的 AI 增强威胁分析平台,支持自然语言查询、多 LLM 后端、自动化攻击模式检测与专业报告生成

Stars: 0 | Forks: 0

# AllysecLabs 安全智能引擎 面向 [Wazuh](https://wazuh.com/) SIEM 的 AI 驱动威胁检测与分析。 用通俗英语提问安全相关问题 —— 获取专业的 SOC 分析师报告,包含 MITRE ATT&CK 映射、自动化模式检测以及可点击的 Wazuh dashboard 链接。 ``` "Give me a complete security overview of the last 7 days" "Detect brute force attacks targeting the mail server" "Are there indicators of lateral movement between agents?" "Show all privilege escalation events on Linux systems" ``` ## 截图 ### Dashboard — 自然语言查询与多 LLM Provider 选择器 ![Dashboard Query](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/32dd3db936015609.png) ### AI 生成的安全情报报告 ![AI Analysis Report](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/2d1d25e13e015611.png) ### 关键发现 — 暴力破解检测与 Pass-the-Hash 分析 ![Critical Findings](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/1c7991888e015612.png) ### 顶级安全事件表格(含可点击的 Wazuh Dashboard 链接) ![Security Events Table](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/06945fcd5d015616.png) ### 告警分布与 MITRE ATT&CK 覆盖图表 ![MITRE Charts](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/c37e45dab0015618.png) ### 专业品牌 HTML 报告导出 ![HTML Report Export](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/5790624289015624.png) ## 工作原理 1. **您提问**:通过 Web dashboard 或 API 发起自然语言问题 2. **AI 解读**:将您的问题转换为结构化的 Wazuh 搜索参数 3. **告警引擎**:加载并过滤实时的 Wazuh 告警 (`alerts.json`) 4. **模式检测器**:识别暴力破解、端口扫描、横向移动、权限提升 5. **AI 分析**:以 Tier 2 SOC 分析师视角分析结果 —— MITRE 映射、风险评估、建议 6. **生成报告**:附带可点击的 Wazuh dashboard 链接,并支持导出 HTML/PDF ## 功能特性 - **自然语言查询** — 询问有关您安全态势的任何问题 - **Multi-LLM 支持** — 7 个 Provider,可在 dashboard 中切换: | Provider | Type | Models | |----------|------|--------| | Groq | Cloud | Llama 3.3 70B, Llama 4 Scout, Qwen3 32B | | Ollama | Self-hosted | Qwen 2.5, Llama 3.2 (any local model) | | OpenRouter | Cloud | 100+ models (GPT-4o, Claude, Gemini, free tier available) | | OpenAI | Cloud | GPT-4o, GPT-4o-mini | | Anthropic | Cloud | Claude Sonnet 4, Claude Haiku 4 | | Google | Cloud | Gemini 2.0 Flash, Gemini 1.5 Pro | | HuggingFace | Cloud | Llama 3.3 70B, Qwen 2.5 72B, Mixtral | - **6 种模式检测算法** — 暴力破解、端口扫描、权限提升、横向移动、告警爆发、合规失败 - **MITRE ATT&CK 映射**,并提供指向您 Wazuh dashboard 的可点击链接 - **专业报告** — Markdown、品牌化 HTML 以及 PDF 导出 - **事件文档化** — 遵循 NIST 框架自动生成 IR 报告 - **安全门控操作** — 带有默认 dry-run 与审计跟踪的 response broker - **REST API** — 完整文档,Swagger UI 位于 `/docs` ## 架构 ``` ┌──────────────────────────────────────────────────────────┐ │ Streamlit Dashboard (:8501) │ │ Threat banners · Charts · AI Analysis · Patterns │ └───────────────────────┬──────────────────────────────────┘ │ HTTP ┌───────────────────────▼──────────────────────────────────┐ │ FastAPI Backend (:8000) │ │ /query — Natural language analysis pipeline │ │ /status — Health check (Wazuh + LLM + alerts) │ │ /docs — Swagger API documentation │ └──┬──────────┬──────────┬──────────┬──────────────────────┘ │ │ │ │ ▼ ▼ ▼ ▼ ┌──────┐ ┌────────┐ ┌────────┐ ┌───────────┐ │ LLM │ │ Alert │ │Pattern │ │ Wazuh │ │ API │ │Process.│ │Detect. │ │ Client │ │(any) │ │ │ │ │ │ (REST) │ └──────┘ └────────┘ └────────┘ └───────────┘ 7 providers alerts.json 6 algorithms Wazuh API ``` ## 快速开始 ### 前置条件 - Python 3.10+ - Wazuh 4.x(manager,需具有 `alerts.json` 访问权限) - 至少一个 LLM API key(建议从 Groq free tier 开始) ### 安装 ``` git clone https://github.com/robertpreshyl/security-intelligence-engine.git cd security-intelligence-engine python3 -m venv venv source venv/bin/activate pip install -r requirements.txt ``` ### 配置 ``` cp .env.example .env nano .env # 必需:WAZUH_API_PASSWORD, GROQ_API_KEY (或任意 LLM 提供商密钥) ``` ### 启动 ``` bash start_dashboard.sh ``` | Service | URL | |---------|-----| | Dashboard | http://localhost:8501 | | API | http://localhost:8000 | | API Docs | http://localhost:8000/docs | 生产环境部署请参见 `systemd/` 中的 systemd service 文件。 ## 项目结构 ``` ├── api_server.py # FastAPI backend — query pipeline & REST API ├── dashboard.py # Streamlit web dashboard ├── analyze.py # CLI analysis tool ├── start_dashboard.sh # Launch script (API + dashboard) ├── open-firewall.sh # UFW port opener for 8000/8501 │ ├── modules/ │ ├── llm_providers.py # Multi-LLM provider registry (7 backends) │ ├── ai_query_engine.py # NL query interpretation & SOC analysis │ ├── alert_processor.py # Alert loading, filtering, stats, MITRE enrichment │ ├── pattern_detector.py # 6 automated detection algorithms │ ├── wazuh_client.py # Wazuh REST API client (read-only) │ ├── wazuh_links.py # Clickable Wazuh dashboard link generator │ ├── incident_reporter.py # Incident report generator │ ├── report_exporter.py # HTML/PDF export with branding │ └── action_broker.py # Safety-gated response actions (dry-run default) │ ├── prompts/ │ ├── master_soc_prompt.py # SOC analyst prompt engineering & templates │ └── soc_analyst_system.md # System prompt specification │ ├── systemd/ # Production service files ├── docs/ # Architecture documentation ├── .env.example # Configuration template └── requirements.txt # Python dependencies ``` ## 配置说明 所有配置均通过环境变量(`.env` 文件)进行。完整参考请见 [.env.example](.env.example)。 **必填:** - `WAZUH_API_PASSWORD` — 您的 Wazuh API 密码 - 至少一个 LLM API key(`GROQ_API_KEY`、`OPENROUTER_API_KEY` 等) **可选:** - `WAZUH_DASHBOARD_URL` — 用于生成报告中的可点击链接(默认:`https://localhost`) - `OLLAMA_API_URL` — 自托管 Ollama endpoint - 其他 LLM Provider keys — 配置后,Provider 会在 dashboard 中自动显示 ## 许可证 [AGPL-3.0](LICENSE) ## 安全 发现漏洞?请参阅 [SECURITY.md](SECURITY.md) 进行负责任披露。 ## 贡献 请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
标签:AI安全, AI风险缓解, AMSI绕过, Chat Copilot, Cloudflare, CSV导出, DLL 劫持, Kubernetes, LLM, MITRE ATT&CK, PE 加载器, SOC分析, Unmanaged PE, Wazuh, Wazuh插件, 免杀技术, 协议分析, 大语言模型, 威胁检测, 安全可视化, 安全情报, 安全运营中心, 插件系统, 智能安全助手, 暴力破解检测, 权限提升, 横向移动, 红队行动, 编程规范, 网络安全, 网络映射, 自动化报告, 自然语言查询, 逆向工具, 速率限制, 隐私保护