Hi!
Thanks to the integrator daemon, Wazuh can be connected with different APIs such as Slack, Virustotal, Telegram, or custom ones.
To configure it you just need to add an integration block in your ossec.conf file as follows:
<!--Custom external Integration -->
<integration>
<name>custom-telegram</name>
<level>10</level>
<api_key>APIKEY</api_key>
<alert_format>json</alert_format>
</integration>
APIKEY should be your Telegram API URL that will be passed to your custom script as an argument.
Then you need to create a script in /var/ossec/integrations that must start with custom- (I.E: custom-telegram).
This script can be written in your preferred programming language and will be used to parse the received alert and communicate with your API.
Here you can check some examples:
In order to test the script before testing it with the integration block, you can execute it manually and pass to it a dummy alert in .json format as an argument.
Also, integratord has a debug mode that can be enabled in order to help you debug any kind of error that you find during testing.
To enable it, go to /var/ossec/etc/internal_options.conf and change the integrator.debug value from 0 to 2.
Here you can see some documentation about integratord and internal options:
Hope that this helps!
Best regards,
Josemi.