# abhishek-s-kumar/misp architecture

> Architecture diagram of the GitHub repository abhishek-s-kumar/misp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhishek-s-kumar/misp
- Repository: https://github.com/abhishek-s-kumar/misp

## Overview

This repository ingests MISP and GitHub detection rules, validates and processes them, records rule artifacts in Git, and supports deployment to Wazuh. Users can initiate sync, validation, deployment, rollback, status, and quarantine actions through the API or MCP tools; hourly sync is also documented. The graph preserves the documented processing and deployment stages. Some subsystem links are based on imports or README descriptions rather than complete call-site excerpts, so unsampled details are omitted.

Main entry points: [`mcp_tools/rule_tools.py`](https://github.com/abhishek-s-kumar/misp/blob/main/mcp_tools/rule_tools.py) (Rule operations), [`processors/__init__.py`](https://github.com/abhishek-s-kumar/misp/blob/main/processors/__init__.py) (Rule processor), [`validators/__init__.py`](https://github.com/abhishek-s-kumar/misp/blob/main/validators/__init__.py) (Rule validation dispatcher), [`api/server.py`](https://github.com/abhishek-s-kumar/misp/blob/main/api/server.py) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_api["HTTP API<br/>[server.py]"]
  node_mcp["MCP server<br/>[server.py]"]
  node_tools["Rule operations<br/>[rule_tools.py]"]
  node_scheduler["Hourly sync<br/>[hourly_sync.py]"]
end

subgraph group_ingest["Rule ingestion"]
  node_misp_provider["MISP provider<br/>[pymisp_provider.py]"]
  node_rule_collector["MISP rule collector<br/>[misp_rules.py]"]
  node_github_provider["GitHub rule source<br/>[github_provider.py]"]
end

subgraph group_process["Rule processing"]
  node_validators["Rule validation dispatcher<br/>[__init__.py]"]
  node_sigma_validator["Sigma validation<br/>[sigma_validator.py]"]
  node_wazuh_validator["Wazuh validation<br/>[wazuh_validator.py]"]
  node_yara_validator["YARA validation<br/>[yara_validator.py]"]
  node_processor["Rule processor<br/>[__init__.py]"]
  node_deduplicator["Deduplication<br/>[deduplicator.py]"]
  node_metadata["Rule metadata<br/>[metadata_writer.py]"]
  node_sigma_converter["Sigma converter<br/>[sigma_converter.py]"]
  node_xml_merger["Wazuh XML compiler<br/>[xml_merger.py]"]
end

subgraph group_ops["Deployment operations"]
  node_git_ops["Git artifact operations<br/>[git_ops.py]"]
  node_git_store[("Rule repository")]
  node_wazuh[("Wazuh deployment target")]
end

node_operator(("Operator"))
node_misp[("MISP")]
node_github[("GitHub repositories")]

node_operator -->|"calls"| node_api
node_operator -.->|"invokes"| node_mcp
node_api -->|"routes actions"| node_tools
node_mcp -->|"serves tools"| node_tools
node_scheduler -->|"triggers sync"| node_tools
node_tools -->|"syncs MISP rules"| node_rule_collector
node_rule_collector -->|"selects provider"| node_misp_provider
node_misp_provider -->|"fetches rules"| node_misp
node_tools -->|"syncs GitHub rules"| node_github_provider
node_github_provider -->|"fetches rule files"| node_github
node_tools -->|"validates rules"| node_validators
node_validators -->|"dispatches"| node_sigma_validator
node_validators -->|"dispatches"| node_wazuh_validator
node_validators -->|"dispatches"| node_yara_validator
node_processor -->|"validates rules"| node_validators
node_processor -->|"deduplicates"| node_deduplicator
node_processor -->|"writes metadata"| node_metadata
node_processor -->|"converts Sigma"| node_sigma_converter
node_processor -->|"builds XML"| node_xml_merger
node_xml_merger -->|"calls converter"| node_sigma_converter
node_tools -->|"commits artifacts"| node_git_ops
node_git_ops -->|"updates repository"| node_git_store
node_tools -->|"deploys rules"| node_wazuh
node_tools -->|"records deployment"| node_git_store

click node_api "https://github.com/abhishek-s-kumar/misp/blob/main/api/server.py"
click node_mcp "https://github.com/abhishek-s-kumar/misp/blob/main/mcp_tools/server.py"
click node_tools "https://github.com/abhishek-s-kumar/misp/blob/main/mcp_tools/rule_tools.py"
click node_scheduler "https://github.com/abhishek-s-kumar/misp/blob/main/scheduler/hourly_sync.py"
click node_misp_provider "https://github.com/abhishek-s-kumar/misp/blob/main/collector/pymisp_provider.py"
click node_rule_collector "https://github.com/abhishek-s-kumar/misp/blob/main/collector/misp_rules.py"
click node_github_provider "https://github.com/abhishek-s-kumar/misp/blob/main/collector/github_provider.py"
click node_validators "https://github.com/abhishek-s-kumar/misp/blob/main/validators/__init__.py"
click node_sigma_validator "https://github.com/abhishek-s-kumar/misp/blob/main/validators/sigma_validator.py"
click node_wazuh_validator "https://github.com/abhishek-s-kumar/misp/blob/main/validators/wazuh_validator.py"
click node_yara_validator "https://github.com/abhishek-s-kumar/misp/blob/main/validators/yara_validator.py"
click node_processor "https://github.com/abhishek-s-kumar/misp/blob/main/processors/__init__.py"
click node_deduplicator "https://github.com/abhishek-s-kumar/misp/blob/main/processors/deduplicator.py"
click node_metadata "https://github.com/abhishek-s-kumar/misp/blob/main/processors/metadata_writer.py"
click node_sigma_converter "https://github.com/abhishek-s-kumar/misp/blob/main/processors/sigma_converter.py"
click node_xml_merger "https://github.com/abhishek-s-kumar/misp/blob/main/processors/xml_merger.py"
click node_git_ops "https://github.com/abhishek-s-kumar/misp/blob/main/processors/git_ops.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_mcp,node_tools,node_scheduler toneBlue
class node_misp_provider,node_rule_collector,node_github_provider,node_misp,node_github toneAmber
class node_validators,node_sigma_validator,node_wazuh_validator,node_yara_validator,node_processor,node_deduplicator,node_metadata,node_sigma_converter,node_xml_merger toneMint
class node_git_ops,node_git_store,node_wazuh toneRose
class node_operator toneIndigo
```

## Components

### User interfaces

- [HTTP API](https://github.com/abhishek-s-kumar/misp/blob/main/api/server.py): `api/server.py`
- [MCP server](https://github.com/abhishek-s-kumar/misp/blob/main/mcp_tools/server.py): `mcp_tools/server.py`
- [Rule operations](https://github.com/abhishek-s-kumar/misp/blob/main/mcp_tools/rule_tools.py): `mcp_tools/rule_tools.py`
- [Hourly sync](https://github.com/abhishek-s-kumar/misp/blob/main/scheduler/hourly_sync.py): `scheduler/hourly_sync.py`

### Rule ingestion

- [MISP provider](https://github.com/abhishek-s-kumar/misp/blob/main/collector/pymisp_provider.py): `collector/pymisp_provider.py`
- [MISP rule collector](https://github.com/abhishek-s-kumar/misp/blob/main/collector/misp_rules.py): `collector/misp_rules.py`
- [GitHub rule source](https://github.com/abhishek-s-kumar/misp/blob/main/collector/github_provider.py): `collector/github_provider.py`

### Rule processing

- [Rule validation dispatcher](https://github.com/abhishek-s-kumar/misp/blob/main/validators/__init__.py): `validators/__init__.py`
- [Sigma validation](https://github.com/abhishek-s-kumar/misp/blob/main/validators/sigma_validator.py): `validators/sigma_validator.py`
- [Wazuh validation](https://github.com/abhishek-s-kumar/misp/blob/main/validators/wazuh_validator.py): `validators/wazuh_validator.py`
- [YARA validation](https://github.com/abhishek-s-kumar/misp/blob/main/validators/yara_validator.py): `validators/yara_validator.py`
- [Rule processor](https://github.com/abhishek-s-kumar/misp/blob/main/processors/__init__.py): `processors/__init__.py`
- [Deduplication](https://github.com/abhishek-s-kumar/misp/blob/main/processors/deduplicator.py): `processors/deduplicator.py`
- [Rule metadata](https://github.com/abhishek-s-kumar/misp/blob/main/processors/metadata_writer.py): `processors/metadata_writer.py`
- [Sigma converter](https://github.com/abhishek-s-kumar/misp/blob/main/processors/sigma_converter.py): `processors/sigma_converter.py`
- [Wazuh XML compiler](https://github.com/abhishek-s-kumar/misp/blob/main/processors/xml_merger.py): `processors/xml_merger.py`

### Deployment operations

- [Git artifact operations](https://github.com/abhishek-s-kumar/misp/blob/main/processors/git_ops.py): `processors/git_ops.py`
- **Rule repository**
- **Wazuh deployment target**

### Other components

- **Operator**
- **MISP**
- **GitHub repositories**

## Connections

- Operator → HTTP API: calls (evidence: `api/server.py`)
- Operator → MCP server: invokes
- HTTP API → Rule operations: routes actions (evidence: `api/server.py`)
- MCP server → Rule operations: serves tools (evidence: `mcp_tools/server.py`)
- Hourly sync → Rule operations: triggers sync (evidence: `scheduler/hourly_sync.py`)
- Rule operations → MISP rule collector: syncs MISP rules (evidence: `mcp_tools/rule_tools.py`)
- MISP rule collector → MISP provider: selects provider (evidence: `collector/misp_rules.py`)
- MISP provider → MISP: fetches rules (evidence: `collector/pymisp_provider.py`)
- Rule operations → GitHub rule source: syncs GitHub rules (evidence: `mcp_tools/rule_tools.py`)
- GitHub rule source → GitHub repositories: fetches rule files (evidence: `collector/github_provider.py`)
- Rule operations → Rule validation dispatcher: validates rules (evidence: `mcp_tools/rule_tools.py`)
- Rule validation dispatcher → Sigma validation: dispatches (evidence: `validators/__init__.py`)
- Rule validation dispatcher → Wazuh validation: dispatches (evidence: `validators/__init__.py`)
- Rule validation dispatcher → YARA validation: dispatches (evidence: `validators/__init__.py`)
- Rule processor → Rule validation dispatcher: validates rules (evidence: `processors/__init__.py`)
- Rule processor → Deduplication: deduplicates (evidence: `processors/__init__.py`)
- Rule processor → Rule metadata: writes metadata (evidence: `processors/__init__.py`)
- Rule processor → Sigma converter: converts Sigma (evidence: `processors/__init__.py`)
- Rule processor → Wazuh XML compiler: builds XML (evidence: `processors/__init__.py`)
- Wazuh XML compiler → Sigma converter: calls converter (evidence: `processors/xml_merger.py`)
- Rule operations → Git artifact operations: commits artifacts (evidence: `mcp_tools/rule_tools.py`)
- Git artifact operations → Rule repository: updates repository (evidence: `README.md`)
- Rule operations → Wazuh deployment target: deploys rules (evidence: `README.md`)
- Rule operations → Rule repository: records deployment (evidence: `mcp_tools/rule_tools.py`)
