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 a Security Rating Summary 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.
-
Find 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, select the Stitch tab, and click Create New.
-
Enter the stitch name.
-
Configure the Security Rating Summary trigger:
-
Click Add Trigger.
-
Click Create and select Security Rating Summary.
-
Enter a name, and for Report, select Security Posture.
-
Click OK.
-
Select the trigger in the list and 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 FortiProxy. The two notifications are sent to the Microsoft Teams channel.
-
To configure an automation stitch with Microsoft Teams Notification actions in the CLI:
- Configure the automation trigger:
config system automation-trigger edit "Teams_action" set event-type security-rating-summary 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 "Teams_action" 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:Tue Sep 13 12:09:12 2022 last relay: actions: teams_1: done: 2 relayed to: 0 relayed from: 0 last trigger:Tue Sep 13 12:09:12 2022 last relay: teams_2: done: 2 relayed to: 0 relayed from: 0 last trigger:Tue Sep 13 12:09:12 2022 last relay: logid2stitch mapping: id:52000 local hit: 22 relayed hits: 0 Teams_action