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 3 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
41 changes: 41 additions & 0 deletions _security/access-control/read-only-role.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: default
title: Read only roles
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved
parent: Access control
nav_order: 150
---

# Read only roles
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved

As with any roles in OpenSearch, read only roles can be configured using three methods: `yml` configuration files, API and 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 assignment to users. The basic steps of creating roles/mappings/users are outlines here (https://opensearch.org/docs/latest/security/access-control/users-roles/)
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved

## Basic read only role
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved

If you are looking to create a role to access OpenSearch Dashboards, view existing dashboards/visualizations and query different indexes, assuming you want the user to have read access to all indexes and tenants, you can add cluster permission group of `cluster_composite_ops_ro`, `read` access to all indexes (`*`) and `read` access to all tenants
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if we should use "indices." Ask @Naarcha-AWS

Copy link
Contributor

Choose a reason for hiding this comment

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

I would consider explaining each of these. Without knowing the background it is not super obvious what cluster_composite_ops_ro is for. Likewise it may not be obvious why you restate the permissions at different levels so you may want to clarify this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@scrawfor99 good point, I've expanded on this, let me know if below is better:

Basic read only role

If you are looking to create a role to access OpenSearch Dashboards, view existing dashboards/visualizations and query different indexes, assuming you want the user to have read access to all indexes and tenants, you can use the following permissions.

Cluster permission

Cluster permission is needed to access cluster wide resources like visualizations and dashboards. For read only user you add already created cluster_composite_ops_ro permission.

Indexes permission

In order to view visualizations, user needs to have access to the index that was used to create it, In this can you can add read permission to all (*) indexes.

Tenant permissions

If you are using tenants to separate work area between different teams/projects, visualizations and dashboards are saved in specific tenant. To be able to view these the user needs read access to the correct tenant. To keep things more straightforward we are giving user access to all (*) tenants.


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

Once 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)

## OpenSearch Dashboards readonly_mode

OpenSearch Dashboards comes with functionality to only give access to `Dashboards` UI by using readonly_mode.
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved
You need to configure this in `opensearch_dashboards.yml` file by adding following line:
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved
`opensearch_security.readonly_mode.roles: [new_role]`

If the role mapped to user has additional privileges or 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.
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved

If the user is mapped to this `readonly_mode` role, all other elements of the UI will be removed, except for `Dashboards`. See following comparison, on the left is user mapped to role which is configured as readonly_mode, on the right is the standard view.
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved

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

Don't forget that mapping the user to only readonly_mode role, that doesn't give permissions to view relevant indexes, will not allow the user to view the existing dashboards, as user still needs read access to view data behind the dashboards.
{: .note }

The only exception is "admin" backend role, if this backend role is also provided to the same user, the readonly_mode is ignored, giving the user access to standard UI elements, as well as full access to the cluster.

## Additional permissions

If you need access to additional permissions while using read_only role, for example for alerting and anomaly detection modules, check out the existing roles, for example "alerting_read_access" and "anomaly_read_access"
AntonEliatra marked this conversation as resolved.
Show resolved Hide resolved
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