AI4IA-MCP-Server

AI4IA-MCP-Server

Bridges AI assistants with Wazuh SIEM infrastructure, providing natural language access to security alerts, vulnerability analysis, CVE databases, and network documentation for security operations.

Category
访问服务器

README

AI4IA-MCP-Server

A Model Context Protocol Server for Role-Based Learning in AI-Assisted Cybersecurity Incident Analysis with Wazuh SIEM and OpenSearch

🔍 Overview

AI4IA-MCP is an intelligent Model Context Protocol (MCP) server that bridges AI assistants with Wazuh SIEM infrastructure. It provides natural language access to security alerts, vulnerability analysis, CVE databases, and network documentation through a comprehensive set of tools designed for security operations teams.

This server enables LLM assistants like Claude to perform complex security operations tasks including alert correlation, statistical analysis, vulnerability assessment, and incident investigation through conversational interfaces.

🏗️ Architecture

┌─────────────────┐
│   AI Assistant  │
│    (Claude)     │
└────────┬────────┘
         │ MCP Protocol
         │
┌────────▼────────┐
│  Wazuh AI4IA    │
│   MCP Server    │
│   (FastMCP)     │
└────────┬────────┘
         │
         ├──────────────┐
         │              │
┌────────▼────────┐ ┌──▼─────────┐
│   OpenSearch    │ │  Local     │
│    Cluster      │ │  Files     │
│  (Wazuh Data)   │ │  (CVE/PDF) │
└─────────────────┘ └────────────┘

✨ Key Features

🎯 Core Capabilities

  • Real-time Alert Management: Query and filter Wazuh security alerts with flexible time ranges
  • Intelligent Alert Correlation: Automatically discover related security events based on temporal proximity, agents, MITRE techniques, and rule patterns
  • Vulnerability Analysis: Deep-dive into CVE vulnerabilities with CVSS scoring, categorization, and mitigation recommendations
  • Statistical Insights: Generate comprehensive reports on alert patterns, severity distributions, and system performance
  • Agent Monitoring: Track status and health of all Wazuh agents in your infrastructure
  • CVE Database: Search and filter from extensive CVE datasets by severity, year, and vulnerability type
  • Network Documentation: Parse and analyze network diagrams and PDF documentation

🛡️ Security Operations Use Cases

  • Incident Response: Quickly correlate alerts to identify attack campaigns
  • Threat Hunting: Search for specific patterns across historical security data
  • Vulnerability Management: Prioritize patching based on detected vulnerabilities
  • Compliance Reporting: Generate statistics for audit and compliance requirements
  • Performance Monitoring: Track Wazuh system health and event processing metrics

🚀 Installation

1. Install Dependencies

pip install -r requirements.txt

3. Configure Environment Variables

Create a .env file in the project root:

OPENSEARCH_HOST=localhost:9200
OPENSEARCH_USER=admin
OPENSEARCH_PASSWORD=your_secure_password_here

4. Prepare Data Files

Place the following files in the project directory:

  • cve_data.csv - CVE vulnerability database
  • GOAD.pdf - Network documentation (optional)
  • NetDiagram.png - Network diagram (optional)

🔧 Configuration

OpenSearch Connection

The server connects to OpenSearch using the following indices:

  • wazuh-alerts-* - Security alerts
  • wazuh-monitoring-* - Agent monitoring data
  • wazuh-statistics-* - System performance metrics
  • wazuh-states-vulnerabilities-* - Vulnerability states

CVE Database Format

The cve_data.csv should contain the following columns:

  • vulnerability.id - CVE identifier (e.g., CVE-2024-12345)
  • vulnerability.severity - Severity level (low, medium, high, critical)
  • vulnerability.description - Detailed vulnerability description

📖 Available Tools

1. get_alerts

Retrieve Wazuh security alerts with flexible filtering.

# Example usage
get_alerts(
    time_range="2h",      # Last 2 hours
    rule_level=10,        # Critical alerts only
    agent_name="server-01",
    size=100
)

