Configure Microsoft Teams Webhook Connector

You can configure a webhook connector in the Alert Logic console to send notifications to Microsoft Teams in near real time. When you set up a notification and subscribe a webhook connector, the connector sends the event to the target URL you configured and creates a message in Microsoft Teams automatically.

Alert Logic notifications alert you to threats, changes, and scheduled events in your environment so you can respond quickly. From the Alert Logic console, you can subscribe your Microsoft Teams webhook to receive:

Complete the following steps to successfully send messages to Microsoft Teams:

  1. Generate the target URL
  2. (Optional) Customize the payload template
  3. Create the Microsoft Teams webhook connector from the Alert Logic console
  4. Subscribe your webhook to receive notifications

Generate the target URL

Before you create the webhook connector in the Alert Logic console, complete the instructions in the Microsoft Teams documentation to generate the incoming webhook URL. Copy the URL, which you must paste into the Target URL field.

(Optional) Customize the payload template

Decide which type of security information that you want Alert Logic to send to Microsoft Teams: Incident, Observation (of a log correlation), or a Scheduled Report Notification payload.

If you want to send more than one payload type, you must configure a connector for each one. Because the payload is different, each payload type requires a separate connector instance.

Alert Logic provides a payload template for an incident and an observation in JSON format using Mustache template-like transformations where a field in the JSON payload can be referenced by enclosing it in braces ({{}}. For example, the threatRating field in the following JSON {'incident': {'threat.Rating': "critical"}} is specified as {{incident.threatRating}}. A payload template converts the Alert Logic security information to the format expected by Microsoft Teams. You can add or remove lines in the sample template to meet your workflow requirements and security goals. If you want to create a Microsoft Teams connector for scheduled report notifications, you will need to configure the payload template.

For definitions of the Alert Logic variables in the templates and the full JSON that you can use to configure your payload template in JQ or JSON format, see:

For more information about Mustache, see the Mustache Manual. For more complex transformations, you can use JQ. A helpful website for converting JSON to JQ is jq play.

Incident payload template

Copy

JSON Template

{
    "@context": "https://schema.org/extensions",
    "@type": "MessageCard",
    "themeColor": "0072C6",
    "title": "Alert Logic Incident Created",
    "summary": "Incident Created Card",
    "sections": [{
        "activityTitle": "{{incident.summary}}",
        "activitySubtitle": "ID: {{humanFriendlyId}} | Customer: {{customer}} | Deployment: {{assets.al__deployment}}",
        "facts": [{
                "name": "Threat Rating",
                "value": "{{incident.threatRating}}"
            }, {
                "name": "Incident ID",
                "value": "{{humanFriendlyId}}"
            }, {
                "name": "Escalated:",
                "value": "{{incident.escalated}}"
            }, {
                "name": "Recommendations:",
                "value": "{{incident.recommendations}}"
            }
        ],
        "text": "{{incident.description}}"
    }],
    potentialAction": [{
        "@type": "OpenUri",
        "name": "See Incident in Alert Logic",
        "targets": [{
            "os": "default",
            "uri": "{{extra.incidentUrl}}"
        }]
    }]
}

Observation payload template

Copy

JSON Template

{
    "@context": "https://schema.org/extensions",
    "@type": "MessageCard",
    "themeColor": "0072C6",
    "title": "Alert Logic Observation Created",
    "summary": "Incident Created Card",
    "sections": [{
        "activityTitle": "**Summary**: {{fields.summary}}",
        "activitySubtitle": "**Customer:** {{id.account}} | **ID:** {{fields.id}}",
        "facts": [{
                "name": "Severity:",
                "value": "{{fields.severity}}"
            }, {
                "name": "Class:",
                "value": "{{fields.class}}"
            }, {
                "name": "Subclass:",
                "value": "{{fields.subclass}}"
            }, {
                "name": "Recommendations:",
                "value": "{{fields.recommendations}}"
            }, {
                "name": "Message:",
                "value": ">{{fields.keys.message}}",
                "wrap": true
            }
        ],
        "text": "**Description:** {{fields.desc}}"
    }]
}

Create the Microsoft Teams webhook connector from the Alert Logic console

After you generate the target URL and optionally customize the payload template, the next step is to create the webhook in the Alert Logic console and test the payload.

To create a Microsoft Teams webhook connector:

  1. In the Alert Logic console, click the Settings icon (), and then click Connectors.
  2. On the Connectors page, click the add icon (), and then click Microsoft Teams.
  3. On the Create a Microsoft Teams Connector page, type a descriptive name for the webhook connectorfor example, "Microsoft Teams Webhook Connector for Incidents."
  4. In Target URL, paste the URL that you copied earlier.
  5. Choose the Payload Type, which is the type of Alert Logic security information that you want to send: Incident, Observation (of a log correlation), or Scheduled Report Notification.
  6. Choose the format of the payload template you customized earlier: JSON or JQ.
  7. Enter the payload template that you customized.
  8. A red bar next to a line indicates a syntax error. Code with errors is underlined with a jagged red line. You can hover the pointer over the underlined code to view a tip about the error.
  9. Click TEST to send a test webhook request to the target URL provided. For more information, see Connector test results.
  10. If your webhook connector sent the test event to the target URL successfully, click SAVE.

Connector test results

If you receive a message that the connector was successfully tested, Alert Logic sends the payload template you configured and populates a message in Microsoft Teams with sample data. Check Microsoft Teams to ensure the results are expected, and adjust the payload template if necessary.

If the test is unsuccessful, Alert Logic displays an error message. For server response errors, you can use the error code and message that Alert Logic passes through to troubleshoot the issue. Alert Logic also informs you if your JSON or JQ payload template contains syntax errors.

Subscribe your webhook to receive notifications

After you test and save the connector configuration, the last step is to set up your notification criteria and subscribe the webhook.

You can set up and manage a notification of any type directly from the Notifications page. For more information, see Manage Notifications. You can create notifications from other pages according to notification type:

  • For incidents, you can also create a notification from the Incidents page. For more information, see Incident Notifications.
  • For observations, you can also create a notification from the Search page (Log Search tab or Correlations tab) during the process of creating the correlation or by editing an existing correlation listed on the Correlations tab. For more information, see Correlations and Notifications and Observation Notifications.
  • For scheduled reports, you can also schedule the report and subscribe notification recipients from the Reports page. For more information, see Scheduled Reports and Notifications.

Manage your connectors

You can view the list of connectors and edit or delete an existing one. For more information, see Manage Connectors.