Send wazuh alert to telegram by telegram bot.
-
First requirement is you should have working Telegram bot with API KEY and CHAT ID and also fully working Wazuh server.
-
Check reqirements with this command :
#pip install requests
-
Insert your CHAT ID to custom-telegram.py. Copy custom-telegram and custom-telegram.py to /var/ossec/integrations/
-
Set correct permission to those files:
#chown root:wazuh /var/ossec/integrations/custom-telegram*
#chmod 750 /var/ossec/integrations/custom-telegram*
- Insert your API KEY to these line and copy those lines to /var/ossec/etc/ossec.conf
<integration>
<name>custom-telegram</name>
<level>3</level>
<hook_url>https://api.telegram.org/bot<API_KEY>/sendMessage</hook_url>
<alert_format>json</alert_format>
</integration>
- Restart wazuh server
#systemctl restart wazuh-manager