Parameters:

  • time_range: Time window (e.g., "2h", "90m", "30m") - max 6 hours
  • rule_level: Filter by severity level (1-15)
  • agent_name: Filter by specific agent
  • size: Number of results to return (default: 100)

2. correlate_alerts

Find related alerts that may indicate a coordinated attack.

# Example usage
correlate_alerts(
    alert_id="ABC123...",
    time_window="1h",
    max_alerts=50
)

Features:

  • Temporal correlation
  • Same agent detection
  • Related rule groups
  • Common MITRE ATT&CK techniques
  • Correlation factor scoring

3. get_alert_statistics

Generate comprehensive statistical reports on alert patterns.

# Example usage
get_alert_statistics(
    time_range="6h",
    agent_name="web-server",
    group="web"
)

Provides:

  • Alert frequency over time
  • Severity distribution
  • Top alert types
  • Most active agents
  • MITRE technique frequency
  • Rule group analysis

4. analyze_vulnerability

Deep analysis of detected vulnerabilities with CVE details.

# Example usage
analyze_vulnerability(
    vulnerability_id="CVE-2024-21417",
    start_time="now-12h",
    limit=50
)

Includes:

  • CVE details and descriptions
  • CVSS scores and severity
  • Detection timestamps
  • Affected agents
  • Category classification
  • Mitigation suggestions

5. filter_network_cves

Search the CVE database with multiple filter criteria.

# Example usage
filter_network_cves(
    severity="critical",
    year="2024",
    type="SQL Injection",
    limit=100
)

6. get_agent_status

Monitor the health and status of all Wazuh agents.

# Example usage
get_agent_status()

Returns:

  • Agent name and ID
  • IP address
  • Connection status
  • Last keep-alive timestamp
  • Wazuh version

7. get_statistics

Retrieve Wazuh system performance metrics.

# Example usage
get_statistics(timeframe="3h")

Metrics:

  • Events received/processed/dropped
  • Events per second (EDPS)
  • Queue usage percentages
  • Processing efficiency
  • System health indicators

8. read_network_documentation

Extract text from PDF network documentation.

# Example usage
read_network_documentation(pdf_filename="GOAD.pdf")

9. process_network_diagram

Analyze network topology diagrams.

# Example usage
process_network_diagram(
    png_filename="NetDiagram.png",
    analysis_type="detailed"
)

⚠️ Important Limitations

Time Range Restrictions

Different tools have specific time range limitations for optimal performance:

  • get_alerts: Maximum 6 hours
  • correlate_alerts: Maximum 6 hours
  • get_alert_statistics: Maximum 6 hours
  • get_statistics: Maximum 6 hours
  • analyze_vulnerability: Maximum 12 hours

These limits prevent rate limiting and ensure responsive query performance.

💡 Usage Examples

Example 1: Investigating a Security Incident

User: "Show me all critical alerts from the last 2 hours"
AI: [Uses get_alerts with rule_level=12+, time_range="2h"]

User: "What vulnerabilities were detected on affected systems?"
AI: [Uses analyze_vulnerability with affected agents]

Example 2: Vulnerability Management

User: "Find all critical CVEs from 2024"
AI: [Uses filter_network_cves with severity="critical", year="2024"]

User: "Which systems are affected by CVE-2024-12345?"
AI: [Uses analyze_vulnerability with vulnerability_id]

Example 3: Performance Monitoring

User: "How is the Wazuh system performing?"
AI: [Uses get_statistics for system metrics]

User: "Show alert trends over the last 6 hours"
AI: [Uses get_alert_statistics for trend analysis]

Common Errors

"No alerts found": Check time range and filter criteria
"CVE database not found": Ensure cve_data.csv is in the project directory
"Time range exceeds limit": Reduce time range to specified maximum
"Connection refused": Verify OpenSearch is running and accessible

🚀 Quick Start with Claude Desktop

Configuration

  1. Locate your config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. Add the server configuration:

{
    "mcpServers": {
        "AI4IA": {
            "command": "python",
            "args": ["/absolute/path/to/AI4IA-MCP/mcp_server.py"]
        }
    }
}

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选