Technical Tip: FortiWeb notification alert send to Telegram
Description
This article describes how to send an alert to Telegram application using a webhook from FortiWeb.

 
Scope
FortiWeb, Telegram.
Solution
- Create a Telegram bot and get a Bot Token.

 
- Create a Telegram group and add a bot created initially into the group. Take note of the group ID, for this example web.telegram.org/k/#-4703356725.


- Create a webhook Automation Action in FortiWeb, go to Security Fabric -> Automation -> Action -> Create New -> General -> Webhook.

 
Fill up the attributes as in the following format (for this example):
| Name | fwb_telegram |
| Protocol | HTTPS |
| URL | api.telegram.org/bot<Bot Token>/sendMessage |
| Method | POST |
| HTTP Body | {"chat_id":"<Group ID>","text": "Failed to logged in, here is the full event log: %%log%%"} |
| HTTP Header | Content-Type:application/json |
 
- Create a Stitch that will trigger the action to send the logs to Telegram. Go to Security Fabric -> Automation -> Stich -> Create New.

Make sure the Triggers are chosen correctly to select the correct logs to trigger with.
Security Fabric -> Automation -> Trigger -> Create New.

 
- Trigger the event and observed the logs in Event Logs and alert sent to Telegram.


Related articles:
