I'm trying to configure our ES instance so that anonymous users can index documents (but not modify existing docs).
Here's what I did:
Enabled security xpack.security.enabled: true
Configured a custom role in the UI. I tried various options (set "run as" to _anonymous, use all as the indices privilege to be sure that wasn't the problem) but non worked.
Create or update ingest pipeline requires manage_pipeline cluster privilege (docs)
I'm trying to configure our ES instance so that anonymous users can index documents (but not modify existing docs).
If this is your goal, it is not clear to me why you tested with creating/updating pipelines. The index privilege for this is create_doc (docs)
Also the error message you shared is not directly from Elasticsearch. Direct response from Elasticsearch would be more helpful if you run into further issues.
Thanks. I have tried with all for both cluster and index privileges and I get the same error.
The client does several things: set some ingest pipeline + index some documents.
I guess this is what I'm asking. How do I debug permissions issues in ES? Right now, what I've pasted is the result of the following logging configuration:
You'll need either server logs or server response, not client logs. It's probably better to use a simple command tool like curl for direct server response.
I have tried with all for both cluster and index privileges and I get the same error.
If you call GET _security/_authenticate with the anonymous user, what response do you get?
Hi @Yang_Wang . Sorry I was on holidays and I'm back only today. Thx for your last message.
I had already checked the server logs at /var/log/elasticsearch/elasticsearch.log but I don't see anything special (request results are not logged there apparently). Maybe I'm checking the wrong log file?
This will return the same result if called from the client side.
Actually just doing a GET on the root URL of the ES server returns a 502.
$ curl https://xxxx/activeinstalls2/
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.18.0</center>
</body>
</html>
$ curl https://xxx/activeinstalls2/_security/_authenticate
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.18.0</center>
</body>
</html>
If I turn off security, then this works fine so it must have to do with the security setup.
Sorry but I am not able to assist further unless we have direct response and log (better at debug level) from the ES server instead of the proxy (nginx) response.
With security turned on (xpack.security.enabled: true):
$ curl http://localhost:9200/
curl: (52) Empty reply from server
I've put logger.org.elasticsearch: DEBUG in elasticsearch.yml and I get debug logs but nothing related to the HTTP query from curl. Could you provide more information on how to get debug logs for permissions and query processing?
Actually, without debug logs, I see the following which could be one problem:
[2022-06-13T14:10:28,042][WARN ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [elk-xwikiorg-prod] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/127.0.0.1:9200, remoteAddress=/127.0.0.1:45876}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.