Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add read-only role page to documents #5783 #6806

Merged
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f7cda22
adding read-only role page to documents #5783
AntonEliatra Mar 28, 2024
09b3275
Merge branch 'main' into adding-read-only-user-page
AntonEliatra Mar 28, 2024
8c6614b
fixing vale errors on read-only page #5783
AntonEliatra Mar 29, 2024
7e16aa1
Update _security/access-control/read-only-role.md
AntonEliatra Apr 1, 2024
62bddf2
Update _security/access-control/read-only-role.md
AntonEliatra Apr 1, 2024
696ce56
applying the suggested fixed to read only mode page #5783
AntonEliatra Apr 1, 2024
a4b3dbb
Merge branch 'opensearch-project:main' into adding-read-only-user-page
AntonEliatra Apr 5, 2024
c6bc7a8
adding section on restapi roles to readonly_mode #5783
AntonEliatra Apr 5, 2024
066b381
adding section on restapi roles to readonly_mode #5783
AntonEliatra Apr 5, 2024
cba0c88
Apply suggestions from code review
AntonEliatra Apr 10, 2024
8c22b69
Merge branch 'opensearch-project:main' into adding-read-only-user-page
AntonEliatra Apr 11, 2024
fef5487
moving read only role content into Users and Roles page#5783
AntonEliatra Apr 11, 2024
a090514
moving read only role content into Users and Roles page#5783
AntonEliatra Apr 11, 2024
7800af0
moving read only role content into Users and Roles page#5783
AntonEliatra Apr 11, 2024
f0da1c2
moving read only role content into Users and Roles page#5783
AntonEliatra Apr 11, 2024
af79268
moving read only role content into Users and Roles page#5783
AntonEliatra Apr 11, 2024
4905e95
Update users-roles.md
hdhalter Apr 16, 2024
573d5fc
Update users-roles.md
hdhalter Apr 16, 2024
f78bea6
Update users-roles.md
AntonEliatra Apr 16, 2024
de44581
Update _security/access-control/users-roles.md
AntonEliatra Apr 16, 2024
2bb4a60
Update users-roles.md
AntonEliatra Apr 16, 2024
1260836
Update _security/access-control/users-roles.md
AntonEliatra Apr 17, 2024
a779b6f
Update _security/access-control/users-roles.md
hdhalter Apr 17, 2024
0e2ed28
Update _security/access-control/users-roles.md
hdhalter Apr 17, 2024
f1d82f8
fixing broken links #5783
AntonEliatra Apr 18, 2024
bab5e51
removing duplicate details from user-role page #5783
AntonEliatra Apr 18, 2024
6042091
Apply suggestions from code review
AntonEliatra Apr 19, 2024
e1ae8c3
Update users-roles.md
hdhalter Apr 19, 2024
6a6acb5
Update _security/access-control/users-roles.md
hdhalter Apr 19, 2024
56a28c2
Update _security/access-control/users-roles.md
hdhalter Apr 19, 2024
e624102
Update _security/access-control/users-roles.md
hdhalter Apr 19, 2024
7e49f43
Update _security/access-control/users-roles.md
hdhalter Apr 19, 2024
2217480
Update _security/access-control/users-roles.md
hdhalter Apr 19, 2024
17d857d
Update _security/access-control/users-roles.md
hdhalter Apr 19, 2024
32aedd6
Update _security/access-control/users-roles.md
hdhalter Apr 19, 2024
a3a8bcd
Update _security/access-control/users-roles.md
hdhalter Apr 19, 2024
1fbb3df
Update _security/access-control/users-roles.md
hdhalter Apr 19, 2024
ef4a8e2
Update _security/access-control/users-roles.md
hdhalter Apr 19, 2024
53753e9
Apply suggestions from code review
hdhalter Apr 19, 2024
04d424f
Apply suggestions from code review
hdhalter Apr 19, 2024
cc0089f
Apply suggestions from code review
AntonEliatra Apr 22, 2024
707223d
Merge branch 'opensearch-project:main' into adding-read-only-user-page
AntonEliatra Apr 22, 2024
ae869e4
Update _security/access-control/users-roles.md
hdhalter Apr 23, 2024
e668264
Update _security/access-control/users-roles.md
hdhalter Apr 23, 2024
7502ca0
Apply suggestions from code review
hdhalter Apr 23, 2024
fecc37a
Update users-roles.md
hdhalter Apr 23, 2024
2b7dfe4
Apply suggestions from code review
AntonEliatra Apr 24, 2024
f76d141
adding reference to images #5783
AntonEliatra Apr 24, 2024
803aeef
Apply suggestions from code review
AntonEliatra Apr 24, 2024
9bc682e
Merge branch 'main' into adding-read-only-user-page
hdhalter Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions _security/access-control/users-roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,64 @@ See [YAML files]({{site.url}}{{site.baseurl}}/security/configuration/yaml/#roles

See [Create role mapping]({{site.url}}{{site.baseurl}}/security/access-control/api/#create-role-mapping).

## Read-only roles

As with any role in OpenSearch, read-only roles can be configured using the following three methods:
hdhalter marked this conversation as resolved.
Show resolved Hide resolved
- Modifying the `yml` configuration files.
hdhalter marked this conversation as resolved.
Show resolved Hide resolved
- Using the Cluster Settings API.
hdhalter marked this conversation as resolved.
Show resolved Hide resolved
- Using OpenSearch Dashboards.

The most user friendly approach for anyone getting familiar with Roles and role mappings is to use OpenSearch Dashboards, as it is easy to navigate the creation of roles and assign those roles to users. The basic steps of creating roles, mapping, and users can be found in the [User and roles documentation](https://opensearch.org/docs/latest/security/access-control/users-roles/).

### Creating a basic read-only role


To create a basic read-only role which allows access to OpenSearch Dashboards, view existing dashboards, visualizations and query different indexes, use one the following permissions.
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved

These permissions will give the user access to all tenants and indexes on the cluster.
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved
{: .note}
hdhalter marked this conversation as resolved.
Show resolved Hide resolved

#### Cluster permission
hdhalter marked this conversation as resolved.
Show resolved Hide resolved

For the user needs read-only access to cluster-wide resources, such as visualization or dashboards, add the `cluster_composite_ops_ro` permission to that user's role.
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved

#### Index permission
hdhalter marked this conversation as resolved.
Show resolved Hide resolved

If the user needs access to view visualizations, they will also need access to the index used to create the visualization. To give the user read-only access to all indexes, specify all (`*`) under the **Index** drop-down, and **Read** in **Index Permissions**.
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved

#### Tenant permissions

If you use tenants to split work between different teams or projects, use the all (`*`) option followed by the **Read only** option.
hdhalter marked this conversation as resolved.
Show resolved Hide resolved

![creating role]({{site.url}}{{site.baseurl}}/images/role_creation_read_only.png)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reference the image in the preceding text.


After all permission types are set and the role is created, you can directly map the role to a user by going to **Mapped users** tab in roles. Select **Map users** and select the user to map to this role.
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved

![mapping users]({{site.url}}{{site.baseurl}}/images/mapping-users.png)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reference the image in the preceding text.


### OpenSearch Dashboards readonly_mode

OpenSearch Dashboards `readonly_mode` functionality is used to give the user access to only the `Dashboards` UI, removing all other elements of UI from the view.
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved
To configure this, add the following line `opensearch_dashboards.yml` file:
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved

```opensearch_security.readonly_mode.roles: [new_role]```

If the role mapped to the user has additional privileges or the user is mapped to other roles, giving them write access to indexes, this access will not be allowed using OpenSearch Dashboard. Direct data access to OpenSearch using curl or API is still allowed, as OpenSearch Dashboards is not involved in this communication.
hdhalter marked this conversation as resolved.
Show resolved Hide resolved

If the user is mapped to the `readonly_mode` role, all other elements of the UI will be removed, except for `Dashboards`. In the following comparison, the left view shows the screen from the perspective of a user mapped to a role in`readonly_mode`. On the right, the user is given a standard view.
hdhalter marked this conversation as resolved.
Show resolved Hide resolved

![compare read only mode]({{site.url}}{{site.baseurl}}/images/compare_read_only_mode.png)

Mapping the user to only `readonly_mode` role does not give permissions to view relevant indexes or allow the user to view the existing dashboards. Read access to indexes and dashboards require separate permissions.
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved
{: .note }


If the user is also mapped to any roles listed under `plugins.security.restapi.roles_enabled` in `opensearch.yml`, for example `all_access` or `security_rest_api_access`, then `readonly_mode` is ignored, giving the user access to standard UI elements.
hdhalter marked this conversation as resolved.
Show resolved Hide resolved

hdhalter marked this conversation as resolved.
Show resolved Hide resolved

### Additional permissions

If you need access to additional permissions while using the `read_only` role, such as alerting and anomaly detection modules, check out the existing roles, such as `alerting_read_access` and `anomaly_read_access`.
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved

## Predefined roles

Expand Down
Binary file added images/compare_read_only_mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/creating-user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/kibanauser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mapping-users.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/role_creation_read_only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading