solomonneas/rapid7-mcp
GitHub: solomonneas/rapid7-mcp
为 AI 助手提供 Rapid7 InsightIDR SIEM 平台访问能力的 MCP 服务器,支持日志搜索、告警管理、调查追踪、用户行为分析和威胁情报管理。
Stars: 0 | Forks: 0
# Rapid7 InsightIDR MCP 服务器
[](https://www.typescriptlang.org/)
[](https://nodejs.org/)
[](https://modelcontextprotocol.io)
[](https://www.rapid7.com/products/insightidr/)
[](LICENSE)
一个 [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server,为 AI assistant 提供访问 [Rapid7 InsightIDR](https://www.rapid7.com/products/insightidr/) 的能力,这是一个用于现代检测和响应的云原生 SIEM。支持查询调查、使用 LEQL 搜索日志、分析告警、追踪资产、监控用户行为以及管理威胁情报。
## 功能特性
### Investigations(调查)
- 按状态、优先级、负责人、日期范围搜索和筛选调查
- 创建、更新和管理调查生命周期
- 添加评论并检索关联的告警
- 构建调查时间线
### Log Search (LEQL)(日志搜索)
- 跨日志集执行 LEQL (Log Entry Query Language) 查询
- 列出可用的日志集(Firewall、DNS、DHCP、Endpoint、Cloud、Active Directory)
- 检索单个日志条目和聚合统计信息
- LEQL 语法参考和示例
### Alerts(告警)
- 按严重程度、类型、状态、日期列出和筛选告警
- 获取包含证据和指标的完整告警详情
- 更新告警状态(open、investigating、closed)
- 提取证据用于调查
### Assets(资产)
- 按主机名、IP、操作系统、agent 状态搜索 endpoint
- 完整资产详情:软件清单、漏洞、agent 信息
- 近期活动:登录、进程、网络连接
### User Behavior Analytics (UBA)(用户行为分析)
- 在组织范围内搜索用户账户
- 活动分析:登录模式、位置、访问的资产
- 识别具有行为评分的风险用户
- 异常检测和告警关联
### Threat Intelligence(威胁情报)
- IOC 管理:IP、domain、file hash
- 向威胁库添加指标
- 在日志中搜索威胁指标匹配
### Saved Queries(保存的查询)
- 列出和管理保存的 LEQL 查询
- 创建带有描述的可复用查询
- LEQL 语法助手及示例
## 架构
```
┌────────────────────────────────────────┐
│ MCP Client (LLM) │
└──────────────┬─────────────────────────┘
│ MCP Protocol (stdio)
┌──────────────▼─────────────────────────┐
│ rapid7-mcp server │
│ │
│ ┌──────────┐ ┌────────────────────┐ │
│ │ Prompts │ │ Resources │ │
│ │ 4 guides │ │ templates, LEQL, │ │
│ │ │ │ detection rules │ │
│ └──────────┘ └────────────────────┘ │
│ │
│ ┌──────────────────────────────────┐ │
│ │ Tools │ │
│ │ investigations │ logs │ alerts │ │
│ │ assets │ users │ threats│queries │ │
│ └──────────────┬───────────────────┘ │
│ │ │
│ ┌──────────────▼───────────────────┐ │
│ │ InsightIDR REST Client │ │
│ │ (client.ts + config.ts) │ │
│ └──────────────┬───────────────────┘ │
└──────────────────┼─────────────────────┘
│ HTTPS
┌──────────────────▼─────────────────────┐
│ Rapid7 InsightIDR Platform API │
│ https://.api.insight.rapid7│
└────────────────────────────────────────┘
```
## 安装
```
git clone https://github.com/solomonneas/rapid7-mcp.git
cd rapid7-mcp
npm install
npm run build
```
## 配置
设置环境变量:
```
export RAPID7_API_KEY="your-api-key"
export RAPID7_REGION="us" # us, eu, ca, au, ap
export RAPID7_ORG_ID="your-org-id" # optional
```
或者使用 `.env` 文件:
```
RAPID7_API_KEY=your-api-key
RAPID7_REGION=us
RAPID7_ORG_ID=your-org-id
```
## MCP Client 配置
### Claude Desktop
```
{
"mcpServers": {
"rapid7": {
"command": "node",
"args": ["path/to/rapid7-mcp/dist/index.js"],
"env": {
"RAPID7_API_KEY": "your-api-key",
"RAPID7_REGION": "us"
}
}
}
}
```
### OpenClaw
添加到你的 `openclaw.json`:
```
{
"mcp": {
"servers": {
"rapid7": {
"type": "stdio",
"command": "node",
"args": ["/path/to/rapid7-mcp/dist/index.js"],
"env": {
"RAPID7_API_KEY": "your-api-key",
"RAPID7_REGION": "us"
}
}
}
}
}
```
## 工具参考
| Tool | Description |
|------|-------------|
| `search_investigations` | 按状态、优先级、负责人列出/筛选调查 |
| `get_investigation` | 获取包含时间线的完整调查详情 |
| `create_investigation` | 创建新调查 |
| `update_investigation` | 更新状态、负责人、处置结果 |
| `add_investigation_comment` | 向调查添加评论/备注 |
| `get_investigation_alerts` | 获取关联到调查的告警 |
| `search_logs` | 对日志集执行 LEQL 查询 |
| `list_log_sets` | 列出可用的日志集 |
| `get_log_entry` | 根据 ID 获取特定日志条目 |
| `get_log_stats` | 获取时间范围内的聚合统计信息 |
| `list_alerts` | 获取带有严重程度/类型/状态筛选器的告警 |
| `get_alert` | 包含证据的完整告警详情 |
| `update_alert_status` | 更新告警状态 |
| `get_alert_evidence` | 从告警获取证据/指标 |
| `search_assets` | 按主机名、IP、OS 搜索 endpoint |
| `get_asset` | 包含软件/漏洞的完整资产详情 |
| `get_asset_activity` | 资产的近期活动 |
| `search_users` | 搜索用户账户 |
| `get_user_activity` | 用户行为分析 |
| `get_risky_users` | 具有异常行为评分的用户 |
| `list_threat_indicators` | 列出威胁库中的 IOC |
| `add_threat_indicator` | 添加新 IOC |
| `search_threat_activity` | 在日志中搜索 IOC 匹配 |
| `list_saved_queries` | 列出保存的 LEQL 查询 |
| `create_saved_query` | 保存 LEQL 查询以供复用 |
| `leql_help` | LEQL 语法参考和示例 |
## LEQL 查询示例
```
-- Find all blocked traffic from a source
where(source_address = 10.0.0.1 AND action = BLOCK)
-- Top talkers by connection count
groupby(source_address) calculate(count) sort(desc)
-- Failed logins for a specific user
where(user = "admin" AND result = FAILED_LOGIN)
-- HTTP errors by URL
where(status >= 400) groupby(url) calculate(count)
-- DNS queries to suspicious domains
where(query CONTAINS "malware") groupby(query) calculate(count)
-- Outbound connections on non-standard ports
where(destination_port != 80 AND destination_port != 443 AND direction = OUTBOUND)
```
## Prompts(提示词)
| Prompt | Description |
|--------|-------------|
| `investigate-alert` | 引导式告警调查工作流 |
| `hunt-ioc` | 跨所有日志源搜索 IOC |
| `user-behavior-review` | 分析用户活动以发现异常 |
| `incident-timeline` | 构建按时间顺序的事件时间线 |
## Resources(资源)
| URI | Description |
|-----|-------------|
| `rapid7://investigation-templates` | 常用调查模板 |
| `rapid7://leql-reference` | LEQL 语法和示例 |
| `rapid7://detection-rules` | 内置检测规则目录 |
## 开发
```
npm run build # Compile TypeScript
npm run dev # Watch mode
npm run test # Run tests
npm run lint # Lint check
```
## 许可证
MIT
标签:AI 安全, FTP漏洞扫描, GNU通用公共许可证, LEQL, LLM 工具集成, MCP Server, MITM代理, Node.js, Rapid7 InsightIDR, Shodan, TypeScript, UBA, 信息收集自动化, 占用监测, 威胁情报, 安全信息和事件管理, 安全插件, 安全编排, 开发者工具, 日志搜索, 模型上下文协议, 用户行为分析, 端点检测, 自动化攻击, 资产管理