Skip to main content
Glama
INFOKOM-KI

Wazuh MCP Server

by INFOKOM-KI

Blue Team MCP Server (Wazuh SIEM)

一个面向 Claude Desktop / 任何 MCP 客户端的防御性 MCP 服务器——它是进攻性工具的蓝队对应物。涵盖 Wazuh SIEM、多源威胁情报、MITRE 驱动的 3-Sum APT 关联、攻击图谱、LangGraph 调查工作流和主机取证。123 个工具 + 4 个资源。默认只读。

开发者: NAuliajati (csirt[at]tangerangkota[.]go[.]id)


架构

main.py -> mcp_server/  (package)
                 ├─ core/          HTTP client, redaction, audit, config, attack graph, IOC store
                 ├─ wazuh/         Indexer (OpenSearch) + Manager API (JWT auth)
                 ├─ correlation/   3-Sum engine (pure computation, MITRE-driven)
                 ├─ threat_intel/  CrowdSec, ThreatFox, OTX, URLhaus, GreyNoise + shared cache
                 ├─ agents/        LangGraph investigation + playbook workflows
                 └─ tools/         49 tool modules

每次工具调用都会流经 @blueteam_tool 装饰器中的单一管线——代码图中连接最多的三个节点:

audit (_audit_log) -> call -> redact (_redact_alert_data) -> truncate (_truncate_if_needed)

所有出站 HTTP 均通过每个连接池的熔断器(http_client.CircuitBreaker:连续 5 次失败 -> 打开,60 秒冷却,单次半开试探)。429 和 4xx 永不计为失败,因此单个上游发生故障时会快速失败,而不会在多个工具之间堆积重试。

传输方式

用途

stdio

本地子进程 / SSH 管道(默认)

streamable_http

远程 HTTP 服务(http://<host>:<port>/mcp)——在 127.0.0.1 之外需要 MCP_API_KEY(强制绑定保护)


Related MCP server: wrg-mcp-server

快速开始

git clone <repo> && cd Wazuh-MCP-Server
sudo bash setup.sh                    # deps, venv, wrapper at /opt/blue-team-mcp

# configure (edit /opt/blue-team-mcp/config.env)
export WAZUH_INDEXER_URL="https://<host>:9200"
export WAZUH_INDEXER_USER="admin"
export WAZUH_INDEXER_PASSWORD="<indexer-password>"
export WAZUH_API_URL="https://<host>:55000"      # optional — Manager API tools
export WAZUH_API_USER="wazuh-wui"
export WAZUH_API_PASSWORD="<api-password>"
export CROWDSEC_API_KEY="<key>"                  # optional — threat intel (free)
# inbound auth for the HTTP transport (REQUIRED when binding beyond 127.0.0.1)
export MCP_API_KEY="btm_<43-char-base64>"        # generate: python3 -c "import secrets; print('btm_' + secrets.token_urlsafe(32))"
export MCP_API_KEY_SCOPES="wazuh:read wazuh:write"   # optional — default wazuh:read (read-only)

# run (stdio)
mcp-server-blueteam

# or remote HTTP (MCP_API_KEY is mandatory here — the server refuses to bind otherwise)
MCP_TRANSPORT=streamable_http MCP_HOST=0.0.0.0 MCP_PORT=8001 \
  MCP_API_KEY="btm_<43-char-base64>" mcp-server-blueteam

Claude Desktop 配置(~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "blue-team-mcp": {
      "command": "ssh",
      "args": ["-i", "~/.ssh/id_ed25519", "user@DEFENDER_HOST", "mcp-server-blueteam"],
      "transport": "stdio"
    }
  }
}

配置

凭据来自环境变量,并在启动时验证。每个威胁情报密钥都是可选的——没有它们时,工具会优雅降级。

区域

变量

备注

Wazuh Indexer

WAZUH_INDEXER_URL / _USER / _PASSWORD

OpenSearch (9200) — 告警/事件数据

Wazuh Manager

WAZUH_API_URL / _USER / _PASSWORD

Manager API (55000) — 规则/代理/配置

