Creating a SAML app in Yandex Identity Hub for integration with Managed Service for OpenSearch
Note
This feature is at the Preview stage.
OpenSearch
To authenticate your organization's users to Managed Service for OpenSearch via SAML
SAML apps can be managed by users with the organization-manager.samlApplications.admin role or higher.
Getting started
Make sure you can access OpenSearch Dashboards using the admin user credentials. For information on how to create and configure an OpenSearch cluster, see Creating an OpenSearch cluster.
In this tutorial, we will use the following URL to access the OpenSearch Dashboards web interface:
https://c-cat0adul1fj0********.rw.mdb.yandexcloud.net/
For the users of your organization to be able to access Managed Service for OpenSearch:
Create an app
- Log in to Yandex Identity Hub
. - In the left-hand panel, select
Apps. - In the top-right corner, click
Create application and in the window that opens:- Select the SAML (Security Assertion Markup Language) single sign-on method.
- In the Name field, specify a name for your new app:
opensearch-app. - Optionally, in the Description field, enter a description for the new app.
- Optionally, add labels:
- Click Add label.
- Enter a label in
key: valueformat. - Press Enter.
- Click Create application.
Set up the integration
To configure Managed Service for OpenSearch integration with the SAML app you created in Identity Hub, complete the configuration both on the OpenSearch cluster side and in Identity Hub.
-
Get the metadata for the new app:
- Log in to Yandex Identity Hub
. - In the left-hand panel, select
Apps and select the new SAML app. - On the Overview tab, under Identity provider (IdP) configuration, copy the
Issuer / IdP EntityIDvalue you have to set on the OpenSearch cluster side. - On the Overview tab, under Identity provider (IdP) configuration, click Download metadata file.
The downloaded XML
file contains the required metadata and a certificate used for SAML response signature verification. - Log in to Yandex Identity Hub
-
Set up SSO for the OpenSearch cluster.
Tip
Below are the steps for the management console; however you may use other available Yandex Cloud interfaces.
To set up a Identity Hub authentication source:
-
In the management console
, go to the folder dashboard and select Managed Service for OpenSearch. -
Click the cluster name and select the Authentication sources tab.
-
Click Settings.
-
Specify the required values for these settings:
-
idp_entity_id: Provider ID. Enter the previously saved
Issuer / IdP EntityIDvalue. -
idp_metadata_file: Select and upload the previously downloaded metadata file.
-
sp_entity_id: Service provider ID.
This ID must match the URL used to connect to OpenSearch Dashboards:
https://c-cat0adul1fj0********.rw.mdb.yandexcloud.net/ -
kibana_url: URL to connect to OpenSearch Dashboards.
-
roles_key: Attribute that stores a list of roles. Set it to
groups. -
subject_key: Leave the field empty.
-
Session timeout: Leave the
0value. -
Enable: Make sure to enable this option.
-
-
Click Save. Wait for the cluster status to change to
Running. It may take a few minutes to apply settings.
-
-
Configure role mapping in OpenSearch.
To ensure that Identity Hub user groups are mapped to OpenSearch roles during authentication:
- Connect to OpenSearch Dashboards as the
adminuser. - In the left-hand menu, select OpenSearch Plugins → Security.
- In the left-hand panel, select Roles.
- Configure role mapping:
- Click the role name. In this guide, it is
kibana_user. - Go to the Mapped users tab.
- Click Manage mapping.
- Under Backend roles, enter the name of the Identity Hub user group a role will be mapped to in OpenSearch, e.g.,
opensearch-users. - Click Map.
- Click the role name. In this guide, it is
Now your organization's users added to the
opensearch-usersgroup will be getting thekibana_userrole upon successful authentication in OpenSearch Dashboards. - Connect to OpenSearch Dashboards as the
Set up the SAML application in Yandex Identity Hub
Set up service provider endpoints
-
Log in to Yandex Identity Hub
. -
In the left-hand panel, select
Apps and then, the SAML app. -
At the top right, click
Edit and in the window that opens:- In the **SP EntityID ** field, enter the URL for connection to OpenSearch Dashboards.
- In the ACS URL field, specify the ACS URL.
The ACS URL must be in the following format:
https://c-cat0adul1fj0********.rw.mdb.yandexcloud.net/_opendistro/_security/saml/acs- Click Save.
Add a user groups attribute
OpenSearch users have to get one of the basic roles upon login. For this to work, the Identity Hub authentication source must provide in its SAML response a list of user groups that will have roles mapped in OpenSearch. Proceed as follows:
- In the top-right corner, click
Add group attribute and in the window that opens. - In the Attribute name field, leave
groups. - In the Transmitted groups field, select
Assigned groups only. - Click Add.
For more information about configuring attributes, see Configure user and group attributes.
Add users
For your organization's users to be able to authenticate in OpenSearch Dashboards with the Identity Hub SAML app, you need to explicitly add these users and user groups to the SAML app.
Note
Users and groups added to a SAML application can be managed by a user with the organization-manager.samlApplications.userAdmin role or higher.
-
If you have configured role mapping in Managed Service for OpenSearch, create the groups as needed:
Cloud Center UI- Log in to Yandex Identity Hub
. - In the left-hand panel, select
Groups. - In the top-right corner of the page, click
Create group. - Enter a name, e.g.,
opensearch-users. The group name must exactly match the user group name specified when mapping to the OpenSearch role. - Click Create group.
- Add users to the group:
- Navigate to the Members tab.
- Click Add member.
- In the window that opens, select the required users.
- Click Save.
- Log in to Yandex Identity Hub
-
Add users to the application:
Cloud Center UI- Log in to Yandex Identity Hub
. - In the left-hand panel, select
Apps and select the required app. - Navigate to the Users and groups tab.
- Click
Add users. - In the window that opens, select the required user or user group.
- Click Add.
- Log in to Yandex Identity Hub
Make sure your application works correctly
To make sure both your SAML app and Managed Service for OpenSearch integration work correctly, authenticate to OpenSearch Dashboards as one of the users you added to the app. Proceed as follows:
- In your browser, navigate to the address of your OpenSearch Dashboards instance.
- If logged in to OpenSearch Dashboards, log out.
- On the OpenSearch Dashboards authentication page, click Log in with single sign-on.
- On the Yandex Cloud authentication page, enter your email address and user password. The user must be a member of a group added to the app.
- Make sure you are logged in to OpenSearch Dashboards.
- If you have configured role mapping:
- Click the user icon in OpenSearch Dashboards.
- Go to View roles and identities.
- Make sure the Roles section displays the
kibana_userrole and the Backend roles section displays theopensearch-usersrole.