InsiyahBhatia/n8n-detection-engineer-ai
GitHub: InsiyahBhatia/n8n-detection-engineer-ai
该项目利用 n8n 编排多代理 AI 工作流,将自然语言威胁描述自动转化为多 SIEM 平台的生产级检测规则,并集成自动化 QA、GitOps 版本控制与 Slack 告警。
Stars: 1 | Forks: 0
# AI 检测工程助手
[](https://n8n.io)
[](https://attack.mitre.org)
一个基于 n8n 构建的自主多代理 AI 系统,能够将自然语言网络攻击场景转化为经过验证的多 SIEM 生产级检测包(Sigma、Splunk SPL、Microsoft Sentinel KQL、Elastic Security),直接将结构化的 Markdown 和 JSON 报告发布到 GitHub(通过 MITRE ATT&CK 分类法进行映射),并通过 Slack 实时发送 SOC 警报。
- **检测输出仓库**:[InsiyahBhatia/ai-detection-engineering-assistant](https://github.com/InsiyahBhatia/ai-detection-engineering-assistant)
## 界面与工作流演示
### 分析师检测请求表单

### 端到端自主 n8n 工作流执行

### 自动化 GitHub 分类与仓库结构化

### 生成的 JSON 检测包

### 生成的 Markdown 检测报告

## 核心功能
- **自然语言输入**:提交高级检测意图(例如:*"检测勒索软件攻击,其中 vssadmin.exe 删除卷影副本以阻止系统恢复"*)。
- **双代理 AI 架构**:
- **AI 检测工程师**:使用 Google Gemini 生成全面的多格式检测查询和 MITRE ATT&CK 映射。
- **检测 QA 审核员**:在将规则提升至“生产就绪”(Production Ready)状态之前,执行自动化同行评审、误报风险评估和查询优化。
- **多 SIEM 检测覆盖**:自动生成:
- **Sigma 规则**(YAML 格式)
- **Splunk SPL**
- **Microsoft Sentinel KQL**
- **Elastic Security (ES-QL / Lucene)**
- **自动化 GitOps 与 MITRE 对齐**:自动创建按 MITRE ATT&CK 战术(Tactic)和技术(Technique)结构化的仓库目录:
`detections///detection-report.json` 和 `detection-report.md`
- **实时 SOC 调度**:评估检测严重性,并向指定的 Slack 频道发送格式化警报,其中包含指向已提交 GitHub 产物的直接链接。
- **自定义 CyberOps 战术 UI**:专为 SOC 操作设计开发的自定义样式 n8n Form Trigger 界面。
## 系统架构
```
flowchart TD
A["Analyst Input Form
/form/detection-generator"] -->|Use Case Description| B["AI Detection Engineer
Gemini 2.5 Flash"] B -->|Draft Rules & MITRE Mapping| C["Detection QA Reviewer
Gemini 2.5 Flash"] C -->|Validated JSON Schema| D["Validate Detection & Parse"] D --> E["Generate Markdown Report"] D --> F["Generate JSON Report"] E & F --> G["Assemble Repository Files"] G --> H["GitHub Commit (Markdown)
detections/tactic/technique/"] G --> I["GitHub Commit (JSON)
detections/tactic/technique/"] H & I --> J{"Severity Check"} J -->|Critical / High| K["Slack Alert (High Priority)"] J -->|Medium / Low| L["Slack Alert (Standard)"] style A fill:#090d16,stroke:#10b981,color:#fff style B fill:#090d16,stroke:#6366f1,color:#fff style C fill:#090d16,stroke:#a855f7,color:#fff style H fill:#090d16,stroke:#3b82f6,color:#fff style I fill:#090d16,stroke:#3b82f6,color:#fff style K fill:#090d16,stroke:#ef4444,color:#fff style L fill:#090d16,stroke:#10b981,color:#fff ``` ## 仓库结构 ``` AI-Detection-engineering/ ├── README.md # Project documentation and architecture setup ├── workflow/ │ └── AI Detection Engineering Assistant (1).json # Complete n8n Workflow JSON export ├── detections/ # Local sample copy of generated detection packages │ └── impact/ # MITRE ATT&CK Tactic │ └── T1490/ # MITRE ATT&CK Technique ID │ ├── detection-report.json # Machine-readable rule package │ └── detection-report.md # Human-readable Markdown package ├── examples/ # Test scenarios and payload samples │ └── sample-use-cases.json ├── screenshots/ # Embedded UI and workflow execution screenshots └── docs/ └── custom-form-styles.css # Tactical Dark Theme CSS for n8n Form Trigger ``` ## 设置与部署 ### 1. 前置条件 - **n8n 实例**(v1.0+),在本地或通过云端部署 - **Google Gemini API Key** - **GitHub Personal Access Token**(具有 `repo` 写入权限) - **Slack Incoming Webhook URL**(可选,用于警报) ### 2. 导入工作流 1. 访问您的 n8n 界面(`http://localhost:5678`)。 2. 导航至 **Workflows** > **Import from File**。 3. 选择 `workflow/AI Detection Engineering Assistant (1).json`。 ### 3. 配置凭证 1. **Google Gemini API**:在 `Google Gemini Model` 节点中配置 API Key。 2. **GitHub API**:将您的 GitHub 凭证链接到 `GitHub Upload` 节点,并指定您的检测输出仓库(`ai-detection-engineering-assistant`)。 3. **Slack API**:在 `Slack Notification` 节点中分配您的 Webhook 或 OAuth 凭证。 ## 示例检测包 系统为 **MITRE T1490(抑制系统恢复)** 生成的示例生产包可在仓库中找到: - [JSON 检测包](file:///d:/AI-Detection-engineering/detections/impact/T1490/detection-report.json) - [Markdown 检测包](file:///d:/AI-Detection-engineering/detections/impact/T1490/detection-report.md)
/form/detection-generator"] -->|Use Case Description| B["AI Detection Engineer
Gemini 2.5 Flash"] B -->|Draft Rules & MITRE Mapping| C["Detection QA Reviewer
Gemini 2.5 Flash"] C -->|Validated JSON Schema| D["Validate Detection & Parse"] D --> E["Generate Markdown Report"] D --> F["Generate JSON Report"] E & F --> G["Assemble Repository Files"] G --> H["GitHub Commit (Markdown)
detections/tactic/technique/"] G --> I["GitHub Commit (JSON)
detections/tactic/technique/"] H & I --> J{"Severity Check"} J -->|Critical / High| K["Slack Alert (High Priority)"] J -->|Medium / Low| L["Slack Alert (Standard)"] style A fill:#090d16,stroke:#10b981,color:#fff style B fill:#090d16,stroke:#6366f1,color:#fff style C fill:#090d16,stroke:#a855f7,color:#fff style H fill:#090d16,stroke:#3b82f6,color:#fff style I fill:#090d16,stroke:#3b82f6,color:#fff style K fill:#090d16,stroke:#ef4444,color:#fff style L fill:#090d16,stroke:#10b981,color:#fff ``` ## 仓库结构 ``` AI-Detection-engineering/ ├── README.md # Project documentation and architecture setup ├── workflow/ │ └── AI Detection Engineering Assistant (1).json # Complete n8n Workflow JSON export ├── detections/ # Local sample copy of generated detection packages │ └── impact/ # MITRE ATT&CK Tactic │ └── T1490/ # MITRE ATT&CK Technique ID │ ├── detection-report.json # Machine-readable rule package │ └── detection-report.md # Human-readable Markdown package ├── examples/ # Test scenarios and payload samples │ └── sample-use-cases.json ├── screenshots/ # Embedded UI and workflow execution screenshots └── docs/ └── custom-form-styles.css # Tactical Dark Theme CSS for n8n Form Trigger ``` ## 设置与部署 ### 1. 前置条件 - **n8n 实例**(v1.0+),在本地或通过云端部署 - **Google Gemini API Key** - **GitHub Personal Access Token**(具有 `repo` 写入权限) - **Slack Incoming Webhook URL**(可选,用于警报) ### 2. 导入工作流 1. 访问您的 n8n 界面(`http://localhost:5678`)。 2. 导航至 **Workflows** > **Import from File**。 3. 选择 `workflow/AI Detection Engineering Assistant (1).json`。 ### 3. 配置凭证 1. **Google Gemini API**:在 `Google Gemini Model` 节点中配置 API Key。 2. **GitHub API**:将您的 GitHub 凭证链接到 `GitHub Upload` 节点,并指定您的检测输出仓库(`ai-detection-engineering-assistant`)。 3. **Slack API**:在 `Slack Notification` 节点中分配您的 Webhook 或 OAuth 凭证。 ## 示例检测包 系统为 **MITRE T1490(抑制系统恢复)** 生成的示例生产包可在仓库中找到: - [JSON 检测包](file:///d:/AI-Detection-engineering/detections/impact/T1490/detection-report.json) - [Markdown 检测包](file:///d:/AI-Detection-engineering/detections/impact/T1490/detection-report.md)
标签:AI代理, AMSI绕过, GitOps, n8n, SIEM规则, 威胁检测, 安全运营, 扫描框架, 知识库安全