How wazuh/wazuh-api works
Wazuh API is a REST interface for remotely managing and querying Wazuh. Clients send HTTP requests through the configured server and API router to domain controllers; supported controller workflows validate requests, invoke the Wazuh Python command interface, and format responses. The README documents additional management, assessment, ruleset, and statistics capabilities represented by their controller modules. The sampled excerpts show routing and selected controller-to-helper calls; relationships among unsampled controller internals are not inferred.
Main entry points: index.js API router · execute.js Command execution · response_handler.js Response handling · agents.js Agent management
Components 27
API runtime
- HTTP server
app.js - API settings
configuration/config.js - API router
controllers/index.js
Management
- Agent management
controllers/agents.js - Manager overview
controllers/manager.js - Cluster control
controllers/cluster.js - Active response
controllers/active_response.js
Security operations
- Syscheck search
controllers/syscheck.js - Rootcheck search
controllers/rootcheck.js - Security assessment
controllers/security_configuration_assessment.js - Ruleset information
controllers/rules.js - Decoder information
controllers/decoders.js - CIS-CAT results
controllers/ciscat.js
Inventory and insight
- System inventory
controllers/syscollector.js - Statistics summary
controllers/summary.js - MITRE information
controllers/mitre.js - CDB lists
controllers/lists.js - Cache control
controllers/cache.js - Experimental APIs
controllers/experimental.js
Shared services
- Request validation
helpers/filters.js - Request templates
helpers/request_templates.js - Command execution
helpers/execute.js - Wazuh command bridge
models/wazuh-api.py - Response handling
helpers/response_handler.js - Error catalog
helpers/errors.js - API logging
helpers/logger.js
Other components
- API client
Connections 36
- API client → HTTP server: sends requests
README.md - HTTP server → API settings: loads settings
app.js - HTTP server → API router: mounts routes
app.js - API router → Agent management: routes requests
controllers/index.js - API router → Manager overview: routes requests
controllers/index.js - API router → Cluster control: routes requests
controllers/index.js - API router → Active response: routes requests
controllers/index.js - API router → Syscheck search: routes requests
controllers/index.js - API router → Rootcheck search: routes requests
controllers/index.js - API router → Security assessment: routes requests
controllers/index.js - API router → Ruleset information: routes requests
controllers/index.js - API router → Decoder information: routes requests
controllers/index.js - API router → CIS-CAT results: routes requests
controllers/index.js - API router → System inventory: routes requests
controllers/index.js - API router → Statistics summary: routes requests
controllers/index.js - API router → MITRE information: routes requests
controllers/index.js - API router → CDB lists: routes requests
controllers/index.js - API router → Cache control: routes requests
controllers/index.js - API router → Experimental APIs: conditionally routes
controllers/index.js - API router → Request validation: uses validation
controllers/index.js - API router → Command execution: sets execution options
controllers/index.js - API router → Request templates: uses templates
controllers/index.js - Agent management → Request validation: validates inputs
controllers/agents.js - Agent management → Request templates: builds requests
controllers/agents.js - Agent management → Command execution: invokes commands
controllers/agents.js - Manager overview → Request validation: validates inputs
controllers/manager.js - Manager overview → Command execution: invokes commands
controllers/manager.js - Command execution → Wazuh command bridge: runs command
- Manager overview → Response handling: formats result
controllers/manager.js - Agent management → Response handling: formats result
controllers/agents.js - HTTP server → Response handling: uses response handling
app.js - Response handling → Error catalog: looks up errors
helpers/response_handler.js - Response handling → API logging: logs responses
helpers/response_handler.js - Response handling → API settings: reads API settings
helpers/response_handler.js - Command execution → Error catalog: maps failures
helpers/execute.js - Command execution → API logging: logs execution
helpers/execute.js