Amazon OpenSearch Service is a managed service that makes it simple to secure, deploy, and operate OpenSearch clusters at scale in the AWS Cloud. AWS IAM Identity Center (successor to AWS Single Sign-On) helps you securely create or connect your workforce identities and manage their access centrally across AWS accounts and applications. To build a strong least-privilege security posture, customers also wanted fine-grained access control to manage dashboard permission by user role. In this post, we demonstrate a step-by-step procedure to implement IAM Identity Center to OpenSearch Service via native SAML integration, and configure role-based access control in OpenSearch Dashboards by using group attributes in IAM Identity Center. You can follow the steps in this post to achieve both authentication and authorization for OpenSearch Service based on the groups configured in IAM Identity Center.
Let’s review how to map users and groups in IAM Identity Center to OpenSearch Service security roles. Backend roles in OpenSearch Service are used to map external identities or attributes of workgroups to pre-defined OpenSearch Service security roles.
The following diagram shows the solution architecture. Create two groups, assign a user to each group and edit attribute mappings in IAM Identity Center. If you have integrated IAM Identity Center with your Identity Provider (IdP), you can use existing users and groups mapped to your IdP for this test. The solution uses two roles: all\_access for administrators, and alerting\_full\_access for developers who are only allowed to manage OpenSearch Service alerts. You can set up backend role mapping in OpenSearch Dashboards by group ID. Based on the following diagram, you can map the role all\_access to the group Admin, and alerting\_full\_access to Developer. User janedoe is in the group Admin, and user johnstiles is in the group Developer.
Then you will log in as each user to verify the access control by looking at the different dashboard views.

Let’s get started!
Complete the following prerequisite steps:
To configure SAML in OpenSearch Service, complete the following steps:


You can also configure SAML during domain creation if you are creating a new OpenSearch domain. For more information, refer to SAML authentication for OpenSearch Dashboards.

To create a SAML application in IAM Identity Center, complete the following steps:





${user:email}, the format is emailAddress.${user:groups}, the format is unspecified.

janedoe to the group Admin.


To complete your SAML configuration and map the SAML primary backend role, complete the following steps:
The IdP entity ID will be auto populated.

This is because we defined and mapped Role to ${user:groups} as a SAML attribute in IAM Identity Center.

You have completely integrated IAM Identity Center with OpenSearch Service and mapped the Admin group as the primary role (all\_access) in OpenSearch Service. Now you will log in to OpenSearch Dashboards as Admin and configure mapping for the Developer group.
There are two ways to log in to OpenSearch Dashboards:
https://opensearch-domain-name-random-keys.us-west-2.es.amazonaws.com/\_dashboards)https://d-1234567abc.awsapps.com/start)Complete the following steps:
janedoe).


alerting\_full\_access role and on the Mapped users tab, choose Manage mapping.

Now you have successfully mapped the Developer group to the alerting\_full\_access role in OpenSearch Service.

To verify permissions, complete the following steps:
You can see there are only alerting related features available on the drop-down menu. This Developer user can’t see all of the Admin features, such as Security.

After you test the solution, remember to delete all of the resources you created to avoid incurring future charges:
In the post, we walked through a solution of how to map roles in Amazon OpenSearch Service to groups in IAM Identity Center by using SAML attributes to achieve role-based access control for accessing OpenSearch Dashboards. We connected IAM Identity Center users to OpenSearch Dashboards, and also mapped predefined OpenSearch Service security roles to IAM Identity Center groups based on group attributes. This makes it easier to manage permissions without updating the mapping when new users belonging to the same workgroup want to log in to OpenSearch Dashboards. You can follow the same procedure to provide fine-grained access to workgroups based on team functions or compliance requirements.
Scott Chang is a Solution Architecture at AWS based in San Francisco. He has over 14 years of hands-on experience in Networking also familiar with Security and Site Reliability Engineering. He works with one of major strategic customers in west region to design highly scalable, innovative and secure cloud solutions.
Muthu Pitchaimani is a Search Specialist with Amazon OpenSearch service. He builds large scale search applications and solutions. Muthu is interested in the topics of networking and security and is based out of Austin, Texas