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

[BUG] Roles inconsistency #4730

Closed
n9 opened this issue Sep 13, 2024 · 7 comments
Closed

[BUG] Roles inconsistency #4730

n9 opened this issue Sep 13, 2024 · 7 comments
Labels
bug Something isn't working untriaged Require the attention of the repository maintainers and may need to be prioritized

Comments

@n9
Copy link

n9 commented Sep 13, 2024

What is the bug?
The current documentation says:

roles.yml
This file contains any initial roles that you want to add to the Security plugin. Aside from some metadata, the default file is empty, because the Security plugin has a number of static roles that it adds automatically.

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Read the current documentation to see the text above.
  2. Open /usr/share/opensearch/config/opensearch-security/roles.yml from the opensearch image and see that the file contains roles.

What is the expected behavior?
Either the file should be empty or the documentation should not say that.

What is your host/environment?

  • OS: N/A
  • Version 2.16
  • Plugins: Security

Do you have any screenshots?
Not needed.

Do you have any additional context?

because the Security plugin has a number of static roles that it adds automatically

Is this still true? Where I can find it in the source code?

@n9 n9 added bug Something isn't working untriaged Require the attention of the repository maintainers and may need to be prioritized labels Sep 13, 2024
@n9
Copy link
Author

n9 commented Sep 13, 2024

I have found the static roles in the source code: https://github.com/opensearch-project/security/blob/2.16.0.0/src/main/resources/static_config/static_roles.yml

There is for example: kibana_user with description Provide the minimum permissions for a kibana user:

kibana_user:
reserved: true
hidden: false
static: true
description: "Provide the minimum permissions for a kibana user"
cluster_permissions:
- "cluster_composite_ops"
index_permissions:
- index_patterns:
- ".kibana"
- ".kibana-6"
- ".kibana_*"
- ".opensearch_dashboards"
- ".opensearch_dashboards-6"
- ".opensearch_dashboards_*"
allowed_actions:
- "read"
- "delete"
- "manage"
- "index"
- index_patterns:
- ".tasks"
- ".management-beats"
- "*:.tasks"
- "*:.management-beats"
allowed_actions:
- "indices_all"

In roles.yml there is a similar role kibana_read_only with comment: Restrict users so they can only view visualization and dashboard on OpenSearchDashboards, but empty content:

# Restrict users so they can only view visualization and dashboard on OpenSearchDashboards
kibana_read_only:
reserved: true

Why these two have "so" different content?

@cwperks
Copy link
Member

cwperks commented Sep 16, 2024

[Triage] @n9 kibana_read_only is a special role w/o permissions. It get's functionality through a setting in opensearch_dashboards.yml:

 opensearch_security.readonly_mode.roles: [kibana_read_only]

A user mapped to this role can view saved objects, but cannot save saved objects. Saved objects is a generic term for items such as:

  • index patterns
  • visualizations
  • dashboards
  • etc.

Closing this issue. Please let me know if you need any further information.

For general questions I would also recommend posting on the OpenSearch forum: https://forum.opensearch.org/c/security/3

@cwperks cwperks closed this as completed Sep 16, 2024
@n9
Copy link
Author

n9 commented Sep 16, 2024

@cwperks What about the bug that the default roles file is not empty? (But according to the documentation it should be.)

@cwperks
Copy link
Member

cwperks commented Sep 16, 2024

@n9 You're right, that should be changed. The roles.yml file contains default roles that grant functionality to plugins that are shipped in the default distributions. The documentation-website should be updated to reflect that.

@cwperks
Copy link
Member

cwperks commented Sep 18, 2024

@n9 Opened a documentation PR here: opensearch-project/documentation-website#8334

@n9
Copy link
Author

n9 commented Sep 18, 2024

The roles.yml file contains default roles that grant functionality to plugins that are shipped in the default distributions.

@cwperks But why kibana_user is static, but kibana_read_only is default?

@cwperks
Copy link
Member

cwperks commented Sep 18, 2024

I can't really tell based on the history: #96

There is some overlap between the meanings of "reserved" and "static" and if I had to guess, it was added to config/roles.yml at first and never changed.

This comment goes into the difference between static and reserved: #4387 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Require the attention of the repository maintainers and may need to be prioritized
Projects
None yet
Development

No branches or pull requests

2 participants