Skip to content

Commit cf5e732

Browse files
authored
Merge pull request #264792 from yelevin/yelevin/connect-aws-fix-gov
Added gov cloud compatibility
2 parents 2e3f5dd + 4af063f commit cf5e732

File tree

1 file changed

+89
-24
lines changed

1 file changed

+89
-24
lines changed

articles/sentinel/connect-aws.md

Lines changed: 89 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
title: Connect Microsoft Sentinel to Amazon Web Services to ingest AWS service log data
33
description: Use the AWS connector to delegate Microsoft Sentinel access to AWS resource logs, creating a trust relationship between Amazon Web Services and Microsoft Sentinel.
44
author: yelevin
5-
ms.topic: how-to
6-
ms.date: 12/12/2022
75
ms.author: yelevin
6+
ms.topic: how-to
7+
ms.date: 01/31/2024
88
---
99

1010
# Connect Microsoft Sentinel to Amazon Web Services to ingest AWS service log data
@@ -54,6 +54,8 @@ This graphic and the following text show how the parts of this connector solutio
5454

5555
- To connect to the SQS queue and the S3 bucket, Microsoft Sentinel uses AWS credentials and connection information embedded in the AWS S3 connector's configuration. The AWS credentials are configured with a role and a permissions policy giving them access to those resources. Similarly, the Microsoft Sentinel workspace ID is embedded in the AWS configuration, so there is in effect two-way authentication.
5656

57+
For customers in **Azure Government clouds**, Microsoft Sentinel uses a federated web identity provider (Microsoft Entra ID) for authenticating with AWS through OpenID Connect (OIDC), and assuming an AWS IAM role.
58+
5759
## Connect the S3 connector
5860

5961
- **In your AWS environment:**
@@ -70,7 +72,7 @@ This graphic and the following text show how the parts of this connector solutio
7072

7173
- **In Microsoft Sentinel:**
7274

73-
- Enable and configure the **AWS S3 Connector** in the Microsoft Sentinel portal. See the instructions below.
75+
- Enable and configure the **AWS S3 Connector** in the Microsoft Sentinel portal. [See the instructions below](#add-the-aws-role-and-queue-information-to-the-s3-data-connector).
7476

7577
## Automatic setup
7678

@@ -86,6 +88,8 @@ The script takes the following actions:
8688

8789
- Configures any necessary IAM permissions policies and applies them to the IAM role created above.
8890

91+
For Azure Government clouds, a specialized script first creates an OIDC identity provider, to which it assigns the IAM assumed role. It then performs all the other steps above.
92+
8993
### Prerequisites for automatic setup
9094

9195
- You must have PowerShell and the AWS CLI on your machine.
@@ -103,10 +107,14 @@ To run the script to set up the connector, use the following steps:
103107
If you don't see the connector, install the Amazon Web Services solution from the **Content Hub** in Microsoft Sentinel.
104108

105109
1. In the details pane for the connector, select **Open connector page**.
110+
106111
1. In the **Configuration** section, under **1. Set up your AWS environment**, expand **Setup with PowerShell script (recommended)**.
107112

108113
1. Follow the on-screen instructions to download and extract the [AWS S3 Setup Script](https://github.com/Azure/Azure-Sentinel/blob/master/DataConnectors/AWS-S3/ConfigAwsS3DataConnectorScripts.zip?raw=true) (link downloads a zip file containing the main setup script and helper scripts) from the connector page.
109114

115+
> [!NOTE]
116+
> For ingesting AWS logs into an **Azure Government cloud**, download and extract [this specialized AWS S3 Gov Setup Script](https://github.com/Azure/Azure-Sentinel/blob/master/DataConnectors/AWS-S3/ConfigAwsS3DataConnectorScriptsGov.zip?raw=true) instead.
117+
110118
1. Before running the script, run the `aws configure` command from your PowerShell command line, and enter the relevant information as prompted. See [AWS Command Line Interface | Configuration basics](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html) (from AWS documentation) for details.
111119

112120
1. Now run the script. Copy the command from the connector page (under "Run script to set up the environment") and paste it in your command line.
@@ -137,19 +145,19 @@ Microsoft recommends using the automatic setup script to deploy this connector.
137145

138146
### Prepare your AWS resources
139147

140-
- Create an **S3 bucket** to which you will ship the logs from your AWS services - VPC, GuardDuty, CloudTrail, or CloudWatch.
148+
1. Create an **S3 bucket** to which you will ship the logs from your AWS services - VPC, GuardDuty, CloudTrail, or CloudWatch.
141149

142150
- See the [instructions to create an S3 storage bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html) in the AWS documentation.
143151

144-
- Create a standard **Simple Queue Service (SQS) message queue** to which the S3 bucket will publish notifications.
152+
1. Create a standard **Simple Queue Service (SQS) message queue** to which the S3 bucket will publish notifications.
145153

146154
- See the [instructions to create a standard Simple Queue Service (SQS) queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/creating-sqs-standard-queues.html) in the AWS documentation.
147155

148-
- Configure your S3 bucket to send notification messages to your SQS queue.
156+
1. Configure your S3 bucket to send notification messages to your SQS queue.
149157

150158
- See the [instructions to publish notifications to your SQS queue](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-event-notifications.html) in the AWS documentation.
151159

152-
### Create an AWS assumed role and grant access to the AWS Sentinel account
160+
### Install AWS data connector and prepare environment
153161

154162
1. In Microsoft Sentinel, select **Data connectors** from the navigation menu.
155163

@@ -161,24 +169,79 @@ Microsoft recommends using the automatic setup script to deploy this connector.
161169

162170
1. Under **Configuration**, expand **Setup with PowerShell script (recommended)**, then copy the **External ID (Workspace ID)** to your clipboard.
163171

164-
1. In a different browser window or tab, open the AWS console. Follow the [instructions in the AWS documentation for creating a role for an AWS account](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html).
165-
166-
- For the account type, instead of **This account**, choose **Another AWS account**.
167-
168-
- In the **Account ID** field, enter the number **197857026523** (you can copy and paste it from here). This number is **Microsoft Sentinel's service account ID for AWS**. It tells AWS that the account using this role is a Microsoft Sentinel user.
169-
170-
- In the options, select **Require external ID** (*do not* select *Require MFA*). In the **External ID** field, paste your Microsoft Sentinel **Workspace ID** that you copied in the previous step. This identifies *your specific Microsoft Sentinel account* to AWS.
171-
172-
- Assign the necessary permissions policies. These policies include:
173-
- `AmazonSQSReadOnlyAccess`
174-
- `AWSLambdaSQSQueueExecutionRole`
175-
- `AmazonS3ReadOnlyAccess`
176-
- `ROSAKMSProviderPolicy`
177-
- Additional policies for ingesting the different types of AWS service logs.
178-
179-
For information on these policies, see the [AWS S3 connector permissions policies page](https://github.com/Azure/Azure-Sentinel/blob/master/DataConnectors/AWS-S3/AwsRequiredPolicies.md) in the Microsoft Sentinel GitHub repository.
172+
### Create an AWS assumed role and grant access to the AWS Sentinel account
180173

181-
- Name the role with a meaningful name that includes a reference to Microsoft Sentinel. Example: "*MicrosoftSentinelRole*".
174+
The following instructions apply for public **Azure Commercial clouds** only. For granting access to AWS from Azure Government clouds, see [For Azure Government: Use identity federation](#for-azure-government-use-identity-federation).
175+
176+
1. In a different browser window or tab, open the AWS console.
177+
178+
1. Create an **IAM assumed role**. Follow these instructions in the AWS documentation:<br>[Creating a role to delegate permissions to an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html).
179+
180+
| Parameter | Selection/Value | Comments |
181+
| - | - | - |
182+
| **Trusted entity type** | *AWS account* | Instead of default *AWS service*. |
183+
| **Which account** | *Another AWS account*,<br>Account ID `197857026523` | Instead of the default *This account*,<br>Microsoft Sentinel's application service account.|
184+
| **Options** | *Require external ID* | *Do not* select *Require MFA* |
185+
| **External ID** | Your Microsoft Sentinel *Workspace ID*,<br>pasted from your clipboard. | This identifies *your specific Microsoft Sentinel account* to AWS. |
186+
| **Permissions to assign** | <ul><li>`AmazonSQSReadOnlyAccess`<li>`AWSLambdaSQSQueueExecutionRole`<li>`AmazonS3ReadOnlyAccess`<li>`ROSAKMSProviderPolicy`<li>Additional policies for ingesting the different types of AWS service logs. | For information on these policies, see the [AWS S3 connector permissions policies page](https://github.com/Azure/Azure-Sentinel/blob/master/DataConnectors/AWS-S3/AwsRequiredPolicies.md) in the Microsoft Sentinel GitHub repository. |
187+
| **Name** | Example: "*MicrosoftSentinelRole*". | Choose a meaningful name that includes a reference to Microsoft Sentinel. |
188+
189+
1. Continue with [Add the AWS role and queue information to the S3 data connector](#add-the-aws-role-and-queue-information-to-the-s3-data-connector) below.
190+
191+
#### For Azure Government: Use identity federation
192+
193+
1. In a different browser window or tab, open the AWS console.
194+
195+
1. Create a **web identity provider**. Follow these instructions in the AWS documentation:<br>[Creating OpenID Connect (OIDC) identity providers](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html).
196+
197+
| Parameter | Selection/Value | Comments |
198+
| - | - | - |
199+
| **Client ID** | Ignore this, you already have it. See **Audience** line below. | |
200+
| **Provider type** | *OpenID Connect* | Instead of default *SAML*.|
201+
| **Provider URL** | `https://sts.windows.net/cab8a31a-1906-4287-a0d8-4eef66b95f6e/` | |
202+
| **Thumbprint** | `626d44e704d1ceabe3bf0d53397464ac8080142c` | If created in the IAM console, selecting **Get thumbprint** should give you this result. |
203+
| **Audience** | `api://d4230588-5f84-4281-a9c7-2c15194b28f7` | |
204+
205+
1. Create an **IAM assumed role**. Follow these instructions in the AWS documentation:<br>[Creating a role for web identity or OpenID Connect Federation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_oidc.html#idp_oidc_Create).
206+
207+
| Parameter | Selection/Value | Comments |
208+
| - | - | - |
209+
| **Trusted entity type** | *Web identity* | Instead of default *AWS service*. |
210+
| **Identity provider** | `sts.windows.net/cab8a31a-1906-4287-a0d8-4eef66b95f6e/` | The provider you created in the previous step. |
211+
| **Audience** | `api://d4230588-5f84-4281-a9c7-2c15194b28f7` | The audience you defined for the identity provider in the previous step. |
212+
| **Permissions to assign** | <ul><li>`AmazonSQSReadOnlyAccess`<li>`AWSLambdaSQSQueueExecutionRole`<li>`AmazonS3ReadOnlyAccess`<li>`ROSAKMSProviderPolicy`<li>Additional policies for ingesting the different types of AWS service logs. | For information on these policies, see the [AWS S3 connector permissions policies page](https://github.com/Azure/Azure-Sentinel/blob/master/DataConnectors/AWS-S3/AwsRequiredPoliciesForGov.md) for Government, in the Microsoft Sentinel GitHub repository. |
213+
| **Name** | Example: "*MicrosoftSentinelRole*". | Choose a meaningful name that includes a reference to Microsoft Sentinel. |
214+
215+
216+
1. Edit the new role's trust policy and add another condition:<br>`"sts:RoleSessionName": "MicrosoftSentinel_{WORKSPACE_ID)"`
217+
218+
The finished trust policy should look like this:
219+
220+
```json
221+
{
222+
"Version": "2012-10-17",
223+
"Statement": [
224+
{
225+
"Effect": "Allow",
226+
"Principal": {
227+
"Federated": "arn:aws:iam::XXXXXXXXXXXX:oidc-provider/sts.windows.net/cab8a31a-1906-4287-a0d8-4eef66b95f6e/"
228+
},
229+
"Action": "sts:AssumeRoleWithWebIdentity",
230+
"Condition": {
231+
"StringEquals": {
232+
"sts.windows.net/cab8a31a-1906-4287-a0d8-4eef66b95f6e/:aud": "api://d4230588-5f84-4281-a9c7-2c15194b28f7",
233+
"sts:RoleSessionName": "MicrosoftSentinel_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
234+
}
235+
}
236+
}
237+
]
238+
}
239+
```
240+
241+
- `XXXXXXXXXXXX` is your AWS Account ID.
242+
- `XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` is your Microsoft Sentinel workspace ID.
243+
244+
Update (save) the policy when you're done editing.
182245

183246
### Add the AWS role and queue information to the S3 data connector
184247

@@ -295,6 +358,7 @@ Setting up this connector has two steps:
295358
> [!IMPORTANT]
296359
> As of December 1, 2020, the **AwsRequestId** field has been replaced by the **AwsRequestId_** field (note the added underscore). The data in the old **AwsRequestId** field will be preserved through the end of the customer's specified data retention period.
297360
361+
298362
---
299363

300364
## Next steps
@@ -303,3 +367,4 @@ In this document, you learned how to connect to AWS resources to ingest their lo
303367
- Learn how to [get visibility into your data, and potential threats](get-visibility.md).
304368
- Get started [detecting threats with Microsoft Sentinel](detect-threats-built-in.md).
305369
- [Use workbooks](monitor-your-data.md) to monitor your data.
370+

0 commit comments

Comments
 (0)