TLS

WAZUH_INDEXER_VERIFY_SSL, WAZUH_API_VERIFY_SSL

默认 true

威胁情报

CROWDSEC_API_KEY, THREATFOX_API_KEY, OTX_API_KEY, URLHAUS_API_KEY, ABUSEIPDB_API_KEY, VIRUSTOTAL_API_KEY, NETRA_API_KEY, ARGUS_API_KEY, RAPIDAPI_KEY, HUDSONROCK_API_KEY

9 个提供商 + RapidAPI + HudsonRock;全部可选

脱敏

BLUETEAM_REDACTION_POLICY, BLUETEAM_OWNED_DOMAINS, BLUETEAM_REDACT_*

参见“安全与隐私”

取证门控

BLUETEAM_ALLOW_FORENSIC_BYPASS, BLUETEAM_FORENSIC_TOKEN

默认 false / 空

入站认证

MCP_API_KEY, MCP_API_KEY_SCOPES

用于 streamable_http 的预共享 API 密钥 + 作用域

入站加固

BLUETEAM_HTTP_RATE_LIMIT, BLUETEAM_ALLOWED_ORIGINS

按 IP 的滑动窗口速率限制(req/min,0=关闭)+ Origin 允许列表(环回始终允许)

审计与持久化

BLUETEAM_AUDIT_LOG, BLUETEAM_IOC_STORE, BLUETEAM_ATTACKER_REGISTRY, BLUETEAM_FALSE_POSITIVE_KB, BLUETEAM_CASE_STORE, BLUETEAM_CMDB_FILE

JSONL 审计跟踪 + 存储(可选)

门控

WAZUH_READ_ONLY, WAZUH_DISABLED_CATEGORIES, WAZUH_DISABLED_TOOLS

跳过破坏性工具 / 工具类别


功能

Wazuh SIEM

告警搜索(blueteam_wazuh_indexer_searchwazuh_alert_dsl_query)、零文档统计聚合、模式发现(blueteam_index_schema)、域名/邮箱/地理/syscheck/合规查询,以及 Manager API 工具(规则、解码器、组、代理、安全事件)。

3-Sum APT 关联

three_sum_correlation 运行两个引擎外加统一评分:

  • 引擎 A — MITRE 驱动的多 IoC 风险阈值判定。告警依据 rule.mitre.tactic(通过 MITRE_TACTIC_TO_CATEGORY)和 rule.mitre.id(通过 ATT&CK STIX bundle 解析)分类,按 rule.level × tactic weight 评分,并以 ≥2 类别链式攻击规则threshold_score 默认 35)作为门控。

  • 引擎 B — 3 源体量 Z-score(MAD + shoulder-check)标记同时出现的峰值。

  • 此外还有多分辨率(1h/24h/7d)、统一严重性评分,以及 Indexer 降级检测。

威胁情报

9 个提供商——CrowdSec、ThreatFox、OTX、URLhaus、GreyNoise、AbuseIPDB、VirusTotal、Netra、Argus——支持统一的 blueteam_threat_intel_aggregate(并发扇出)和加权的 blueteam_unified_threat_score。另有 stealer_log_check(HudsonRock)和 jarm_fingerprint(用于 C2/恶意软件归因的 TLS 指纹,无需 API 密钥),以及 3 个 RapidAPI 查询(blueteam_ip_blacklistblueteam_ioc_searchblueteam_breach_check)。

告警富化

blueteam_wazuh_alert_summarize, blueteam_beacon_detect, blueteam_attack_chain, blueteam_threat_card, blueteam_wazuh_alert_compare, blueteam_curated_threat_report.

调查、图谱与工作流

blueteam_investigate_ipblueteam_attack_graph(networkx 聚类 + PageRank)、blueteam_pivot_suggestblueteam_campaign_watchblueteam_stix_killchainblueteam_investigation_workflowblueteam_playbook_run(LangGraph),外加一个误报知识库(blueteam_false_positive_kb),用于在 3-Sum 中自动抑制已知高噪音 IOC。

主机与域名取证

