Fortinet white logo
Fortinet white logo

Administration Guide

Slack integration webhook

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:
  1. Create an incoming webhook in Slack. See Sending messages using Incoming Webhooks for more information.

  2. Go to Security Fabric > Automation and click Create New.

  3. Enter the stitch name.

  4. Configure the trigger:

    1. Click Add Trigger.

    2. Select Configuration Change.

    3. Click Apply.

  5. Configure the action:

    1. Click Add Action.

    2. Click Create and select Webhook.

    3. 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

    4. Click OK.

    5. Select the action in the list and click Apply.

  6. Click OK.

To create a webhook automation stitch for Slack integration in the CLI:
  1. Create an incoming webhook in Slack. See Sending messages using Incoming Webhooks for more information.

  2. Create the automation trigger:

    config system automation-trigger
        edit "Configuration Change"
            set event-type config-change
        next
    end
  3. 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
            config http-headers
                edit 1
                    set key "Content-type"
                    set value "application/json"
                next
            end
        next
    end
  4. Create the automation stitch:

    config system automation-stitch
        edit "Slack"
            set trigger "Configuration Change"
            config actions
                edit 1
                    set action "send to Slack"
                    set required enable
                next
            end
        next
    end

Slack integration webhook

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:
  1. Create an incoming webhook in Slack. See Sending messages using Incoming Webhooks for more information.

  2. Go to Security Fabric > Automation and click Create New.

  3. Enter the stitch name.

  4. Configure the trigger:

    1. Click Add Trigger.

    2. Select Configuration Change.

    3. Click Apply.

  5. Configure the action:

    1. Click Add Action.

    2. Click Create and select Webhook.

    3. 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

    4. Click OK.

    5. Select the action in the list and click Apply.

  6. Click OK.

To create a webhook automation stitch for Slack integration in the CLI:
  1. Create an incoming webhook in Slack. See Sending messages using Incoming Webhooks for more information.

  2. Create the automation trigger:

    config system automation-trigger
        edit "Configuration Change"
            set event-type config-change
        next
    end
  3. 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
            config http-headers
                edit 1
                    set key "Content-type"
                    set value "application/json"
                next
            end
        next
    end
  4. Create the automation stitch:

    config system automation-stitch
        edit "Slack"
            set trigger "Configuration Change"
            config actions
                edit 1
                    set action "send to Slack"
                    set required enable
                next
            end
        next
    end