Help Center/ Cloud Search Service/ User Guide/ Using OpenSearch for Data Search/ Managing OpenSearch Clusters/ Creating Users for an OpenSearch Cluster and Granting Cluster Access
Updated on 2024-10-26 GMT+08:00

Creating Users for an OpenSearch Cluster and Granting Cluster Access

CSS limits access to security-mode clusters to authorized users only. When creating a security-mode cluster, an administrator account must be created. This administrator account can use OpenSearch Dashboards to add new users for the cluster and grant them the required permissions.

Context

CSS uses the opendistro_security plug-in to provide security cluster capabilities. The opendistro_security plug-in is built based on the RBAC model. RBAC involves three core concepts: user, action, and role. RBAC simplifies the relationship between users and actions, simplifies permission management, and facilitates permission expansion and maintenance. The following figure shows the relationship between the three.

Figure 1 User, action, and role
Table 1 Parameters for creating and authorizing a user on OpenSearch Dashboards

Parameter

Description

Permission

A single permission, for example, creating an index (for example, indices:admin/create).

Action group

An action group is a group of permissions. For example, the predefined SEARCH action group grants roles permissions to use _search and _msearchAPI.

Role

A role is a combination of permissions or action groups, including operation permissions on clusters, indexes, documents, or fields.

User

A user can send operation requests to an OpenSearch cluster. The user has credentials such as username and password, and zero or multiple backend roles and custom attributes.

Role mapping

A user will be assigned a role after successful authentication. Role mapping means to map a role to a user (or a backend role). For example, the mapping from kibana_user (role) to jdoe (user) means that John Doe obtains all permissions of kibana_user after being authenticated by kibana_user. Similarly, the mapping from all_access (role) to admin (backend role) means that any user with the backend role admin (from the LDAP/Active Directory server) has all the permissions of role all_access after being authenticated. You can map each role to multiple users or backend roles.

On OpenSearch Dashboards, you can configure user permissions on the OpenSearch cluster under Security to implement fine-grained access control at four levels: cluster, index, document, and field.

Users can be added or deleted for a cluster, and mapped to roles. This way, you assign roles to users.

With role mapping, you can configure the members of each role and assign roles to users based on usernames, backend roles, and host names. For each role, you can configure cluster, index, and document access permissions, as well as the permission to use OpenSearch Dashboards.

For more about security configuration for a security-mode cluster and the detailed guide, see the official Elasticsearch document here.

Constraints

You can customize the username, role name, and tenant name in the OpenSearch Dashboards. Chinese characters are not allowed.

Creating a User and Granting Permissions

  1. Log in to the OpenSearch Dashboards.

    1. Log in to the CSS management console.
    2. In the navigation pane, choose Clusters > OpenSearch.
    3. Choose Clusters in the navigation pane. On the Clusters page, locate the target cluster and click Access Kibana in the Operation column.
    4. Enter the administrator username and password to log in to the OpenSearch Dashboards.
      • Username: admin (default administrator account name)
      • Password: Enter the administrator password you set when creating the cluster in security mode.
        Figure 2 Logging in to OpenSearch

  2. Creating a user.

    1. On the OpenSearch Dashboards page, choose Security. The Security page is displayed.
      Figure 3 Going to the Security page
    2. Choose Internal users on the left. The user creation page is displayed.
      Figure 4 Creating a user
    3. Click Create internal user. The user information configuration page is displayed.
    4. In the Credentials area, enter the username and password.
      Figure 5 Entering the username and password
    5. Click Create. After the user is created, it is displayed in the user list.
      Figure 6 User information

  3. Create a role and grant permissions to the role.

    1. Select Roles from the Security drop-down list box.
    2. On the Roles page, click Create role. The role creation page is displayed.
    3. In the Name area, set the role name.
      Figure 7 Setting a role name
    4. On the Cluster Permissions page, set the cluster permission. Set cluster permissions based on service requirements. If this parameter is not specified for a role, the role has no cluster-level permissions.
      Figure 8 Assigning cluster-level permissions
    5. In the Index Permissions area, set the index permission.
      Figure 9 Setting index permissions
    6. On the Tenant Permissions page, set role permissions.
      Figure 10 Role permissions

      After the setting is complete, you can view the created role on the Roles page.

  4. Map a user with a role to bind them.

    1. Select Roles from the Security drop-down list box.
    2. On the Roles page, select the role to be mapped. The role mapping page is displayed.

    3. On the Mapped users tab page, click Map users and select the user to be mapped from the users drop-down list box.

    4. Click Map.
    5. After the configuration is complete, you can check whether the configuration has taken effect in OpenSearch Dashboards.