mcpField
S
Security Infrastructure Mcp Servers

Security Infrastructure Mcp Servers

本地服务
github.com/jmstar85开发工具2268 周前更新

关于 Security Infrastructure Mcp Servers

Security Infrastructure MCP Servers 是一组面向安全平台的 MCP 服务实现,覆盖 Splunk SIEM、CrowdStrike EDR 和 MISP 威胁情报。项目强调输入校验、注入防护和凭据管理,适合需要通过 AI 助手查询安全数据的团队。

主要功能

  1. 01Splunk SPL 查询执行与事件搜索
  2. 02CrowdStrike 检测记录查询(FQL)
  3. 03MISP 事件与 IOC 属性搜索
  4. 04SPL、FQL 与 XSS 注入防护
  5. 05OAuth 2.0 与 TLS 证书校验

适用场景

  1. 01通过自然语言检索 Splunk 中的失败登录事件
  2. 02按严重级别筛选 CrowdStrike 检测结果
  3. 03在 MISP 中查询 IP 类 IOC

MCP 相关

该项目提供多个 MCP 服务,每个服务向 MCP 客户端暴露对应安全平台的搜索类工具,例如 search-events、search-detections 和 search-attributes。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

安全基础设施 MCP 服务

面向安全平台集成的 安全 MCP(Model Context Protocol)服务实现综合集合,具备企业级安全加固。

🛡️ 安全优先设计

本项目已进行全面的安全加固,以修复严重漏洞并落实安全最佳实践:

✅ 安全改进(最新更新)
  • 🔴 高危修复:
    • 通过查询清理和危险命令拦截,防止 SPL 注入
    • 使用 defusedxml 进行安全 XML 解析,防止 XXE 攻击
    • 从所有配置文件中彻底移除硬编码凭据
  • 🟡 中危修复:
    • 所有 API 通信均强制使用 TLS 1.2+ 和强加密套件
    • 对所有服务进行全面的输入验证和清理
    • 防止命令执行风险和注入攻击
    • 清理错误消息,防止信息泄露
  • 🔵 其他安全功能:
    • 通过模式匹配防止 FQL/SPL 注入攻击
    • 强制进行 SSL 证书验证
    • 清理 API 响应数据
    • 提供带安全占位符的安全配置模板
    • 提供全面的 .gitignore,防止凭据泄露
🔒 安全文档

请参阅 SECURITY.md,了解完整的安全指南、配置最佳实践和漏洞报告流程。

🔐 支持的平台

Splunk SIEM
  • 安全 SPL 查询执行:执行搜索处理语言查询,并防止注入
  • 事件搜索:通过清理后的筛选条件,搜索所有索引中的安全事件
  • 基于时间的分析:验证时间范围和自定义时间窗口
  • 异步作业管理:创建和监控搜索作业,并安全地获取结果
  • JSON 结果格式:提供结构化输出,并筛除敏感数据
CrowdStrike EDR
  • 安全检测搜索:使用经过验证的 FQL(Falcon Query Language)查询检测结果
  • 检测详情:获取经过清理的检测摘要和元数据
  • OAuth 2.0 身份验证:通过妥善的令牌管理安全访问 API
  • 输入验证:全面验证参数并实施白名单机制
  • 实时威胁数据:通过安全筛选访问最新的端点检测数据
Microsoft MISP
  • 事件搜索:通过清理和验证输入查询 MISP 事件
  • IOC 属性搜索:搜索指标,并防止 XSS 和注入攻击
  • 多格式支持:处理各种 IOC 类型,并验证内容
  • SSL 安全:强制验证证书,并提供安全警告
  • RESTful API 集成:安全支持 MISP REST API,并清理错误信息

🚀 快速开始

安装
# 1. Clone the repository
git clone https://github.com/jmstar85/SecurityInfrastructure.git
cd SecurityInfrastructure

# 2. Install secure dependencies
pip install -r requirements.txt

