Microsoft Teams Notification action
Microsoft Teams Notification actions can be configured to send notifications to channels in Microsoft Teams. To trigger the notifications, you need to add an Incoming Webhook connector to a channel in Microsoft Teams, then you can configure the automation stitch with the webhook URL.
In the following example, you will configure an automation stitch with the default Any Security Rating Notification trigger and two Microsoft Teams Notification actions with different notification messages. One message is for the Security Rating Summary log, and the other is a custom message with a ten second delay.
To add the Incoming Webhook connector in a Microsoft Teams channel:
- In Microsoft Teams, click the ... (More options) beside the channel name, and select Connectors.
- Search for Incoming Webhook and click Configure.
- Enter a name for the webhook, upload an image for the webhook, and click Create.
- Copy the webhook to the clipboard and save it.
- Click Done.
To configure an automation stitch with Microsoft Teams Notification actions in the GUI:
- Go to Security Fabric > Automation and click Create New.
- Enter the stitch name.
- Configure the trigger:
- Click Add Trigger.
- Select Any Security Rating Notification.
- Click Apply.
- Configure the first Microsoft Teams Notification action:
- Click Add Action.
- Click Create and select Microsoft Teams Notification.
- Enter the following:
Name
teams_1
URL
Paste the webhook URI from the clipboard
Message
Text
Message text
%%log%%
- Click OK.
- Select the action in the list and click Apply.
- Configure the second Microsoft Teams Notification action:
- Click Add Action.
- Click Create and select Microsoft Teams Notification.
- Enter the following:
Name
teams_2
URL
Paste the webhook URI from the clipboard
Message
Text
Message text
This is for test.
- Click OK.
- Select the action in the list and click Apply.
- Click the Add delay located between both actions. Enter 10 and click OK.
- Click OK.
- Trigger the automation stitch:
- Right-click the automation stitch and select Test Automation Stitch.
After the Security Rating report is finished, the automation is triggered and an event log is created by the FortiGate. The two notifications are sent to the Microsoft Teams channel.
- Right-click the automation stitch and select Test Automation Stitch.
To configure an automation stitch with Microsoft Teams Notification actions in the CLI:
- Configure the automation trigger:
config system automation-trigger edit "Any Security Rating Notification" set event-type security-rating-summary set report-type any next end
- Configure the automation actions:
config system automation-action edit "teams_1" set action-type microsoft-teams-notification set uri "outlook.office.com/webhook/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx@xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/IncomingWebhook/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" next edit "teams_2" set action-type microsoft-teams-notification set message "This is for test." set uri "outlook.office.com/webhook/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx@xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/IncomingWebhook/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" next end
- Configure the automation stitch:
config system automation-stitch edit "Teams_action" set trigger "Any Security Rating Notification" config actions edit 1 set action "teams_1" set required enable next edit 2 set action "teams_2" set delay 10 set required enable next end next end
- Verify that the automation action was triggered:
# diagnose test application autod 3
stitch: Teams_action
local hit: 2 relayed to: 0 relayed from: 0
last trigger:Mon Nov 16 10:28:08 2020
last relay:
actions:
teams_1:
done: 2 relayed to: 0 relayed from: 0
last trigger:Mon Nov 16 10:28:08 2020
last relay:
teams_2:
done: 2 relayed to: 0 relayed from: 0
last trigger:Mon Nov 16 10:28:08 2020
last relay:
logid2stitch mapping:
id:52000 local hit: 22 relayed hits: 0
Teams_action