SecurityCopilotMCPServer

SecurityCopilotMCPServer

🚀 安全 Copilot 和 Sentinel MCP 服务器

这是一个基于 Python 的 MCP 服务器,借助 FastMCP 库实现与 Microsoft Security Copilot 和 Microsoft Sentinel 的集成,同时支持通过 Azure Identity 进行身份验证,为安全开发提供有力支持。

🚀 快速开始

此项目实现的 MCP 服务器具备强大功能,可在 Microsoft Sentinel 上执行 KQL 查询、上传/更新 Microsoft Security Copilot 技能集/插件,还能执行 Microsoft Security Copilot 中的提示和技能。它就像一座桥梁,连接开发环境与 Microsoft Security Copilot,支持技能和插件的测试、部署与执行,采用 SSE 作为传输层。

✨ 主要特性

  • Sentinel 集成:可在 Sentinel 工作区执行 KQL 查询。
  • Security Copilot 管理
    • 列出现有的技能集/插件。
    • 上传新的或更新现有技能集/插件。
    • 执行安全 Copilot 中的提示或技能。
  • 身份验证支持:提供多种身份验证方法,涵盖交互式浏览器、客户机密钥和托管标识。

📦 安装指南

环境准备

  • Python 3.8+
  • Microsoft Sentinel 工作区
  • Microsoft Security Copilot 访问权限
  • 对 Sentinel 和 Security Copilot 的适当 Azure 权限

安装步骤

  1. 克隆仓库:
    git clone https://github.com/jguimera/SecurityCopilotMCPServer.git
    cd SecurityCopilotMCPServer
    
  2. 安装依赖项:
    pip install -r requirements.txt
    
  3. 创建 .env 文件,配置如下:
    # 添加应用注册以使用客户端 ID 和密钥进行身份验证
    # 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 服务器提供了丰富的工具:

  1. run_sentinel_query:在 Sentinel 中执行 KQL 查询。
  2. get_skillsets:列出安全 Copilot 中的技能集。
  3. upload_plugin:上传或更新一个技能集/插件。
  4. run_prompt:在安全 Copilot 中运行提示或技能。

Cursor 的 MCP 客户端配置

你可以从所选客户端使用此 MCP 服务器。在本仓库中,能找到用于 Cursor 的说明和配置文件。在客户端项目中添加 .cursor 文件夹以启用 MCP 工具,该文件夹包含两个文件:

  1. Cursor 项目规则(securitycopilotdev.mdc):包含一些自定义的 Cursor 规则,助力代理理解用户提示的过程。
  2. MCP 客户端配置(mcp.json):用于连接到 MCP 服务器的文件。

你可以使用 /tool_name 参数1="Value of the tool parameter" 直接调用工具,例如:

/run_prompt content="列出最近风险较高的用户"

更多详细信息请参考:https://docs.cursor.com/context/model-context-protocol#配置-MCP-服务器

📚 详细文档

路线图

接下来将实现的功能包括:

  • Promptbook 测试和更新
  • 在 Defender XDR 中运行高级狩猎查询

📄 许可证

该项目受 LICENSE 许可保护。

🌟 贡献

欢迎大家贡献代码!请随意提交 Pull Request。

  • 0 关注
  • 0 收藏,34 浏览
  • system 提出于 2025-09-30 01:24

相似服务问题

相关AI产品