# socfortress/wazuh-rules architecture

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

- Interactive diagram: https://gitdiagram.com/socfortress/wazuh-rules
- Repository: https://github.com/socfortress/wazuh-rules

## Overview

This repository is a collection of Wazuh detection rules and integration scripts, not a standalone service. Its primary workflow is for a Wazuh deployment to use the rule files to detect events in ingested logs; selected integration scripts also query external security or threat-intelligence APIs and send enriched events to Wazuh. The README documents these roles, while sampled scripts show specific API and event-queue behavior. Relationships among unsampled rule families and integrations are therefore kept broad rather than inferred.

Main entry points: [`Office Defender/defender_for_endpoint_alerts.py`](https://github.com/socfortress/wazuh-rules/blob/main/Office%20Defender/defender_for_endpoint_alerts.py) (Defender integration), [`MISP/custom-misp.py`](https://github.com/socfortress/wazuh-rules/blob/main/MISP/custom-misp.py) (MISP enrichment), [`OpenCTI/custom-opencti.py`](https://github.com/socfortress/wazuh-rules/blob/main/OpenCTI/custom-opencti.py) (OpenCTI enrichment), [`AbuseIPDB/custom-abuseipdb.py`](https://github.com/socfortress/wazuh-rules/blob/main/AbuseIPDB/custom-abuseipdb.py) (AbuseIPDB enrichment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_detection["Detection rules"]
  node_sysmon_win["Windows Sysmon rules"]
  node_sysmon_linux["Linux Sysmon rules"]
  node_chainsaw["Chainsaw rules"]
  node_other_rules["Other detection rules"]
end

subgraph group_endpoint["Endpoint integrations"]
  node_osquery["Osquery integration"]
  node_defender["Defender integration"]
  node_trendmicro["Trend Micro integration<br/>[trendmicro.py]"]
  node_active_response["Active response scripts"]
end

subgraph group_threat["Threat intelligence"]
  node_misp["MISP enrichment<br/>[custom-misp.py]"]
  node_opencti["OpenCTI enrichment<br/>[custom-opencti.py]"]
  node_abuseipdb["AbuseIPDB enrichment"]
  node_domain_stats["Domain statistics<br/>[custom-dnsstats.py]"]
end

subgraph group_cloud["Cloud and network"]
  node_office365["Office 365 integration<br/>[office_365.py]"]
  node_suricata["Suricata rules"]
  node_packetbeat["Packetbeat rules"]
  node_nmap["Network scanning<br/>[nmap_scan.py]"]
end

node_wazuh["Wazuh manager"]
node_log_sources(("Security event sources"))
node_microsoft_api["Microsoft security APIs"]
node_threat_apis["Threat intelligence APIs"]
node_trend_api["Trend Micro API"]
node_dns_stats_api["DNS statistics service"]

node_log_sources -->|"ingests events"| node_wazuh
node_wazuh -->|"uses rules"| node_sysmon_win
node_wazuh -->|"uses rules"| node_sysmon_linux
node_wazuh -->|"uses rules"| node_chainsaw
node_wazuh -->|"uses rules"| node_other_rules
node_wazuh -->|"uses rules"| node_suricata
node_wazuh -->|"uses rules"| node_packetbeat
node_office365 -->|"requests activity"| node_microsoft_api
node_office365 -->|"sends events"| node_wazuh
node_defender -->|"requests data"| node_microsoft_api
node_defender -->|"sends events"| node_wazuh
node_misp -->|"queries indicators"| node_threat_apis
node_misp -->|"sends enriched events"| node_wazuh
node_opencti -->|"queries observables"| node_threat_apis
node_opencti -->|"sends enriched events"| node_wazuh
node_abuseipdb -->|"checks IPs"| node_threat_apis
node_abuseipdb -->|"sends enriched events"| node_wazuh
node_domain_stats -->|"queries domains"| node_dns_stats_api
node_domain_stats -->|"sends enriched events"| node_wazuh
node_trendmicro -->|"fetches alerts"| node_trend_api
node_nmap -->|"writes scan results"| node_wazuh
node_osquery -.->|"provides integration"| node_wazuh
node_active_response -.->|"provides responses"| node_wazuh

click node_sysmon_win "https://github.com/socfortress/wazuh-rules/tree/main/Windows_Sysmon"
click node_sysmon_linux "https://github.com/socfortress/wazuh-rules/tree/main/Sysmon%20Linux"
click node_chainsaw "https://github.com/socfortress/wazuh-rules/tree/main/Windows%20Chainsaw"
click node_other_rules "https://github.com/socfortress/wazuh-rules/tree/main/Yara"
click node_osquery "https://github.com/socfortress/wazuh-rules/tree/main/Osquery"
click node_defender "https://github.com/socfortress/wazuh-rules/blob/main/Office%20Defender/defender_for_endpoint_alerts.py"
click node_office365 "https://github.com/socfortress/wazuh-rules/blob/main/Office%20365/office_365.py"
click node_trendmicro "https://github.com/socfortress/wazuh-rules/blob/main/Trend%20Micro/trendmicro.py"
click node_misp "https://github.com/socfortress/wazuh-rules/blob/main/MISP/custom-misp.py"
click node_opencti "https://github.com/socfortress/wazuh-rules/blob/main/OpenCTI/custom-opencti.py"
click node_abuseipdb "https://github.com/socfortress/wazuh-rules/blob/main/AbuseIPDB/custom-abuseipdb.py"
click node_domain_stats "https://github.com/socfortress/wazuh-rules/blob/main/Domain%20Stats/custom-dnsstats.py"
click node_suricata "https://github.com/socfortress/wazuh-rules/tree/main/Suricata"
click node_packetbeat "https://github.com/socfortress/wazuh-rules/tree/main/Packetbeat"
click node_nmap "https://github.com/socfortress/wazuh-rules/blob/main/Nmap/nmap_scan.py"
click node_active_response "https://github.com/socfortress/wazuh-rules/tree/main/Active%20Response/Windows"

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_sysmon_win,node_sysmon_linux,node_chainsaw,node_other_rules toneBlue
class node_osquery,node_defender,node_trendmicro,node_active_response toneAmber
class node_misp,node_opencti,node_abuseipdb,node_domain_stats,node_microsoft_api,node_threat_apis,node_trend_api toneMint
class node_office365,node_suricata,node_packetbeat,node_nmap toneRose
class node_wazuh,node_log_sources,node_dns_stats_api toneIndigo
```

## Components

### Detection rules

- [Windows Sysmon rules](https://github.com/socfortress/wazuh-rules/tree/main/Windows_Sysmon): `Windows_Sysmon`
- [Linux Sysmon rules](https://github.com/socfortress/wazuh-rules/tree/main/Sysmon%20Linux): `Sysmon Linux`
- [Chainsaw rules](https://github.com/socfortress/wazuh-rules/tree/main/Windows%20Chainsaw): `Windows Chainsaw`
- [Other detection rules](https://github.com/socfortress/wazuh-rules/tree/main/Yara): `Yara`

### Endpoint integrations

- [Osquery integration](https://github.com/socfortress/wazuh-rules/tree/main/Osquery): `Osquery`
- [Defender integration](https://github.com/socfortress/wazuh-rules/blob/main/Office%20Defender/defender_for_endpoint_alerts.py): `Office Defender/defender_for_endpoint_alerts.py`
- [Trend Micro integration](https://github.com/socfortress/wazuh-rules/blob/main/Trend%20Micro/trendmicro.py): `Trend Micro/trendmicro.py`
- [Active response scripts](https://github.com/socfortress/wazuh-rules/tree/main/Active%20Response/Windows): `Active Response/Windows`

### Threat intelligence

- [MISP enrichment](https://github.com/socfortress/wazuh-rules/blob/main/MISP/custom-misp.py): `MISP/custom-misp.py`
- [OpenCTI enrichment](https://github.com/socfortress/wazuh-rules/blob/main/OpenCTI/custom-opencti.py): `OpenCTI/custom-opencti.py`
- [AbuseIPDB enrichment](https://github.com/socfortress/wazuh-rules/blob/main/AbuseIPDB/custom-abuseipdb.py): `AbuseIPDB/custom-abuseipdb.py`
- [Domain statistics](https://github.com/socfortress/wazuh-rules/blob/main/Domain%20Stats/custom-dnsstats.py): `Domain Stats/custom-dnsstats.py`

### Cloud and network

- [Office 365 integration](https://github.com/socfortress/wazuh-rules/blob/main/Office%20365/office_365.py): `Office 365/office_365.py`
- [Suricata rules](https://github.com/socfortress/wazuh-rules/tree/main/Suricata): `Suricata`
- [Packetbeat rules](https://github.com/socfortress/wazuh-rules/tree/main/Packetbeat): `Packetbeat`
- [Network scanning](https://github.com/socfortress/wazuh-rules/blob/main/Nmap/nmap_scan.py): `Nmap/nmap_scan.py`

### Other components

- **Wazuh manager**
- **Security event sources**
- **Microsoft security APIs**
- **Threat intelligence APIs**
- **Trend Micro API**
- **DNS statistics service**

## Connections

- Security event sources → Wazuh manager: ingests events (evidence: `README.md`)
- Wazuh manager → Windows Sysmon rules: uses rules (evidence: `README.md`)
- Wazuh manager → Linux Sysmon rules: uses rules (evidence: `README.md`)
- Wazuh manager → Chainsaw rules: uses rules (evidence: `README.md`)
- Wazuh manager → Other detection rules: uses rules (evidence: `README.md`)
- Wazuh manager → Suricata rules: uses rules (evidence: `README.md`)
- Wazuh manager → Packetbeat rules: uses rules (evidence: `README.md`)
- Office 365 integration → Microsoft security APIs: requests activity (evidence: `Office 365/office_365.py`)
- Office 365 integration → Wazuh manager: sends events (evidence: `Office 365/office_365.py`)
- Defender integration → Microsoft security APIs: requests data (evidence: `Office Defender/defender_for_endpoint_alerts.py`)
- Defender integration → Wazuh manager: sends events (evidence: `Office Defender/defender_for_endpoint_alerts.py`)
- MISP enrichment → Threat intelligence APIs: queries indicators (evidence: `MISP/custom-misp.py`)
- MISP enrichment → Wazuh manager: sends enriched events (evidence: `MISP/custom-misp.py`)
- OpenCTI enrichment → Threat intelligence APIs: queries observables (evidence: `OpenCTI/custom-opencti.py`)
- OpenCTI enrichment → Wazuh manager: sends enriched events (evidence: `OpenCTI/custom-opencti.py`)
- AbuseIPDB enrichment → Threat intelligence APIs: checks IPs (evidence: `AbuseIPDB/custom-abuseipdb.py`)
- AbuseIPDB enrichment → Wazuh manager: sends enriched events (evidence: `AbuseIPDB/custom-abuseipdb.py`)
- Domain statistics → DNS statistics service: queries domains (evidence: `Domain Stats/custom-dnsstats.py`)
- Domain statistics → Wazuh manager: sends enriched events (evidence: `Domain Stats/custom-dnsstats.py`)
- Trend Micro integration → Trend Micro API: fetches alerts (evidence: `Trend Micro/trendmicro.py`)
- Network scanning → Wazuh manager: writes scan results (evidence: `Nmap/nmap_scan.py`)
- Osquery integration → Wazuh manager: provides integration (evidence: `README.md`)
- Active response scripts → Wazuh manager: provides responses (evidence: `README.md`)