WHOIS / CRT.sh、IOC 提取、JARM 指纹识别、域名仿冒检测(blueteam_domain_permute)、Webshell 扫描、服务端 JSONL 导出、DOCX/XLSX/PPTX 报告导出,以及 23 个主机取证工具(日志读取器、fail2ban、rootkit 扫描、lynis、进程/定时任务/用户)。


安全与隐私

入站认证 (streamable_http)

streamable_httpmcp_server/core/server_auth.py 中的预共享 API 密钥保护:

  • MCP_API_KEY —— 格式为 btm_<43-char-urlsafe-base64>(47 个字符)。仅以 SHA-256 摘要形式存储,并使用 hmac.compare_digest(常量时间)进行比较。

  • MCP_API_KEY_SCOPES —— 默认为 wazuh:read(只读)。添加 wazuh:write 可解锁 9 个写入工具(blueteam_fail2ban_unbanblueteam_case_*blueteam_set_owned_domainsblueteam_mark_investigatedblueteam_wazuh_exportblueteam_export_reportblueteam_capture_traffic)。默认拒绝:无作用域即只读。

  • 绑定保护main.py::_start_http_transport):在没有 MCP_API_KEY 的情况下绑定非回环地址会抛出 ConfigurationError 并拒绝启动。仅当未配置密钥时,回环地址才保持无认证;一旦设置了密钥,便会在每个请求上强制执行。

  • JSON 深度保护parse_json_body_safe):每个 POST 请求体上限为 1 MB(MAX_BODY_BYTES),且如果嵌套超过 100 层(MAX_JSON_DEPTH),会在运行 json.loads 之前拒绝——从而阻止深度嵌套 JSON-RPC 载荷导致的堆栈耗尽 DoS。

  • 入站速率限制器SlidingWindowRateLimiter):按客户端 IP 的滑动窗口上限(BLUETEAM_HTTP_RATE_LIMIT,请求/分钟,默认 0 = 禁用),超出后返回 429。它与 BLUETEAM_RATE_LIMIT 不同,后者以每分钟全局上限来控制破坏性工具(fail2ban 解封、tcpdump 抓包)。

  • Origin 校验_origin_allowed):Origin 头必须是回环来源,或位于 BLUETEAM_ALLOWED_ORIGINS(逗号分隔的精确来源)中,否则返回 403。可阻止基于浏览器的 DNS 重绑定 / localhost 数据外泄。没有 Origin 头的请求(非浏览器客户端)不受影响。该中间件始终安装——即使在没有认证的回环绑定上,速率限制 + Origin 校验也生效。

脱敏策略

三态策略(BLUETEAM_REDACTION_POLICY,默认 protect_victim):

策略

行为

full

基于形状的掩码,覆盖邮箱、私有 IP、所有域名、路径、用户代理——当 protect_victim 没有已拥有域名时的保守回退

protect_victim

仅掩码受害者拥有的指标(已拥有域名、私有 IP、身份信息);攻击者 IOC 保持可见。推荐用于 SOC 分流。

raw

仅执行第 1 层凭据剥离——由 BLUETEAM_ALLOW_FORENSIC_BYPASS=true + BLUETEAM_FORENSIC_TOKEN 硬性门控

第 1 层(凭据剥离)适用于所有状态,且永远不可绕过。攻击者 IOC 注册表(core/attacker_registry.py)将已确认的攻击者指标豁免于基于形状的掩码——但绝不会豁免于第 1 层。

在此策略之上,有两级去掩码:

  • 第 1 级 — reveal_owned=true — 仅向 LLM 显示已拥有的 *.tangerangkota.go.id 资产,并在聚合工具(包括 wazuh_alert_dsl_query)中取消已拥有域名的分桶键掩码。绝不会扩展到 BLUETEAM_OWNED_DOMAINS 之外。

  • 第 2 级 — bypass_redaction=true + forensic_token — 将原始数据写入磁盘;LLM 只接收文件路径,绝不接收原始内容。

