Skip to content

Customization

Antonio David Gutiérrez edited this page Aug 4, 2022 · 8 revisions

Customization

Supported customization

The recent plugin versions support to customize some images of the plugin. They are:

  • Menu
  • Health check
  • Sidebar
  • Reports

This is possible through plugin settings: customization.logo.<LOCATION>. Its value must be a partial path whose base is <PLUGIN_PLATFORM_PATH>/plugins/wazuh/target/assets.

The files should be located in <PLUGIN_PLATFORM_PATH>/plugins/wazuh/target/assets directory.

where:

  • <PLUGIN_PLATFORM_PATH> is the path to the plugin platform. By default, depending on the plugin platform:
    • Kibana: /usr/share/kibana
    • Wazuh dashboard: /usr/share/wazuh-dashboard

Locations:

  • app:

setting: customization.logo.app location: plugin menu recommended image: 300x70px in png, jgp, svg another size: keep width/height proportions of the recommended image 300/70

  • sidebar

setting: customization.logo.sidebar location: category of plugin in the platform menu recommended image: 80x80px in png, jgp, svg another size: keep square proportions width/height 1x1

  • healthcheck

setting: customization.logo.healthcheck location: plugin health check recommended image: 300x70px in png, jgp, svg another size: the width image will be adjusted and the height value will keep the proportions. Square or horizontal images should work.

  • reports

setting: customization.logo.reports location: PDF reports generated by the Wazuh plugin recommended image: 370x75px in png, jgp another size: keep width/height (370/75) proportions of the recommended image, otherwhise the PDF text could be overlaid.

Example:

Customize the image displayed in the menu. Image: menu_image.png (in the plugin configuration we define where the file is located)

Steps:

  1. Copy the image to <PLUGIN_PLATFORM_PATH>/plugins/wazuh/target/assets, so the path of the file will be <PLUGIN_PLATFORM_PATH>/plugins/wazuh/target/assets/menu_image.png.

  2. Configure the setting in the plugin configuration file wazuh.yml or using from the UI in the Settings/Configuration section.

customization.logo.app: menu_image.png

Note you can put the image in a subdirectory of <PLUGIN_PLATFORM_PATH>/plugins/wazuh/target/assets, so the setting configuration shoulb include this subpath.

Unsupported customization

Some users want to customize some branding texts, as the Wazuh name in the plugin platform menu, but this customization is not currently supported by the plugin through settings.

We will describe some workarounds to apply the customizations over the installed plugin, modificating the code of the built plugin.

Plugin platform menu - Category name.

⚠️ These steps only apply to the production Wazuh plugin.

  1. Replace the the category label in the plugin platform menu.
sed -i 's|label:"Wazuh"|label:"<PLUGIN_CATEGORY_LABEL>"|g' <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.plugin.js

where:

  • <PLUGIN_CATEGORY_LABEL> is the catorory label.
  • <PATH_TO_WAZUH_PLUGIN_ROOT> is the path to the Wazuh plugin files are located in the file system. By default, depending on the plugin platform:
    • Kibana: /usr/share/kibana/plugins/wazuh
    • Wazuh dashboard: /usr/share/wazuh-dashboard/plugins/wazuh
  1. Rebuild the compressed files. It requires the gzip and brotli packages. Ensure you have these packages or install them.
gzip -c <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.plugin.js > <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.plugin.js.gz
brotli -c <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.plugin.js > <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.plugin.js.br

where:

  • <PATH_TO_WAZUH_PLUGIN_ROOT> is the path to the Wazuh plugin files are located in the file system. By default, depending on the plugin platform:
    • Kibana: /usr/share/kibana/plugins/wazuh
    • Wazuh dashboard: /usr/share/wazuh-dashboard/plugins/wazuh

Example:

plugin platform: Wazuh dashboard plugin name: Custom category

# Change the category name in the plugin platform menu
sed -i 's|label:"Wazuh"|label:"Custom category"|g' /usr/share/wazuh-dashboard/plugins/wazuh/target/public/wazuh.plugin.js

# Build compressed files
gzip -c /usr/share/wazuh-dashboard/plugins/wazuh/target/public/wazuh.plugin.js > /usr/share/wazuh-dashboard/plugins/wazuh/target/public/wazuh.plugin.js.gz
brotli -c /usr/share/wazuh-dashboard/plugins/wazuh/target/public/wazuh.plugin.js > /usr/share/wazuh-dashboard/plugins/wazuh/target/public/wazuh.plugin.js.br

