-
Notifications
You must be signed in to change notification settings - Fork 500
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] Index Template APIs need to be specified under cluster permissions rather than index permissions #619
Comments
[Triage] This is a documentation bug. The behavior you see is as expected. |
@opensearch-project/transfer-request Please move this bug to documentation repo. |
I had this problem yesterday and there is no clear information about this on the internet. Only because I found this problem on GitHub I was able to solve it. In the permissions page it seems that I have to add the _index_template permissions in the "indices" part of the role and this generates this problem. |
Hi Aria, can you please take a look at this and make the appropriate changes? Thanks! |
@FrcMoya I'm trying to figure this out myself and not having any luck. Can you post what the resulting role permissions ended up looking like when you got it working (either as json to the API or yaml to the securityadmin.sh tool? |
@BioSehnsucht I am using the AWS service so I don't really have access to the json nor securityadmin.sh. This is the response of the GET role API call
|
@FrcMoya Thanks. I now have Elastiflow Unified Connector outputting to OpenSearch with this role.
|
What is the bug?
Index Template APIs need to be specified under cluster permissions rather than index permissions
How can one reproduce the bug?
Steps to reproduce the behavior:
curl -XPUT https://localhost:9200/_plugins/_security/api/roles/sem-role -H 'Content-Type: application/json' -d' { "cluster_permissions": [ "cluster_monitor" ], "index_permissions": [{ "index_patterns": [ "sem*" ], "allowed_actions" : ["*"] }] }
curl -XPUT https://localhost:9200/_plugins/_security/api/internalusers/sem-user -H 'Content-Type: application/json' -d' { "password": "######", "opendistro_security_roles": ["sem-role"] } '
curl -XPUT -u sem-user "https://localhost:9200/_template/sem1234?pretty" -H 'Content-Type: application/json' -d' { "index_patterns": ["sem1234*"], "template": { "settings": { "number_of_shards": 2, "number_of_replicas": 1 }, "mappings": { "properties": { "timestamp": { "type": "date", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" }, "value": { "type": "double" } } } } } '
Response:
{ "error" : { "root_cause" : [ { "type" : "security_exception", "reason" : "no permissions for [indices:admin/template/put] and User [name=sem-user, backend_roles=[], requestedTenant=null]" } ], "type" : "security_exception", "reason" : "no permissions for [indices:admin/template/put] and User [name=sem-user, backend_roles=[], requestedTenant=null]" }, "status" : 403 }
This permission issue is resolved if the indices:admin/template/* permission is specified under the cluster permissions, like so:
curl -XPUT https://
hostname:50140/_plugins/_security/api/roles/sem-role -u admin:admin123 -H 'Content-Type: application/json' -d' { "cluster_permissions": [ "cluster_monitor", **"indices:admin/template/*"** ], "index_permissions": [{ "index_patterns": [ "sem*" ], "allowed_actions" : ["*"] }] } '
What is the expected behavior?
What is your host/environment?
OpenSearch 1.2.4 with opensearch-security plugin enabled on OEL7
Do you have any screenshots?
NA
Do you have any additional context?
https://forum.opensearch.org/t/internal-user-not-able-to-perform-operations-based-on-internal-role/9529/9
The text was updated successfully, but these errors were encountered: