Slack Notification action
To configure an automation stitch with a Slack Notification action, you first need to configure an incoming webhook in Slack. Then you can enter the webhook URL when you configure the Slack Notification action.
This example uses a Security Rating Summary trigger in the automation stitch with two Slack Notification actions with different notification messages. One message is a custom message, and the other is for the Security Rating Summary log with a 90 second delay.
To create an Incoming Webhook in Slack:
- Go to the Slack website, and create a workspace.
- Create a Slack application for the workspace.
- Add an Incoming Webhook to a channel in the workspace (see Sending messages using Incoming Webhooks for more details).
- Activate the Incoming Webhook, and copy the Webhook URL to the clipboard.
To configure an automation stitch with Slack Notification actions in the GUI:
- Go to Security Fabric > Automation and click Create New.
- Enter a name for the stitch, and select the FortiGate devices that it will be applied to.
- For Trigger, select Security Rating Summary.
- For action, select Slack Notification, and configure the notification settings.
- First action:
Name slack1 Delay 0 URL Paste the webhook URL from the clipboard Message This is test for slack notification.
- Click the + and configure the second action:
Name slack2 Delay 90 URL Paste the webhook URL from the clipboard Message %%log%%
- First action:
- Click OK.
- Run the automation stitch to trigger the action.
To configure an automation stitch with Slack Notification actions in the CLI:
- Create the Slack Notification actions:
config system automation-action
edit "slack1"
set action-type slack-notification
set minimum-interval 0
set delay 0
set required disable
set message "This is test for slack notification."
set uri "hooks.slack.com/services/xxxxxxxxx/xxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx"
next
edit "slack2"
set action-type slack-notification
set minimum-interval 0
set delay 90
set required disable
set message "%%log%%"
set uri "hooks.slack.com/services/xxxxxxxxx/xxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx"
next
end
- Create the automation trigger:
config system automation-trigger
edit "auto-rating"
set trigger-type event-based
set event-type security-rating-summary
next
end
- Configure the automation stitch:
config system automation-stitch
edit "auto-rating"
set status enable
set trigger "auto-rating"
set action "slack1" "slack2"
next
end
- Trigger the automation stitch.
The notification action is triggered in FortiGate.
The message you entered in the automation stitch is delivered to the Slack channel.