BLUETEAM_OWNED_DOMAINS 设置为你组织的域名(逗号分隔,例如 tangerangkota.go.id)。使用 blueteam_owned_domains 查看;使用 blueteam_set_owned_domains 在运行时更新(由 BLUETEAM_ALLOW_RUNTIME_DOMAINS=true 门控,默认关闭)。


SOC 分析提示词(复制粘贴给你的 LLM)

一份可直接粘贴的提示词,适用于连接到本 MCP 服务器的本地 LLM。两种输出格式——Markdown(内联)和 DOCX(需要 officecliblueteam_export_report)。

⚠️ Calling convention & guardrails (read once — prevents "Field required" errors and false positives):
- Every tool takes a SINGLE ``params`` object. FastMCP double-nests it:
    tool_invoke(name="<tool>", params={"params": {"field": value, ...}})
  Call tool_inspect FIRST to read a tool's exact signature; never skip inspect on an unused tool.
- Default model = protect_victim: the LLM sees attacker public IPs/payloads/rule/severity/MITRE,
  never internal emails, subdomains, private IPs (RFC1918), or internal paths.
- A private/RFC1918 srcip (10.x, 172.16-31.x, 192.168.x) is INTERNAL, never an attacker — do not
  run threat-intel on it (those tools reject private IPs by design — SSRF guard).
- reveal_owned=true (Tier 1, LLM-safe): reveals only *.tangerangkota.go.id + @tangerangkota.go.id.
  Accepted by the alert/aggregation tools — wazuh_domain_lookup, wazuh_alert_focused_crawl,
  wazuh_email_lookup, wazuh_alert_dsl_query (unmasks owned-domain bucket keys), and others —
  never expands beyond BLUETEAM_OWNED_DOMAINS.
- bypass_redaction=true + forensic_token (Tier 2, HUMAN ONLY): writes raw data to disk via
  blueteam_wazuh_export; the LLM sees only the file path.
- ⚠️ NEVER pass redaction_policy="raw" OR bypass_redaction=true in a tool call — both are
  HUMAN-ONLY and gated behind the operator forensic token, which the LLM does NOT hold. The
  call fails with "requires the operator forensic token". For owned-domain visibility use
  reveal_owned=true (above, no token); full raw forensics is blueteam_wazuh_export run by the
  analyst on the server.
- redaction_policy="protect_victim" is accepted by 13 tools (blueteam_curated_threat_report,
  blueteam_threat_card, blueteam_wazuh_alert_summarize, blueteam_wazuh_alerts,
  blueteam_wazuh_geo_heatmap, blueteam_wazuh_indexer_search, three_sum_correlation,
  wazuh_alert_aggregate_analysis, wazuh_alert_focused_crawl, wazuh_alert_timeline,
  wazuh_attack_velocity, wazuh_domain_lookup, wazuh_email_lookup). blueteam_wazuh_export uses
  bypass_redaction (NOT redaction_policy). Other tools reject redaction_policy — drop it and retry.
  (Separately, wazuh_alert_dsl_query accepts reveal_owned=true but NOT redaction_policy.)
- blueteam_wazuh_export writes to BLUETEAM_EXPORT_DIR (default /var/log/blue-team-mcp/exports/)
  with an AUTO-GENERATED filename (export_<timestamp>.jsonl). It has NO ``path`` parameter —
  do not pass one (it will be rejected). Only blueteam_export_report accepts a ``path``.

LANGKAH 0  — Index schema (before any aggregation):
blueteam_index_schema(fields=["data.srcip","rule.id","rule.groups","agent.name",
  "data.domain","data.url","GeoLocation.city_name"], response_format="json")

LANGKAH 1  — Full overview + own-asset forensics:
blueteam_curated_threat_report(since="24h", investigation_depth="deep",
  response_format="json", redaction_policy="protect_victim")
wazuh_domain_lookup(domain="tangerangkota.go.id", since="24h", reveal_owned=true,
  response_format="json", max_scanned=10000)

LANGKAH 2  — Per attacker (top 10): threat card + attack chain
blueteam_threat_card(srcip=<ip>, since="24h")
blueteam_attack_chain(srcip=<ip>, since="24h")