# 3. Configure credentials securely
cp .env.example .env
# Edit .env with your platform credentials (see security guidelines)

# 4. Add to Claude Desktop configuration
# Copy config-example.json content to your Claude Desktop config
# Location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
# Update paths and environment variables with your secure values
安全配置
# Verify configuration security
python -c "
import json
with open('.env', 'r') as f:
    content = f.read()
    if 'REPLACE_WITH_YOUR' in content:
        print('⚠️  Please update placeholder credentials in .env')
    else:
        print('✅ Configuration appears to be customized')
"

# Test server security
python src/splunk_server.py        # Runs on localhost:8080
python src/crowdstrike_server.py   # Runs on localhost:8081  
python src/misp_server.py          # Runs on localhost:8082

🔧 MCP 服务工具

Splunk SIEM 工具(已加固安全)
  • search-events:执行经过清理的 SPL 查询,并防止注入
    # Example: Secure search for failed login attempts
    query = "index=security sourcetype=auth action=failure"  # Automatically sanitized
    earliest_time = "-24h"  # Validated time format
    
CrowdStrike EDR 工具(已加固安全)
  • search-detections:通过 FQL 验证和白名单机制查询检测结果
    # Example: Secure search for high severity detections
    filter_query = "max_severity:'high'"  # Validated against injection patterns
    sort = "created_timestamp.desc"  # Whitelisted sort options only
    
MISP 工具(已加固安全)
  • search-events:通过清理输入查询威胁情报
  • search-attributes:搜索 IOC,并防止 XSS 和注入攻击
    # Example: Secure search for IP-based IOCs
    type = "ip-dst"  # Input sanitized and validated
    category = "Network activity"  # Content filtered for safety
    

📁 优化后的项目结构

SecurityInfrastructure/
├── src/                    # Secure MCP server implementations
│   ├── splunk_server.py    # Splunk SIEM integration (hardened)
│   ├── crowdstrike_server.py # CrowdStrike EDR integration (hardened)
│   └── misp_server.py      # Microsoft MISP integration (hardened)
├── config/                 # Secure configuration templates
│   ├── mcp-settings.json   # MCP client configuration (sanitized)
│   └── splunk.yaml         # Splunk configuration template
├── tests/                  # Security validation tests
├── SECURITY.md             # Security guidelines and best practices
├── config-example.json     # Safe configuration template
├── .env.example            # Environment variables template (secure)
├── .gitignore              # Comprehensive credential protection
├── requirements.txt        # Minimal secure dependencies
├── INSTALLATION.md         # Detailed setup guide
├── setup-guide.md          # Quick setup templates
└── docker-compose.yml      # Container configuration

**注意:**已移除前端组件、不必要的 Node.js 文件和开发产物,以缩小攻击面并优化安全态势。

🔧 安全的 MCP 客户端配置

Claude Desktop 设置(安全)

配置文件位置:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

安全配置模板:

{
  "mcpServers": {
    "security-infrastructure-splunk": {
      "command": "python",
      "args": ["/FULL/PATH/TO/SecurityInfrastructure/src/splunk_server.py"],
      "env": {
        "SPLUNK_HOST": "REPLACE_WITH_YOUR_SPLUNK_HOST",
        "SPLUNK_TOKEN": "REPLACE_WITH_YOUR_API_TOKEN",
        "SPLUNK_VERIFY_SSL": "true"
      }
    }
  }
}

**⚠️ 安全注意事项:**切勿将真实凭据提交到版本控制系统。请使用提供的模板,并将占位符替换为实际值。

💻 安全使用示例

在 Claude Desktop 中完成安全配置后,你可以使用自然语言与安全平台交互:

