jguimera
服务介绍
Security Copilot 和 Sentinel MCP 服务器
这是一个基于 Python 的 MCP 服务器,使用 FastMCP 库,并通过 Azure Identity 认证提供与 Microsoft Security Copilot 和 Microsoft Sentinel 的集成。

概述
该项目实现了一个 MCP 服务器,能够:
- 对 Microsoft Sentinel 运行 KQL 查询
- 上传/更新 Microsoft Security Copilot 技能集/插件
- 在 Microsoft Security Copilot 中运行提示和技能
该服务器作为开发环境与 Microsoft Security Copilot 之间的桥梁,支持技能和插件的测试、部署和执行。它使用 SSE 作为 MCP 服务器的传输层。
当前集成有许多用例。其中一个最有趣的用途是支持 Security Copilot KQL 技能的开发、测试和部署。


功能
- Sentinel 集成:对您的 Sentinel 工作区执行 KQL 查询
- Security Copilot 管理:
- 列出现有的技能集/插件
- 上传新的或更新现有的技能集/插件
- 在 Security Copilot 内运行提示或技能
- 认证支持:包括交互式浏览器、客户端密钥和托管身份在内的多种认证方法
路线图
接下来的功能将包括:
- Promptbook 测试和更新
- 在 Defender XDR 中运行高级搜索查询
前提条件
- Python 3.8+
- Microsoft Sentinel 工作区
- Microsoft Security Copilot 访问权限
- 适用于 Sentinel 和 Security Copilot 的适当 Azure 权限
安装
-
克隆仓库:
git clone https://github.com/jguimera/SecurityCopilotMCPServer.git
cd SecurityCopilotMCPServer -
安装依赖项:
pip install -r requirements.txt
-
创建一个
.env文件并配置如下:添加应用程序注册以使用 ClientID 和 Secret 认证
#AZURE_TENANT_ID=your_tenant_id
#AZURE_CLIENT_ID=your_client_id
#AZURE_CLIENT_SECRET=your_client_secret
SENTINEL_SUBSCRIPTION_ID=your_subscription_id
SENTINEL_RESOURCE_GROUP=your_resource_group
SENTINEL_WORKSPACE_NAME=your_workspace_name
SENTINEL_WORKSPACE_ID=your_workspace_id认证选项:interactive, client_secret
AUTHENTICATION_TYPE=interactive
使用
启动服务器
运行 MCP 服务器:
python server.py
在启动服务器前运行测试:
python server.py --run-tests
可用工具
MCP 服务器提供了以下工具:
- run_sentinel_query:在 Sentinel 中执行 KQL 查询
- get_skillsets:列出 Security Copilot 中的技能集
- upload_plugin:上传或更新技能集/插件
- run_prompt:在 Security Copilot 中运行提示或技能
Cursor 的 MCP 客户端配置
您可以从您选择的客户端使用此 MCP 服务器。在这个仓库中,您可以找到有关 Cursor 的说明和配置文件。
在您的客户端项目中添加 .cursor 文件夹以启用 MCP 工具。
该文件夹包含两个文件:
- Cursor 项目规则 (securitycopilotdev.mdc):此文件包含一些自定义 Cursor 规则,以帮助代理在过程定义和理解用户提示时提供帮助。
- MCP 客户端配置 (mcp.json):连接 Cursor 到 MCP 服务器的文件。
您可以直接使用 /tool_name 参数1="工具参数值" 来调用工具。
例如:/run_prompt content="列出最近的风险用户"
更多信息:https://docs.cursor.com/context/model-context-protocol#configuring-mcp-servers
贡献
欢迎贡献!请随时提交 Pull Request。
- 分叉仓库
- 创建您的功能分支 (
git checkout -b feature/amazing-feature) - 提交更改 (
git commit -m "Add some amazing feature") - 推送到分支 (
git push origin feature/amazing-feature) - 打开 Pull Request