LANGKAH 3  — Unified threat intel:
blueteam_threat_intel_aggregate(indicator=<ip>, response_format="json")
argus_ip_lookup(ip=<ip>); otx_lookup(indicator=<ip>, section="general")
blueteam_ip_blacklist(ip=<ip>); blueteam_ioc_search(ip=<ip>)   # RapidAPI

LANGKAH 4  — 3-Sum APT + auto-enrich + case:
three_sum_correlation(time_window_minutes=1440, follow_up="threat_intel",
  multi_resolution=true, create_case=true, response_format="json",
  redaction_policy="protect_victim")

LANGKAH 5  — Attack graph + pivot + campaign:
blueteam_attack_graph(window_days=30, top_n=20, response_format="json")
blueteam_pivot_suggest(ioc=<top_attacker_ip>)
blueteam_campaign_watch(response_format="json")

LANGKAH 6  — LangGraph investigation + verdict:
blueteam_investigation_workflow(alert_text="<...>", srcip=<ip>, window="24h",
  use_attack_graph=true, generate_report=false, record_verdict=true, verdict_label="suspicious")
blueteam_mark_investigated(srcip=<ip>, verdict="<verdict>", case_id=<case_id>)

LANGKAH 7  — Compromised emails + breach/stealer check:
wazuh_compromised_emails_analysis(since="24h", response_format="json")
blueteam_breach_check(email=<email_dinas>); stealer_log_check(email=<email_dinas>)

LANGKAH 8  — MITRE kill-chain + C2 fingerprinting:
blueteam_stix_killchain(srcip=<ip>, since="24h")
jarm_fingerprint(host=<c2_domain_or_ip>, response_format="json")
blueteam_domain_permute(domain="tangerangkota.go.id")   # typosquatting lookalikes

LANGKAH 9  — Suppression, telemetry, case review:
blueteam_false_positive_kb(); blueteam_owned_domains(); blueteam_metrics()
blueteam_case_list(); blueteam_case_get(case_id=<case_id>)

LANGKAH 10 — Geo heatmap:
blueteam_wazuh_geo_heatmap(since="24h", response_format="json")

Supplementary tools (by category — the full 123-tool set; LANGKAH 0–10 is the default path):

- Alert search/aggregation: blueteam_wazuh_indexer_search, blueteam_wazuh_alerts,
  wazuh_alert_aggregate_analysis, wazuh_alert_focused_crawl, wazuh_alert_dsl_query,
  wazuh_alert_timeline, wazuh_attack_velocity, blueteam_wazuh_alert_summarize,
  blueteam_wazuh_alert_compare.
- Threat intel: crowdsec_ip_reputation(/bulk), threatfox_ioc_search(/bulk),
  greynoise_ip_context, netra_ip_analysis, otx_lookup_bulk, urlhaus_lookup(/bulk),
  urlhaus_hash_lookup, blueteam_lookup_domain_virustotal, blueteam_lookup_hash_virustotal,
  blueteam_unified_threat_score, blueteam_mitre_lookup.
- Baselines & anomaly: blueteam_baseline_profile, blueteam_baseline_drift,
  blueteam_calendar_heatmap, blueteam_beacon_detect.
- Wazuh Manager (agents/rules/config): blueteam_wazuh_agents, blueteam_wazuh_agents_summary,
  blueteam_wazuh_get_cluster_nodes, blueteam_wazuh_get_rules, blueteam_wazuh_get_groups,
  blueteam_wazuh_get_decoders, blueteam_wazuh_get_security_events, blueteam_wazuh_manager_logs,
  blueteam_wazuh_get_rule_files, blueteam_wazuh_get_rule_file_content,
  blueteam_wazuh_get_agent_sca, blueteam_wazuh_list_sca_policies, blueteam_wazuh_get_sca_policy_checks.
- Compliance/SCA/vuln: blueteam_wazuh_syscheck, blueteam_wazuh_compliance,
  blueteam_wazuh_vulnerabilities.
