Creating Additional Users, Including Permissions Management
Using OpenSearch Dashboards, you can create additional users so that—for example, when operating multiple Shopware instances or similar setups—you don’t have to use the “admin” user for every instance, thereby effectively restricting access.
Prerequisites
- OpenSearch server with OpenSearch Dashboards
- Access to OpenSearch Dashboards via the “admin” user
Creating Users
First, log in to OpenSearch Dashboards using the credentials stored in the server’s password vault.
Then, in the settings, navigate to “Security” → “Internal Users” and use the “Create internal user” button to create a new user and assign a secure password to them.
We recommend excluding the following special characters when setting a password, as they cannot be processed correctly by OpenSearch or, if applicable, by a connected application such as Shopware: / # $
Create a User Role
Next, select “Roles” in the left sidebar and use the “Create role” button to create a new user role for the user you just created.
First, enter a name, and in the next step, add the following cluster permissions to this role:
- cluster_composite_ops
- cluster:monitor/main
To ensure that the user can only access specific indices, the granted index permissions must be bound to index patterns.
Note that certain permissions must be granted for all indices (see the image below → *-pattern) so that access to the user’s own indices is possible at all and the permissions of the user-specific pattern (“test_product*”) are applied correctly. If the permissions are assigned as shown in the image below, the additional user can only access or create indices that match the assigned pattern and has full access to them.
Permissions for the * pattern:
- get
Permissions for the user-specific pattern (test_product*):
- indices_all
Click the “Create” button at the bottom of the current view to complete the creation of the user role.
Depending on the application, it may be necessary to assign additional permissions.
Additional Permissions for Shopware
To connect your Shopware store to a specific user and ensure that Shopware can perform indexing correctly, you must grant additional permissions.
Permissions for the * pattern:
- get
- indices:admin/aliases/get
Permissions for the user-specific pattern (test_product*):
- indices_all
However, using the * pattern makes it possible for a user to retrieve all available indices and thus all index names. Due to a known bug, this is necessary to enable access to the indices at all; otherwise, access will be denied with the status code 401 Unauthorized.
Additional Permissions for OpenSearch Dashboards
If the user is to have access to their indices via OpenSearch dashboards—and OpenSearch is not to be integrated solely with Shopware or a similar application—the following additional cluster permissions must be granted:
- cluster:monitor/state
- cluster:monitor/health
Furthermore, the following additional index permissions for the * pattern are required:
- indices:monitor/settings/get
- indices:monitor/stats
Mapping the User Role
Next, select the role you just created from the overview of all available user roles and switch to the “Mapped users” tab at the top.
Use the “Manage Mapping” button to add the user you created earlier under “Users,” and confirm the new mapping by clicking the “Map” button so that the new user permissions take effect for that user.