Plugin platform menu - Plugin name.

⚠️ These steps only apply to the production Wazuh plugin.

  1. Replace the the plugin name in the plugin platform menu.
sed -i 's|title:"Wazuh"|title:"<PLUGIN_TITLE>"|g' <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.plugin.js

where:

  • <PLUGIN_TITLE> is the plugin display name.
  • <PATH_TO_WAZUH_PLUGIN_ROOT> is the path to the Wazuh plugin files are located in the file system. By default, depending on the plugin platform:
    • Kibana: /usr/share/kibana/plugins/wazuh
    • Wazuh dashboard: /usr/share/wazuh-dashboard/plugins/wazuh
  1. Rebuild the compressed files. It requires the gzip and brotli packages. Ensure you have these packages or install them.
gzip -c <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.plugin.js > <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.plugin.js.gz
brotli -c <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.plugin.js > <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.plugin.js.br

where:

  • <PATH_TO_WAZUH_PLUGIN_ROOT> is the path to the Wazuh plugin files are located in the file system. By default, depending on the plugin platform:
    • Kibana: /usr/share/kibana/plugins/wazuh
    • Wazuh dashboard: /usr/share/wazuh-dashboard/plugins/wazuh

Example:

plugin platform: Wazuh dashboard plugin name: Custom plugin

# Change the plugin name in the plugin platform menu
sed -i 's|title:"Wazuh"|title:"Custom plugin"|g' /usr/share/wazuh-dashboard/plugins/wazuh/target/public/wazuh.plugin.js

# Build compressed files
gzip -c /usr/share/wazuh-dashboard/plugins/wazuh/target/public/wazuh.plugin.js > /usr/share/wazuh-dashboard/plugins/wazuh/target/public/wazuh.plugin.js.gz
brotli -c /usr/share/wazuh-dashboard/plugins/wazuh/target/public/wazuh.plugin.js > /usr/share/wazuh-dashboard/plugins/wazuh/target/public/wazuh.plugin.js.br

Plugin name in the browser tab.

⚠️ These steps only apply to the production Wazuh plugin.

  1. Replace the plugin name in the browser tab name.
sed -i 's/chrome\.docTitle\.change("Wazuh"/chrome\.docTitle\.change("<PLUGIN_NAME>"/' <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.chunk.9.js

where:

  • <PLUGIN_NAME> is the name you want to display. The final result could look like: <PLUGIN_NAME> - <PLUGIN_PLATFORM_NAME> (<PLUGIN_PLATFORM_NAME> can be defined with Wazuh dashboard options)
  • <PATH_TO_WAZUH_PLUGIN_ROOT> is the path to the Wazuh plugin files are located in the file system. By default, depending on the plugin platform:
    • Kibana: /usr/share/kibana/plugins/wazuh
    • Wazuh dashboard: /usr/share/wazuh-dashboard/plugins/wazuh
  1. Rebuild the compressed files. It requires the gzip and brotli packages. Ensure you have these packages or install them.
gzip -c <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.chunk.9.js > <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.chunk.9.js.gz
brotli -c <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.chunk.9.js > <PATH_TO_WAZUH_PLUGIN_ROOT>/target/public/wazuh.chunk.9.js.br

where:

  • <PATH_TO_WAZUH_PLUGIN_ROOT> is the path to the Wazuh plugin files are located in the file system. By default, depending on the plugin platform:
    • Kibana: /usr/share/kibana/plugins/wazuh
    • Wazuh dashboard: /usr/share/wazuh-dashboard/plugins/wazuh

Example:

plugin platform: Wazuh dashboard plugin name: Custom plugin

# Change plugin name in the browser tab name
sed -i 's/chrome\.docTitle\.change("Wazuh"/chrome\.docTitle\.change("Custom plugin"/' /usr/share/wazuh-dashboard/plugins/wazuh/target/public/wazuh.chunk.9.js

# Build compressed files
gzip -c /usr/share/wazuh-dashboard/target/public/wazuh.chunk.9.js > /usr/share/wazuh-dashboard/target/public/wazuh.chunk.9.js.gz
brotli -c /usr/share/wazuh-dashboard/target/public/wazuh.chunk.9.js > /usr/share/wazuh-dashboard/target/public/wazuh.chunk.9.js.br
Clone this wiki locally