Hi again.
Thanks for the output of the commands. In your case, you should use the
bluetoothctl paired-devices.
With this information, and after testing it in my system, you should have the following configurations to solve this issue.
In the /var/ossec/etc/rules/local_rules.xml file of the manager:
<rule id="100002" level="10">
<if_sid>530</if_sid>
<match>ossec: output: 'bluetooth'</match>
<description>Bluetooth devices changed</description>
<check_diff />
</rule>
Please notice that the if_sid tag has been added. This makes the new rule a child rule of the process monitoring rules. Besides, change the ID of the rule if you have an existing rule with that ID.
In the ossec.conf file of the Wazuh agent:
<localfile>
<log_format>full_command</log_format>
<command>echo "Bluetooth: " && bluetoothctl paired-devices | sort</command>
<alias>bluetooth</alias>
<frequency>60</frequency>
</localfile>
Notice that the value of the frequency tag is an example, it indicates the frequency (in seconds) of the execution of that command. Please, modify it to your preferences.
After these modifications, restart the Wazuh agent and the Wazuh manager, and you should see an alert in your Wazuh dashboard if you modify the connected Bluetooth devices. I have attached an alert generated in my system.