Integration with Microsoft Teams
Sending Report Summary to Teams Channel
You can configure CloudGuard to send summaries to Teams with a HTTP webhook.
Teams Configuration
-
In Teams, create a new channel.
-
From the Channel menu , select Connectors.
-
From the list of connectors, select Incoming Webhook and click Add.
-
In the new window, click Add again.
-
Enter the webhook name, for example, "webhook" and click Create.
-
From the URL field, copy the URL address of the webhook and click Close.
The Teams channel informs you that you have a connection to the Incoming Webhook.
CloudGuard Configuration
-
In CloudGuard, navigate to Settings > Configure > Notifications and click Add Notification.
-
Enter the applicable options as described in Notifications.
-
In the Immediate Notification section, select Send report summary to Teams channel. The field for the Teams webhook URL opens.
-
Paste the URL address from Teams to the field.
-
Click SAVE.
-
From the Posture Management menu, navigate to the Continuous Posture and add a new Policy with the Notification created in the previous steps.
-
To make sure that CloudGuard sends notifications to the channel, from the menu of the newly created policy, select Send all alerts.
-
In the Send All Alerts box that opens, below Notification Type, select Teams Channel and click Send.
-
You can see that CloudGuard sends the notification to your Teams channel. It includes the summary and a maximum of seven of the most critical alerts.
Sending Notifications to Teams Channel through SNS
|
Caution - Depending on the size of your environment and the number of notifications that you receive from CloudGuard, Teams may flag the notification traffic as a DDoS event and block the traffic. For large environments, it is recommended to use Sending Report Summary to Teams Channel instead. |
-
In the Teams application, click Teams on the left-hand pane.
-
Click the + button and select Create team.
-
Select From scratch in the top, select the desired privacy, and set a name for the team.
-
Navigate to the General chat under your new team, click the More options … icon, select Connectors.
-
Add Incoming Webhook.
-
Configure Incoming Webhook: go back to the More options … icon and select Connectors.
-
Set a name for the Webhook and click Create.
-
Copy the Webhook URL to use it in the next step.
-
Navigate to the AWS console, search for Lambda, and click Create function on the top right.
-
Set a name for the function, change Runtime to Python 3.11 (or the latest supported version).
-
Set Architecture to x86_64.
-
Click Create function.
-
Navigate to Code source and replace the existing Python code with the code snippet below. Make sure to replace the default URL (line 7) with your Webhook URL, then click Deploy.
-
Select Copy ARN to use it in the next step.
import urllib3
import json
http = urllib3.PoolManager()
def lambda_handler(event, context):
url = "your webhook here"
msg = {
"text": event['Records'][0]['Sns']['Message']
}
encoded_msg = json.dumps(msg).encode('utf-8')
resp = http.request('POST', url, body=encoded_msg)
print({
"message": event['Records'][0]['Sns']['Message'],
"status_code": resp.status,
"response": resp.data
})
-
Navigate to portal.checkpoint.com and select CloudGuard.
-
Navigate to Settings > Configuration > Integrations.
-
SNS is disabled by default, select Enable.
-
Follow the instructions and copy the environment ID.
-
Leave this window open to complete it after you create an SNS topic.
-
Navigate to the AWS Amazon® Web Services. Public cloud platform that offers global compute, storage, database, application and other cloud services. console, search for sns, select it, navigate to Topics in the right-hand pane, and click Create topic.
-
Select Standard and set a name for the topic.
-
Navigate to Access policy - optional.
-
Below Publishers, select Only the specified AWS accounts from the menu and paste the environment ID from step 4.
-
Select Create topic.
-
Copy the ARN Amazon Resource Names (ARNs) uniquely identify AWS resources. They are required to specify a resource unambiguously across all of AWS, such as in IAM policies, Amazon Relational Database Service (Amazon RDS) tags, and API calls. and paste it into the AWS SNS Events integration window that you have open in CloudGuard.
-
Click SAVE.
-
Back in CloudGuard, navigate to Settings > Configure > Notifications.
-
Click the notification name (or create a new one) where you want to configure SNS integration.
-
Below Immediate Notification, select the option SNS notification for each new finding as soon as it is discovered.
-
Paste your AWS SNS ARN and click Save.
|
Best Practices:
|