wazuh) is the primary plugin that provides the Wazuh dashboard application, UI components, and server-side routes.
Plugin Class
WazuhPlugin
The main plugin class implementing the OpenSearch Dashboards plugin interface. Location:plugins/main/public/plugin.ts:51
Lifecycle Methods
setup()
Initializes the plugin during the setup phase. Signature:OpenSearch Dashboards core services setup contract
Plugin dependencies available during setup
Promise<WazuhSetup> - Empty object (no public APIs exposed during setup)
Setup Tasks
During setup, the plugin:- Configures chart color palettes - Customizes the EUI palette for better visualization
- Registers query languages - Enables WQL, Lucene, and DQL for search bars
- Registers applications - Creates all Wazuh applications (Overview, Agents, etc.)
- Registers navigation links - Adds Wazuh to the OpenSearch Dashboards menu
start()
Activates the plugin during the start phase. Signature:OpenSearch Dashboards core services start contract
Plugin dependencies available during start
WazuhStart - Empty object (no public APIs exposed during start)
Start Tasks
During start, the plugin:- Sets global services - Makes core services available throughout the app
- Hides security alerts - Disables OpenSearch security warnings
- Initializes telemetry - Sets up usage tracking if enabled
- Configures error handling - Establishes error orchestration
Type Definitions
WazuhSetupPlugins
Plugins required during the setup phase. Location:plugins/main/public/types.ts:43
WazuhStartPlugins
Plugins required during the start phase. Location:plugins/main/public/types.ts:51
AppDependencies
Context object passed to application components. Location:plugins/main/public/types.ts:37
Server Plugin
The server-side plugin provides REST API routes and background jobs.WazuhPlugin (Server)
Location:plugins/main/server/plugin.ts:177
setup() (Server)
Signature:- Registers route handler context - Adds
wazuhcontext to request handlers - Adds security headers - Configures X-Frame-Options
- Creates router - Sets up HTTP route handling
- Registers health checks - Initializes index pattern and API checks
- Configures notifications - Sets up notification channels if available
start() (Server)
Signature:- Initializes background jobs - Starts API initialization checks
- Starts queue processing - Begins queue job runner
- Loads global configuration - Retrieves server settings
Server Routes
The main plugin exposes several REST API route groups.Wazuh API Routes
Location:plugins/main/server/routes/wazuh-api.ts
POST /api/check-stored-api
Validates a stored API configuration.API host ID to check
Previous ID if changed
POST /api/check-api
Validates API credentials without storing them.Wazuh API URL
API port number
API username
API password
POST /api/login
Authenticates with a configured API host.API host ID
Force token refresh
POST /api/request
Proxies a request to the Wazuh API.API host ID
HTTP method (GET, POST, PUT, DELETE)
API endpoint path
Request payload
POST /api/csv
Exports API response data as CSV.API host ID
API endpoint path
Query filters
GET /api/routes
Returns available Wazuh API routes for the Dev Tools console. Response:Host Management Routes
Location:plugins/main/server/routes/wazuh-hosts.ts
GET /hosts/apis
Retrieve all configured API hosts.POST /hosts/apis
Add a new API host configuration.PUT /hosts/apis/:id
Update an existing API host.DELETE /hosts/apis/:id
Remove an API host configuration.Elasticsearch Routes
Location:plugins/main/server/routes/wazuh-elastic.ts
GET /elastic/known-fields/:pattern
Get known fields for an index pattern.GET /elastic/visualizations
Retrieve visualization saved objects.POST /elastic/index-patterns
Create or update index patterns.Utility Routes
Location:plugins/main/server/routes/wazuh-utils/ui-logs.ts
POST /utils/logs/ui
Log client-side errors to the server.Log level (info, error, warning)
Log message
Source location in UI
Global Services
The plugin exposes global services through the kibana-services module. Location:plugins/main/public/kibana-services.ts
Related Resources
Wazuh Core API
Shared services and configuration
Components
Reusable UI components
API Console
Interactive API testing
Server Architecture
Server-side architecture guide