hi,
here is my basic elasticsearch.yml file :
cluster.name: es52
node.name: node1
path.data: C:\elasticsearch\elasticsearch-5.2.0\data
path.logs: C:\elasticsearch\elasticsearch-5.2.0\logs
bootstrap.memory_lock: true
http.port: 9200
readonlyrest:
enable: true
response_if_req_forbidden: Forbidden by ReadonlyREST ES plugin
access_control_rules:
- name: Accept requests from users in group team1 on index1
type: allow
groups: ["team1"]
indices: ["index1"]
- name: Accept requests from users in group team2 on index2
type: allow
groups: ["team2"]
indices: ["index2"]
users:
- username: user1
auth_key: user1:pw1
groups: ["team1"]
- username: user2
auth_key: user2:pw2
groups: ["team2"]
The indexes
i’ve created 2 indexes and in each index one document.i used these commands:
PUT index1/type1/1
{
"f1":"f1"
}
PUT index2/type2/1
{
"f2":"f2"
}
TEST 1 (curl command line)
using the “curl” command line and it works as expectet :
$ curl localhost:9200/index1/_search?pretty
Forbidden by ReadonlyREST ES plugin
$ curl -u user1:pw1 localhost:9200/index1/_search?pretty
{
"took" : 64,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [
{
"_index" : "index1",
"_type" : "type1",
"_id" : "1",
"_score" : 1.0,
"_source" : {
"f1" : "f1"
}
}
]
}
}
$ curl -u user1:pw1 localhost:9200/index2/_search?pretty
Forbidden by ReadonlyREST ES plugin
$ curl -u user2:pw2 localhost:9200/index2/_search?pretty
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [
{
"_index" : "index2",
"_type" : "type2",
"_id" : "1",
"_score" : 1.0,
"_source" : {
"f2" : "f2"
}
}
]
}
}
TEST 2 (browser)
and i keep failing this test when using :
http://user1:[email protected]:9200/index1/_search?pretty
or
http://user2:[email protected]:9200/index2/_search?pretty
in test2 i use chrome 57
please advise.