Can't access only authorized index
See original GitHub issueI have access to only specific indexes in an ES cluster. So when I do
es = Elasticsearch("https://<server>:port", http_auth=('<user>','<passwd>'))
This raises an exception:-
elasticsearch.exceptions.AuthorizationException: TransportError(403, 'security_exception', 'action [cluster:monitor/main] is unauthorized for user [<user>]')
So I tried to suffix the url with my specific-index
es = Elasticsearch("https://<server>:port/<specific-index>", http_auth=('<user>','<passwd>'))
This works and returns me information about the index.
But then I’m not able to do any queries on it since the url is translated to
https://<server>:port/<specific-index>/<specific-index>/<doc-type>/<id>
Is there a way for this to be like lazy evaluated? (I mean, the es
object is created but not initialized until I run the query on my specific-index?)
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
My website won't open unless I add "/index.html" to the end of it
php" I just changed it to "DirectoryIndex index.html" and it worked:) I can't believed it took only one line of code. Thanks again!...
Read more >How to Fix 'Index of /' issue while opening the website?
By default, when accessing your website simply by using the Domai. ... If those files are missing, you will only see the "...
Read more >Why is my page missing from Google Search?
The page may have been dropped or omitted from the index for totally innocuous reasons. (The web is immense, and Google doesn't get...
Read more >Resolve Access Denied errors from a CloudFront distribution ...
To troubleshoot Access Denied errors, first determine if your distribution's origin domain name is an S3 website endpoint or an S3 REST API ......
Read more >Troubleshoot index problems in Jira server
If JIRA is accessing its indexes across a network drive, Samba, ... Jira throws "LocalDate only handles the Common Era - no BC...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dibyadas I’m sorry for the delay but been busy with other things then the weekend happened and I had to do real life. 😦
Anyway I’ve done some digging and realized that this is the expected behavior.
What I’ve done is I created a new cluster with x-pack trial, this cluster has the following:
regularindex
regularrole
regularuser
with passwordregularuser
.regularrole
is only able to view the indexregularindex
.Now if we use curl to log into the cluster with our regular user and just view the root url
/
we get this error:BUT if we look our our index
regularindex
you can see that the request is authorized:Translating this into the python client we get the same behavior:
Long story short, if you want your user to be able to do
es.info()
you have to give permissions to your role to access monitoring.@dibyadas ok great. thank you for the feedback. I wanted to be sure you were using a security plugin (aka x-pack) that I am familiar with, and try to reproduce the issue.