View this page in Japanese (日本語) | Back to README
Data from log buckets in the Log Archive account in AWS Control Tower can be loaded into SIEM on OpenSearch as-is. Data in S3 buckets created by default for AWS CloudTrail and AWS Config, and data in independently created S3 buckets can also be loaded if the log format is supported.
Next, enable single sign-on to the OpenSearch Service
- Data ingestion
- SAML federation
- Add and configure the application in AWS IAM Identity Center
- Amazon OpenSearch Service SAML Authentication
- Amazon OpenSearch Servrless SAML Authentication
- SAML Authentication Configuration in AWS IAM Identity Center
- Adding general user group to Amazon OpenSearch Service
- Adding general user group to Amazon OpenSearch Serverless
- Adding general user group to IAM Identity Center
Deploy SIEM on OpenSearch with reference to README
The account should either create a Security Tooling account in the member account (recommended) or use an Audit account, etc.
The region must be selected for integration with Control Tower, the region where the log buckets for the Log Archive account are located.
Ignore Control Tower related parameters when running CDK / CloudFormation.
After deployment, check the ARN of the IAM Role used in the Lambda function aes-siem-es-loader.
e.g. arn:aws:iam::123456789012:role/aes-siem-LambdaEsLoaderServiceRoleXXXXXXXXXXXX-XXXXXXXXXXXXXX
.
Use this for the CloudFormation parameters in the next step.
Create an Amazon SQS and IAM Role in the Log Archive account. Use the CloudFormation Template below to create these resource, which requires the ARN of the above IAM Role in the CDK / CloudFormation parameters. The resources will be newly created and will not modify any existing resources.
Creaed resources
resource type | resource ARN |
---|---|
AWS::IAM::Role | arn:aws:iam::999999999999:role/ct-role-for-siem |
AWS::SQS::Queue | arn:aws:sqs:us-east-1:999999999999:aes-siem-ct |
AWS::SQS::Queue | arn:aws:sqs:us-east-1:999999999999:aes-siem-ct-dlq |
Next, configure event notifications for the S3 bucket you wish to ingest logs.
- Example of target S3 bucket
- aws-controltower-logs-999999999999-us-east-1
- aws-controltower-s3-access-logs-999999999999-us-east-1
- event type: all object creation events ( s3:ObjectCreated:* )
- Destination: aes-siem-ct in SQS
This completes the configuration for the Log Archive account.
Note down the information needed for the next step, which will be used for the SIEM CloudFormation Stack parameters.
e.g.
- Name of S3 bucket to ingest logs:
aws-controltower-logs-999999999999-us-east-1, aws-controltower-s3-access-logs-999999999999-us-east-1
. - SQS ARN:
arn:aws:sqs:us-east-1:999999999999:aes-siem-ct
- IAM Role:
arn:aws:iam::999999999999:role/ct-assumed-role-for-siem-es-loader
.
Manually update the KMS key policy for the admin account if log buckets are encrypted.
The principal to allow will be the Log Archie account, not the SIEM account.
Configuration example:
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::999999999999:role/ct-role-for-siem"
},
"Action": "kms:Decrypt",
"Resource": "*"
},
Reference: Optionally configure AWS KMS keys
Update the CloudFormation aes-siem or siem stack and enter the Control Tower related parameters.
e.g. Control Tower Integration Parameter
Parameter | Value |
---|---|
ControlTowerLogBucketNameList | aws-controltower-logs-999999999999-us-east-1, aws-controltower-s3-access-logs-999999999999-us-east-1 |
ControlTowerSqsForLogBuckets | arn:aws:sqs:us-east-1:999999999999:aes-siem-ct |
ControlTowerRoleArnForEsLoader | arn:aws:iam::999999999999:role/ct-role-for-siem |
Immediately after configuration, log ingestion may fail, but will succeed once a new instance of the Lambda function (es-loader) is created. Alternatively, manually deploying the es-loader and forcing it to launch a new instance will resolve the error.
This completes the log ingestion configuration for the Log Archive account.
You can use AWS IAM Identity Center in Control Tower to control who has access to OpenSearch with single sign-on. Once users have logged into the portal, they can log into OpenSearch with a single click. This process assumes that your identity source is an Identity Center directory. If you are using other sources, please change accordingly.
Enable single sign-on with OpenSearch Roles for users belonging to his IAM Identity Center group below. Please change the permissions accordingly
For OpenSearch Service
IAM Identity Center Group | OpenSearch Role | Description |
---|---|---|
OpenSearchDashboardsSuperUsers | security_manager all_access |
all permissions |
OpenSearchDashboardsAdmins | all_access | all permissions except security |
OpenSearchDashboardsReadOnlyUsers | opensearch_dashboards_user readall_and_monitor |
read only permissions to indices |
For OpenSearch Serverless
IAM Identity Center Group | OpenSearch Serverless Data Access Policy | Description |
---|---|---|
OpenSearchDashboardsSuperUsers | Alias and templates permissions aoss:* Index permissions aoss:* |
all permissions |
OpenSearchDashboardsAdmins | Index permissions aoss:* |
read/write permissions to indices |
OpenSearchDashboardsReadOnlyUsers | Index permissions aoss:ReadDocument aoss:DescribeIndex |
read only permissions to indices |
We recommend that you log in to your two AWS accounts with separate browsers to set up your IAM Identity Center and Amazon OpenSearch Service accounts alternately.
- Open the AWS IAM Identity Center console for your Control Tower administrator account in the first browser
- Create a group in the above IAM Identity Center and note the group ID for each
Adding OpenSearch Service or OpenSearch Serverless to your application.
- Open the AWS IAM Identity Center console for your Control Tower management account in the first browser
- Select [Applications] in the navigation pane on the left side of the screen
- Select [Add Application]
- On the [Select an application] page, select [Add custom SAML 2.0 application]. Then select Next
- On the [Configure application] page, for [Display Name], enter [SIEM Dashboards]. [Description] field is optional
- Select [Download] for [IAM Identity Center SAML metadata file] to download the metadata. An example filename is
Custom SAML 2.0 application_ins-abcdef1234567890.xml
Stay in this state and set up OpenSearch SAML authentication from the second browser
Reference: Custom SAML 2.0 applications
This configuration is for when using a managed instance of the OpenSearch Service. Skip this section if you are using OpenSearch Serverless.
- Open Amazon OpenSearch Service console for your SIEM account in the second browser
- Select [Domains], [aes-siem] in the navigation pane on the left side of the screen. If you have changed the domain name, select the domain name you set yourself
- Select [Actions] at the top right of the screen, then [Edit security configuration]
- In the [SAML authentication for OpenSearch Dashboards/Kibana] panel, check [Enable SAML authentication]
- Under [Metadata from IdP], select [Import from XML file] to upload the XML file you downloaded from IAM Identity Center. An example filename is
Custom SAML 2.0 application_ins-abcdef1234567890.xml
. - Enter [Group ID of OpenSearchDashboardsSuperUsers] from IAM Identity Center in [SAML master backend role - optional]. e.g.
abcd1234-5678-9012-3456-111111111111
- Select [Additional settings] to see advanced options
- Enter [ Group ] in [Roles key - optional]
- Change [Session time to live] to any time
- Select [Save Changes] to finish configuration in OpenSearch
- Select [Actions], then [Edit security configuration] to view the SAML related parameters for your reference. We will use it in the next section.
Stay in this state and return to the IAM Identity Center
Reference: SAML authentication for OpenSearch Dashboards
This configuration is for when using OpenSearch Serverless collections. Skip this section if you have already configured with a managed instance of the OpenSearch Service.
SAML authentication
- Open Amazon OpenSearch Service console for your SIEM account in the second browser
- Select Serverless [SAML Authentication], then [Create SAML Provider] in the left navigation pane
- On [Create a SAML provider] screen enter [ iam-identity-center ] for Name
- Under [Step 3: Provide metadata from your IdP], select [Import from XML file] and upload the XML file you downloaded from IAM Identity Center. An example filename is
Custom SAML 2.0 application_ins-abcdef1234567890.xml
. - For [Group attribute - optional], enter [ Group ]
- Change [OpenSearch Dashboards timeout] to whatever time you want
- Select [Create SAML Provider] to finish SAML authentication configuration
Data access policies
- In the navigation pane on the left of the screen, select Serverless [Data access policies], then [Create access policy]
- On [Create access policy] screen, enter [ siem-superusers ] for the access policy name
- Select [Add principals] for Rule 1 and select [Select SAML users and groups]
- Select [ SAML/123456789012/iam-identity-center ] for [SAML provider name]
- For [SAML users or groups], enter [ group/Group ID of OpenSearchDashboardsSuperUsers ]. e.g.
group/12345678-1234-5678-abcd-111111111111
- Select [Save]
- Select [Grant]
- Select [Select all] for [Alias and templates permissions]
- Enter [ aes-siem ] in the text box and enter the return key. Please change the collection name accordingly.
- Select [Select all] for [Index permissions]
- Enter [ aes-siem ] in [Select collection] and enter the return key. Please change the collection name accordingly.
- Enter the wildcard [ * ] in [Specific indexes or index patterns]
- Select [Save]
- Select [Save] to finish creating the access policy
Reference: SAML authentication for Amazon OpenSearch Serverless
Return to the IAM Identity Center in the first browser and configure the rest of your SAML federation.
-
Change [Session duration] to any time
-
Select [Manually type your metadata values] in [Application metadata] and enter parameters while referring to OpenSearch SAML authentication parameters.
For OpenSearch Service
IAM Identity Center << OpenSearch example Application ACS URL << IdP-initiated SSO URL https://search-aes-siem-abcd1234567890ulzml47mmaui.us-east-1.es.amazonaws.com/_dashboards/_opendistro/_security/saml/acs/idpinitiated
Application SAML audience << Service provider entity ID https://search-aes-siem-abcd1234567890ulzml47mmaui.us-east-1.es.amazonaws.com
For OpenSearch Serverless
IAM Identity Center << OpenSearch Serverless 例 Application start URL - (optional) << not optional
OpenSearch Dashboards URLhttps://abcdef1234567890123456.us-east-1.aoss.amazonaws.com/_dashboards
Application ACS URL << [SAML authentication]
Assertion consumer service (ACS) URLhttps://collection.us-east-1.aoss.amazonaws.com/_saml/acs
Application SAML audience << aws:opensearch:<SIEM Account ID> aws:opensearch:123456789012
-
Select [Submit] to finish SAML authentication configuration
Next, set the attribute mapping.
- Select [Actions] at the top right of the screen, then [Edit attribute mappings]
- Enter the following attributes
User attribute in the application Maps to this string value or user attribute in IAM Identity Center Format Subject ${user:subject} unspecified Group ${user:groups} unspecified - Select [Save Changes].
Then specify the groups that are authorized to login
- Select [Assign users]
- Select the [Groups] tab from the tab menu and select [OpenSearchDashboardsSuperUsers]
- Select [Assign Users]
Configuration of the management user is complete. Next, configure general user settings
Describes how to add general user group to Fine-grained access control of OpenSearch
- In the second browser, log in to OpenSearch Dashboards as management user with SAML authentication
- From the pull-down menu at the top left of the screen, select [Security], then [Roles]
- Select [all_access] for Role.
- Select [Mapped users] in the tab menu
- Select [Manage mappings]
- Select [Add another backend role]
- Enter [Group ID of OpenSearchDashboardsAdmins] from IAM Identity Center in [SAML master backend role - optional]. e.g.
abcd1234-5678-9012-3456-222222222222
- Finished adding the group OpenSearchDashboardsAdmins
- To add the group OpenSearchDashboardsReadOnlyUsers, map the IAM Identity Center group ID to the OpenSearch Role below as well
OpenSearch Role Backend roles opensearch_dashboards_user Group ID for OpenSearchDashboardsReadOnlyUsers readall_and_monitor Group ID for OpenSearchDashboardsReadOnlyUsers
Repeat this configuration if you want to create another user group
Describes how to add the OpenSearchDashboardsAdmins group to Amazon OpenSearch Serverless
-
Open your SIEM account's Amazon OpenSearch Service console in the second browser
-
In the navigation pane on the left of the screen, select Serverless [Data access policies], then [Create access policy]
-
On [Create access policy] screen, enter [ siem-admins ] for the access policy name
-
Select [Add principals] for Rule 1 and select [Select SAML users and groups]
- Select [ SAML/123456789012/iam-identity-center ] for [SAML provider name]
- For [SAML users or groups], enter [ group/Group ID of OpenSearchDashboardsAdmins ]. e.g.
group/12345678-1234-5678-abcd-222222222222
- Select [Save]
-
Select [Grant]
- Select nothing for [Alias and templates permissions]
- Select [Select all] for [Index permissions]
- Enter [ aes-siem ] in [Select collection] and enter the return key. Please change the collection name accordingly.
- Enter the wildcard [ * ] in [Specific indexes or index patterns]
- Select [Save]
-
Select [Save] to finish creating the access policy [ siem-admins ]
-
Select Save to update the access policy [ siem-admins ]
Then add the OpenSearchDashboardsReadOnlyUsers group
- In the navigation pane on the left of the screen, select Serverless [Data access policies], then [Create access policy]
- On [Create access policy] screen, enter [ siem-readonly-users ] for the access policy name
- Select [Add principals] for Rule 1 and select [Select SAML users and groups]
- Select [ SAML/123456789012/iam-identity-center ] for [SAML provider name]
- For [SAML users or groups], enter [ group/Group ID of OpenSearchDashboardsReadOnlyUsers ]. e.g.
group/12345678-1234-5678-abcd-333333333333
- Select [Save]
- Select [Grant]
- Select nothing for [Alias and templates permissions]
- Select [Describe] and [Read documents] for [Index permissions]
- Enter [ aes-siem ] in [Select collection] and enter the return key. Please change the collection name accordingly.
- Enter the wildcard [ * ] in [Specific indexes or index patterns]
- Select [Save]
- Select [Save] to finish creating the access policy [ siem-readonly-users ]
Repeat this configuration if you want to create another user group
Return to the IAM Identity Center in the first browser and add the general user group
- Select [Application]s in the navigation pane on the left side of the screen
- Select the application for OpenSearch Service
- Select [Assign Users]
- Select the [Groups] tab from the tab menu and select [OpenSearchDashboardsAdmins] and [OpenSearchDashboardsReadOnlyUsers]
- Select [Assign Users]
SAML authentication configuration is now complete