FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
JavierM_CL
Staff
Staff
Article Id 337676
Description

This article describes how to configure FortiGate and Teams to receive event notifications. It will be used automation stitches along with the available webhooks from Teams Workflows.

Scope

It is possible to take advantage of any generated log at FortiOS such as Event Logs, SD-WAN logs, WiFi Events, General System Events, etc. to send a webhook to Teams.

Solution

On Teams:

  1. Open Workflows in the Teams Channel chosen.

 

TeamsChannel-WF.png

 

  1. Select 'Post card to channel in Microsoft Teams when webhook request is received', and name it as needed.

     

  2. Select Teams and Teams Channel and add workflow.

     

    select teams channel and add workflow.png

     

  3. Copy and save the generated URL for later use.

     

    On FortiGate:

     

  4. In this example, it is used an SD-WAN health check log: 'Member status changed. Member out-of-sla'. As the notification trigger.

    Go to Security Fabric -> Automation -> Stitch -> Create New:

    Select Add Trigger, create FortiOS Event Log.

     

    create fortioseventlog.png

     

     

  5. Input Name and select Event: 'SDWAN status', fill in the Field filter with: 'msg' and value: 'Member status changed. Member out-of-sla.' then click OK:

     

     select status information.png

     

     

  6. Select Add Action, create, and select 'Webhook':

     

    select webhook.png

     

     

  7. Name it and:

    Paste the previously saved URL.

    Hint: remove the ':443' text from the domain.

    Select protocol: HTTPS.

    pasteURLhttps.png

     

     

  8. Next, in the HTTP body field paste the following JSON Code, and select OK:

    {
    "type":"message",
    "attachments":[
    {
    "contentType":"application/vnd.microsoft.card.adaptive",
    "contentUrl":null,
    "content":{
    "$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
    "type":"AdaptiveCard",
    "version":"1.2",
    "body":[
    {
    "type": "TextBlock",
    "text": '**%%devname%%** has reported: '
    },
    {
    "type": "TextBlock",
    "text": '**%%logdesc%%**'
    },
    {
    "type": "TextBlock",
    "text": '%%msg%%'
    },
    {
    "type": "TextBlock",
    "text": 'HealthCheck is: **%%healthcheck%%** ',
    "wrap": true
    },
    {
    "type": "TextBlock",
    "text": 'Member ID is: **%%member%%** ',
    "wrap": true
    },
    {
    "type": "TextBlock",
    "text": 'SLA Target ID is: **%%slatargetid%%** ',
    "wrap": true
    }
    ]
    }
    }
    ]

     

     

  9. The stitch should look like this, select OK:

    configured stitch.png

     

     

  10. Finally, SLA change notifications are received in the Teams Channel:

     

    Teamsnotification.png