Configure Microsoft Teams Templated Connection
You can configure a templated connection in the Alert Logic console to send notifications to Microsoft Teams. When you set up a notification and subscribe a templated connection, Alert Logic sends the event to the 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 templated connection to receive:
- Incident notifications—Send a message when incidents occur that meet specific criteria, such as escalated incidents.
- Log correlation notifications—Send a message when your log correlation rules trigger an incident or observation.
- Health Notifications—Send a message when an agent, appliance, or API collector is collecting data or offline (unhealthy).
- Scheduled report notifications—Send a message when Alert Logic generates a scheduled report that is available for download.
Complete the following steps to successfully send messages to Microsoft Teams:
- Identify the connection
- (Optional) Identify your Teams URL path
- (Optional) Customize the payload template
- Create the Microsoft Teams templated connection from the Alert Logic console
- Subscribe your templated connection to receive notifications
Identify the connection
This templated connection requires a Microsoft Teams connection, which stores authentication and credential information that grants Alert Logic access to Microsoft Teams. If you do not have the connection already, you can create it now or when you create the templated connection.
For more information, see Configure Microsoft Teams Connection.
(Optional) Identify your Teams URL path
The URL Path field in the templated connection configuration is blank by default. The connection defines the required URL (for more information, see Configure Microsoft Teams Connection). Advanced API integration targeting can be done by modifying the URL path.
(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), Scheduled Report Notification, or Health Notification payload.
Alert Logic provides a template for each payload type 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.
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:
- Incident Schema
- Correlation Rule Observation Schema
- Scheduled Report Notification Schema
- Health Schema
Incident payload template
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": "GO TO INCIDENT IN ALERT LOGIC",
"targets": [
{
"os": "default",
"uri": "{{extra.incidentUrl}}"
}
]
}
]
}
Observation payload template
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:** {{fields.account_id}} | **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}}",
"wrap": true
}
],
"text": "**Description:** {{fields.desc}}"
}
]
}
Scheduled Report Notification payload template
JSON Template
{
"@context": "https://schema.org/extensions",
"@type": "MessageCard",
"themeColor": "0072C6",
"title": "Alert Logic Scheduled Report Completed",
"summary": "Scheduled Report Completed Card",
"sections": [
{
"activityTitle": "{{name}}",
"activitySubtitle": "Type: {{artifact_data.metadata.report_type}} | Customer: {{artifact_data.metadata.customer_name}} | Customer ID: {{account_id}}",
"facts": [
{
"name": "Cadence",
"value": "{{artifact_data.metadata.cadence}}"
},
{
"name": "Created On",
"value": "{{artifact_data.metadata.artifact_create_date}}"
}
],
"text": "{{artifact_data.metadata.report_description}}"
}
],
"potentialAction": [
{
"@type": "OpenUri",
"name": "View Report",
"targets": [
{
"os": "default",
"uri": "{{extra.ui_url}}"
}
]
},
{
"@type": "OpenUri",
"name": "Download Report",
"targets": [
{
"os": "default",
"uri": "{{extra.download_url}}"
}
]
}
]
}
Health Notification payload template
JSON Template
{
"@context": "https://schema.org/extensions",
"@type": "MessageCard",
"themeColor": "0072C6",
"title": "Alert Logic Health Notification",
"summary": "Health Notification Card",
"sections": [
{
"activityTitle": "{{report_description}}",
"activitySubtitle": "Customer: {{customer_account_name}} | Account ID: {{cid}}",
"facts": [
{
"name": "Resolution",
"value": "{{resolution}}"
},
{
"name": "Remediation Id",
"value": "{{remediation_id}}"
},
{
"name": "Deployment",
"value": "{{deployment_name}}"
},
{
"name": "Target Asset Type",
"value": "{{target_asset_type}}"
},
{
"name": "Exposure Impact",
"value": "{{exposure_impact}}"
}
],
"text": "{{report_description}} | {{resolution}} "
}
]
}
Create the Microsoft Teams templated connection from the Alert Logic console
The next step is to create the templated connection in the Alert Logic console and test the payload.
To create a Microsoft Teams templated connection:
- In the Alert Logic console, click the navigation menu icon (), click Configure, and then click Connections.
- Click the Templated Connections tab.
- On the Templated Connections page, click the add icon (), and then click Microsoft Teams.
- On the Create a Microsoft Teams Templated Connection page, type a descriptive name for the templated connection—for example, "Microsoft Teams Templated Connection for Incidents."
- In Connection, select or create a Microsoft Teams connection.
- Leave URL Path blank, or enter the path identified earlier.
- Select the Payload Type, which is the type of Alert Logic security information that you want to send: Incident, Observation (of a log correlation), Scheduled Report Notification, or Health Notification.
- Select the format of the payload template you customized earlier: JSON or JQ.
- Select an HTTP verb for the templated connection payload. If you are unsure, leave it as the default verb: POST.
- In the Payload Template area, enter the payload template that you customized.
- Click TEST to send a test event to the URL provided. For more information about test results, see the next section.
- If your templated connection sent the test event to the target URL successfully, click SAVE.
Test results
If you receive a message that the templated connection was successfully tested, Alert Logic sent the payload template you configured and populated 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 templated connection to receive notifications
After you test and save the templated connection configuration, the last step is to set up your notification criteria and subscribe the templated connection.
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 health exposures, you can also create a notification from the Health page. For more information, see Health 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 templated connections
You can view the list of templated connections and edit or delete an existing one. For more information, see Manage Templated Connections.