About Wazuh agent plugin
"Wazuh is a free and open-source security platform that unifies XDR and SIEM protection for endpoints and cloud workloads." - from wazuh.com
Plugin components
Log transformation
filter.log
: Firewall logs from/var/log/filter/
lighttpd.log
: WebGUI logs from/var/log/lighttpd/
sshd.log
: SSH daemon logs from/var/log/auditd
In addition to these logs, the plugin also parses the active-response.log
file from the /var/ossec/logs
directory.
Active Response
Active response capabilities enable a Wazuh agent to respond to configured events on the manager side with a defined action. To accomplish this, a script or program/command is executed on the agent side. However, with the default active response scripts/commands installed by the Wazuh agent package, blocking an offender's IP address in the packet filter without additional customization or configuration is not possible.
The plugin includes a shell script that is written using the new active response standards implemented by Wazuh since version 4.2. This script adds the offender's IP address to the Firewall Alias virusprot every time an active response rule is triggered. This alias is used to simplify the blocking process and avoid creating more firewall rules and aliases on OPNsense. We are considering adding custom rules/aliases in a future release of the plugin.
Since the script is a stateful type, it clears the block after a set time-window, which is defined in the manager configuration.
Plugin Setup
In order for the agent to function properly, it requires a properly configured and functioning Wazuh Manager. All rules and active response actions will be configured on the manager. You can install and configure the Wazuh manager using the official documentation.
As an official partner of Wazuh, Cloudfence can provide assistance in setting up a Wazuh manager on-premises or in the cloud. Click here to learn more
Installation and Configuration

- Click on the Enabled option to enable the plugin
- Fill the Manager Address with your Wazuh manager hostname/IP address and the Agent key/Password with the key or password extracted from Wazuh manager depending on the manager's auth configuration.
- Click on the Apply button to save and apply configuration
- If the agent is in the 'pending' status, the above message will be displayed. Clicking on Register agent with Wazuh Manager will attempt to register the agent with the manager. This message will automatically disappear once the registration process is successfully completed.

Active Response - Configuration
To enable the Active Reponse, the option Active Response must be checked in the Services: Wazuh Agent: General page.
Wazuh Manager
- On Wazuh dashboard, go to Management / Configuration: Edit configuration
- Add the following after the last
<command>
block inside the configuration file:
<command><name>opnsense-pf</name> <executable>opnsense-pf</executable> <timeout_allowed>yes</timeout_allowed> </command>
Following, add an active-response block:
<active-response> <disabled>no</disabled> <command>opnsense-pf</command> <location>local</location> <rules_id>5763</rules_id> <timeout>180</timeout> </active-response>
3. Click on the Save button and Restart Manager to apply the configuration.
To test, you can follow this article form Wazuh official documentation.
If everything worked as expected, the source IP will be displayed in Wazuh agent plugin widget and the connections from the test-host will be blocked by OPNsense packet filter.
Managing - Blocked IP addresses

Date Action Source_IP_address Event[rule ID] Mitre_Techniques


Logs
The plugin has two available menus to check logs:
- Log - Active Responses: will display logs related to active response events
- Log - Agent: will display logs from wazuh agent (ossec.log)
Final Thoughts
The Wazuh Agent plugin for OPNsense is a powerful tool that brings active response capabilities and extended logging to this popular open-source firewall. By leveraging the Wazuh stack solution, you can improve your network security posture and quickly respond to security events.
The plugin provides an easy-to-use interface that allows you to configure the Wazuh Agent settings, view the logs, and monitor the active responses. It also includes a custom script for active response that blocks offenders' IP addresses in the OPNsense packet filter.
Cloudfence is a Wazuh official partner and can provide your company with professional support for both Wazuh and OPNsense. Our experts can help you get the most out of your security solutions and ensure that your network is well-protected. Contact us today to learn more about our services!