Splunk SIEM 查询(防注入)
"Search for failed SSH login attempts in the last 6 hours"
"Find all authentication events from IP 192.168.1.100"  
"Show me high priority security alerts from yesterday"
"Search for events in the security index containing 'malware'"
CrowdStrike EDR 查询(已验证)
"Show me all high severity detections from today"
"Find endpoint detections with behavior patterns"
"List recent detections sorted by creation time"
"Search for detections on specific hostnames"
MISP 威胁情报(已清理)
"Search for events related to specific threat actors"
"Find all IP address indicators of compromise"
"Look up domain indicators from the last week"
"Search for published threat intelligence events about phishing"

🛠️ 安全功能

核心安全实现
  • 输入验证:对所有用户输入进行全面的清理和验证
  • 注入防护:防范 SPL、FQL、SQL 和 XSS 注入攻击
  • 安全通信:强制使用 HTTPS/TLS 1.2+ 和强加密套件
  • 错误清理:使用通用错误消息,防止信息泄露
  • 身份验证安全:安全处理令牌/凭据并进行适当验证
安全架构
  • 多种身份验证方法:基于会话、基于令牌和 OAuth 2.0,并采用安全的默认设置
  • SSL/TLS 强制执行:所有连接都必须验证证书
  • API 安全:速率限制、超时强制执行和连接池限制
  • 配置安全:安全模板、凭据屏蔽和 .gitignore 保护
数据保护
  • 输出清理:从 API 响应中移除敏感字段
  • 凭据管理:不硬编码机密信息,保护环境变量
  • 日志安全:过滤日志和审计记录中的敏感数据
  • 会话管理:妥善处理令牌过期并安全存储

📋 要求

  • Python 3.11+
  • 用于安全平台的访问凭据(已正确配置)
  • 兼容 MCP 的客户端(推荐使用 Claude Desktop)
  • 用于生产部署的 SSL/TLS 证书

🔐 安全凭据管理

Splunk SIEM(安全设置)
  • API Token(强烈推荐),仅授予最低限度的必要权限
  • HTTPS endpoint 必须经过验证
  • 搜索权限仅限于必要的索引
CrowdStrike EDR(安全设置)
  • Client ID 和 Client Secret,遵循最小权限原则
  • API 权限:Detections(READ),限定范围
  • 验证 Base URL 并强制使用 HTTPS
Microsoft MISP(安全设置)
  • API Key,在可能的情况下采用只读权限
  • MISP instance URL,并验证 SSL 证书
  • 配置超时设置以确保安全

🧪 安全验证

本项目包含全面的安全验证:

# Run security validation tests
python -m pytest tests/ -v

# Validate configuration security
python -c "
import os
config_files = ['.env', 'config/mcp-settings.json']
for f in config_files:
    if os.path.exists(f):
        with open(f) as file:
            content = file.read()
            if 'REPLACE_WITH_YOUR' in content:
                print(f'⚠️  {f} contains placeholder credentials')
            else:
                print(f'✅ {f} appears configured')
"

📊 安全指标

  • 漏洞状态:所有 HIGH 和 MEDIUM 严重级别的问题均已解决
  • 安全覆盖率:83% 的安全验证测试已通过
  • 代码质量:全面的输入验证和错误处理
  • 攻击面:通过移除组件和优化将其最小化

🤝 贡献

  1. Fork 此代码库
  2. 创建功能分支(git checkout -b feature/security-enhancement)
  3. 遵循 SECURITY.md 中的安全指南
  4. 为新功能添加安全测试
  5. 提交时进行安全验证(git commit -am 'Add secure feature')
  6. 推送到分支(git push origin feature/security-enhancement)
  7. 创建 Pull Request,并附上安全审查清单

📄 许可证

本项目用于安全研究和教育,重点关注安全实施实践。

🔗 安全资源

🚨 安全问题报告

如果发现安全漏洞,请:

  1. 不要 创建公开问题
  2. 将安全详情通过电子邮件发送给维护者
  3. 在披露前给予合理的修复时间
  4. 遵循负责任的披露实践

⭐ 如果你觉得这个安全实现有用,请给它点个星!

最新安全更新: 2024 年 12 月 — 全面加固安全性、修复漏洞并进行优化。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。