- Host forensics: blueteam_read_auth_log, blueteam_read_syslog, blueteam_read_web_log,
  blueteam_failed_logins, blueteam_last_logins, blueteam_who_is_logged_in,
  blueteam_find_suid_files, blueteam_find_world_writable, blueteam_list_connections,
  blueteam_list_listening_ports, blueteam_list_processes, blueteam_list_cron_jobs,
  blueteam_list_users, blueteam_hash_file, blueteam_journalctl, blueteam_rootkit_scan,
  blueteam_lynis_audit, blueteam_system_health, blueteam_sudo_history,
  blueteam_check_open_firewall, blueteam_check_ssh_authorized_keys, blueteam_check_updates,
  blueteam_fail2ban_status, blueteam_fail2ban_jail_status, blueteam_fail2ban_unban,
  blueteam_capture_traffic.
- Domain/asset: blueteam_whois_lookup, blueteam_crtsh_lookup, blueteam_asset_context.
- Case/IOC/history: blueteam_case_create, blueteam_case_add_iocs, blueteam_case_add_verdict,
  blueteam_case_list, blueteam_case_get, blueteam_extract_iocs, blueteam_ioc_lifecycle,
  blueteam_investigate_ip, blueteam_playbook_run, blueteam_investigation_history,
  blueteam_investigation_summary, blueteam_false_positive_tracker.
- Geo: blueteam_wazuh_geo_distribution (by country).
- Forensics/scanning/other: blueteam_check_webshell, blueteam_semantic_search,
  blueteam_threat_hunt, blueteam_stix_analyze, blueteam_prompt_route.
- AI/LLM attack detection: blueteam_ai_bot_recon (AI-agent user-agents probing exploit paths).
- Sangfor blocklist: sangfor_blocklist_check(ip=<ip>) for a single IP;
  sangfor_blocklist_list(limit=…, date_start="YYYY-MM-DD HH:MM:SS", date_end=…) for the list —
  no ``since`` / ``offset`` params (use date_start/date_end).

—— FORMAT MARKDOWN: compose the report from steps 1–10 (ringkasan → subdomain → IOC →
   threat intel → 3-Sum → attack graph → LangGraph → email → MITRE → geo).

—— FORMAT DOCX (officecli): blueteam_export_report(format="docx", title="<...>",
   path="/var/log/blue-team-mcp/exports/laporan_24jam_<date>.docx", docx_sections=[...])

—— FORENSIC EXPORT (HUMAN ONLY): blueteam_wazuh_export(since="24h", bypass_redaction=true,
   forensic_token="<BLUETEAM_FORENSIC_TOKEN>")
   → streams to /var/log/blue-team-mcp/exports/export_<timestamp>.jsonl (filename auto-generated;
     NO ``path`` parameter). WITHOUT ``bypass_redaction=true`` the export is protect_victim-masked
     (subdomains stay masked). Analyst reads the file on the server (cat/jq); the LLM assists only
     with REDACTED analysis.

环境要求

  • Python 3.11+

  • mcp, httpx[http2], pydantic, networkx, langgraph, officecli-sdk

  • 参见 requirements.txt


开发

  • 合并前:python3 check_guardrails.py --strict 必须以退出码 0 结束,且日志仍输出到 stderr。

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    An MCP server for the Wazuh SIEM/XDR platform that enables users to query agents, security alerts, detection rules, and decoders through Claude or other MCP clients. It provides specialized tools and prompts for investigating security alerts, performing agent health checks, and generating environmental security overviews.
    28
    34
    3
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    An MCP server that exposes a 60+ tool security and threat-intel stack to AI agents, enabling secret scanning, Sigma rule generation, ransomware lookup, OSINT, and deep research.
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that transforms Claude Code into an autonomous DFIR analyst by providing typed, audited forensic tools for disk, memory, timeline, registry, and IOC analysis on the SANS SIFT Workstation.
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    This MCP server connects Claude Desktop to a Velociraptor instance and local forensic tools. It enables remote endpoint investigation and local evidence analysis through natural language commands.
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.

  • Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.

  • MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/INFOKOM-KI/Wazuh-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server