docs/ref/modules/vulnerability-scanner/architecture.md
The Vulnerability Scanner module processes incoming messages and indexes them in the Wazuh Indexer. It integrates several design patterns (Facade, Factory Method, and Chain of Responsibility) to modularize responsibilities and simplify maintenance. Below is an overview of the main components and their roles.
src/wazuh_modules/vulnerability_scanner/src/vulnerabilityScannerFacade.cpp
The main class that provides the starting point for the vulnerability scanner functionality.
Router communication for sync, deltas, and wazuh-db events.DatabaseFeedManager submodule and the Indexer Connector dependency module.src/wazuh_modules/vulnerability_scanner/src/scanOrchestrator/
This implementation uses the Chain of Responsibility design pattern to represent different stages for detection based on the event type.
We can enumerate the following cases:
src/wazuh_modules/vulnerability_scanner/src/databaseFeedManager/
Submodule in charge of process the information downloaded from CTI. Between the responsibilities of this implementation we have:
flowchart TD
subgraph WazuhManager[" "]
Remoted["Remoted"]
subgraph WazuhModulesM[" "]
subgraph VulnerabilityScanner[" "]
scanContext
end
D@{ shape: braces, label: "Vulnerability Scanner" } --> VulnerabilityScanner
IndexerConnector["Indexer Connector"]
VulnerabilityScanner -- "JSON Reflection" --> IndexerConnector
end
C@{ shape: braces, label: "Wazuh Modules" } --> WazuhModulesM
Remoted -- "Plain text JSON event" --> Router
Router -- "Flatbuffer event" --> scanContext
end
B@{ shape: braces, label: "Wazuh Manager" } --> WazuhManager
IndexerConnector -- indexes JSON document --> WazuhIndexer
subgraph WazuhAgent["Wazuh Agent"]
subgraph Providers["Data Provider"]
OS["Operating System"]
Packages["Packages"]
Hotfixes["Hotfixes"]
end
subgraph WazuhModulesA[" "]
Syscollector["Syscollector"]
end
A@{ shape: braces, label: "Wazuh Modules" } --> WazuhModulesA
Syscollector -- "Plain text JSON event" --> Remoted
end
Providers --> Syscollector
WazuhIndexer["Wazuh Indexer"]
WazuhDashboard["Wazuh Dashboard"]
WazuhDashboard -- /wazuh-states-vulnerabilities-*/_search --> WazuhIndexer