Skip to content

Commit 07d35a0

Browse files
authored
Merge pull request #227431 from limwainstein/cloudwatch-lambda-procedure
Adding page for CloudWatch Lambda function
2 parents 9dbcf24 + 39f418c commit 07d35a0

9 files changed

+73
-3
lines changed

articles/sentinel/TOC.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@
250250
items:
251251
- name: Amazon Web Services logs
252252
href: connect-aws.md
253+
items:
254+
- name: Send CloudWatch events via Lambda function
255+
href: cloudwatch-lambda-function.md
253256
- name: Azure Active Directory
254257
href: connect-azure-active-directory.md
255258
- name: Microsoft Defender for Cloud
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Ingest CloudWatch logs to Microsoft Sentinel - create a Lambda function to send CloudWatch events to S3 bucket
3+
description: In this article, you create a Lambda function to send CloudWatch events to an S3 bucket.
4+
author: limwainstein
5+
ms.author: lwainstein
6+
ms.service: microsoft-sentinel
7+
ms.topic: how-to
8+
ms.date: 02/09/2023
9+
#Customer intent: As a security operator, I want to create a Lambda function to send CloudWatch events to S3 bucket so I can convert the format to the format accepted by Microsoft Sentinel.
10+
---
11+
12+
# Create a Lambda function to send CloudWatch events to an S3 bucket
13+
14+
In some cases, your CloudWatch logs may not match the format accepted by Microsoft Sentinel - .csv file in a GZIP format without a header. In this article, you use a [lambda function](https://github.com/Azure/Azure-Sentinel/blob/master/DataConnectors/AWS-S3/CloudWatchLanbdaFunction.py) within the Amazon Web Services (AWS) environment to send [CloudWatch events to an S3 bucket](connect-aws.md), and convert the format to the accepted format.
15+
16+
## Create the lambda function
17+
18+
The lambda function uses Python 3.9 runtime and x86_64 architecture.
19+
20+
1. In the AWS Management Console, select the lambda service.
21+
1. Select **Create function**.
22+
23+
:::image type="content" source="media/cloudwatch-lambda-function/lambda-basic-information.png" alt-text="Screenshot of the AWS Management Console Basic information screen." lightbox="media/cloudwatch-lambda-function/lambda-basic-information.png":::
24+
25+
1. Type a name for the function and select **Python 3.9** as the runtime and **x86_64** as the architecture.
26+
1. Select **Create function**.
27+
1. Under **Choose a layer**, select a layer and select **Add**.
28+
29+
:::image type="content" source="media/cloudwatch-lambda-function/lambda-add-layer.png" alt-text="Screenshot of the AWS Management Console Add layer screen." lightbox="media/cloudwatch-lambda-function/lambda-add-layer.png":::
30+
31+
1. Select **Permissions**, and under **Execution role**, select **Role name**.
32+
1. Under **Permissions policies**, select **Add permissions** > **Attach policies**.
33+
34+
:::image type="content" source="media/cloudwatch-lambda-function/lambda-permissions.png" alt-text="Screenshot of the AWS Management Console Permissions tab." lightbox="media/cloudwatch-lambda-function/lambda-permissions.png":::
35+
36+
1. Search for the *AmazonS3FullAccess* and *CloudWatchLogsReadOnlyAccess* policies and attach them.
37+
38+
:::image type="content" source="media/cloudwatch-lambda-function/lambda-other-permissions-policies.png" alt-text="Screenshot of the AWS Management Console Add permissions policies screen." lightbox="media/cloudwatch-lambda-function/lambda-other-permissions-policies.png":::
39+
40+
1. Copy the code link from the [source file](https://github.com/Azure/Azure-Sentinel/blob/master/DataConnectors/AWS-S3/CloudWatchLanbdaFunction.py).
41+
1. Return to the function, select **Code**, and paste the code link under **Code source**.
42+
43+
:::image type="content" source="media/cloudwatch-lambda-function/lambda-code-source.png" alt-text="Screenshot of the AWS Management Console Code source screen." lightbox="media/cloudwatch-lambda-function/lambda-code-source.png":::
44+
45+
1. Fill the parameters as required.
46+
1. Select **Deploy**, and then select **Test**.
47+
1. Create an event by filling in the required fields.
48+
49+
:::image type="content" source="media/cloudwatch-lambda-function/lambda-configure-test-event.png" alt-text="Screenshot of the AWS Management Configure test event screen." lightbox="media/cloudwatch-lambda-function/lambda-configure-test-event.png":::
50+
51+
1. Select **Test** to see how the event appears in the S3 bucket.
52+
53+
## Next steps
54+
55+
In this document, you learned how to create a Lambda function to send CloudWatch events to an S3 bucket. To learn more about Microsoft Sentinel, see the following articles:
56+
- Learn how to [get visibility into your data, and potential threats](get-visibility.md).
57+
- Get started [detecting threats with Microsoft Sentinel](detect-threats-built-in.md).
58+
- [Use workbooks](monitor-your-data.md) to monitor your data.

articles/sentinel/connect-aws.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ ms.date: 12/12/2022
77
ms.author: yelevin
88
---
99

10-
---
11-
1210
# Connect Microsoft Sentinel to Amazon Web Services to ingest AWS service log data
1311

1412
Use the Amazon Web Services (AWS) connectors to pull AWS service logs into Microsoft Sentinel. These connectors work by granting Microsoft Sentinel access to your AWS resource logs. Setting up the connector establishes a trust relationship between Amazon Web Services and Microsoft Sentinel. This is accomplished on AWS by creating a role that gives permission to Microsoft Sentinel to access your AWS logs.
@@ -26,7 +24,18 @@ This connector is available in two versions: the legacy connector for CloudTrail
2624
2725
# [S3 connector (new)](#tab/s3)
2826

29-
This document explains how to configure the new AWS S3 connector. The process of setting it up has two parts: the AWS side and the Microsoft Sentinel side.
27+
This article explains how to configure the new AWS S3 connector. The process of setting it up has two parts: the AWS side and the Microsoft Sentinel side.
28+
29+
## Prerequisites
30+
31+
Make sure that the logs from your selected AWS service use the format accepted by Microsoft Sentinel:
32+
33+
- **Amazon VPC**: .csv file in GZIP format with headers; delimiter: space.
34+
- **Amazon GuardDuty**: json-line and GZIP formats.
35+
- **AWS CloudTrail**: .json file in a GZIP format.
36+
- **CloudWatch**: .csv file in a GZIP format without a header. If you need to convert your logs to this format, you can use this [CloudWatch lambda function](cloudwatch-lambda-function.md).
37+
38+
## Connect the S3 connector
3039

3140
- In your AWS environment:
3241

97 KB
Loading
54.7 KB
Loading
98.4 KB
Loading
120 KB
Loading
131 KB
Loading
65.8 KB
Loading

0 commit comments

Comments
 (0)