Slack integration webhook
A webhook can be created to post messages and notifications to Slack.
In this example, a configuration change triggers the FortiGate to post a message to Slack.
To create a webhook automation stitch for Slack integration in the GUI:
- Create an incoming webhook in Slack. See Sending messages using Incoming Webhooks for more information.
- Go to Security Fabric > Automation and click Create New.
- Enter the stitch name.
- Configure the trigger:
- Click Add Trigger.
- Click Create and select Configuration Change.
- Enter a name (config change).
- Click OK.
- Select the trigger in the list and click Apply.
- Configure the action:
- Click Add Action.
- Click Create and select Webhook.
- Enter the following:
Name
send to Slack
Protocol
HTTPS
URL
Enter the incoming webhook URL created in Slack
Custom port
Enable and enter 443
Method
POST
HTTP body
{\"channel\": \"#delivery\", \"username\": \"tleela\", \"text\": \"Configuration changed\", \"icon_emoji\": \":worried:\"}
HTTP header
Content-type : application/json
- Click OK.
- Select the action in the list and click Apply.
- Click OK.
To create a webhook automation stitch for Slack integration in the CLI:
-
Create an incoming webhook in Slack. See Sending messages using Incoming Webhooks for more information.
- Create the automation trigger:
config system automation-trigger edit "config change" set event-type config-change next end
- Create the automation action:
config system automation-action edit "send to Slack" set action-type webhook set protocol https set uri "hooks.slack.com/services/XXXXXXXX" set http-body "{\"channel\": \"#delivery\", \"username\": \"tleela\", \"text\": \"Configuration changed\", \"icon_emoji\": \":worried:\"}" set port 443 set headers "Content-type:application/json" next end
- Create the automation stitch:
config system automation-stitch edit "Slack" set trigger "config change" set action "send to Slack" next end