Search code examples
solrsolrcloud

SolrCloud 6 user access to /solr/collection/admin/ping


I am new Solr, i have deployed a SolrCloud cluster of 4 nodes with external zookeeper of 3 nodes. I deployed a security.json file to the zookeper which restricts access to the cluster. I have 2 users (admin, user1).

{
"authentication":{
"blockUnknown":true,
"class":"solr.BasicAuthPlugin",
"credentials":{
  "admin”:”asdjboagsdbpnabojfm”,
  "user1”:”jsidafhoihda0idfhnasndi”},
"":{"v":15}},
"authorization":{
"class":"solr.RuleBasedAuthorizationPlugin",
"permissions":[
  {
    "name":"all",
    "role":"admin",
    "index":1},
  {
    "name":"security-edit",
    "role":"admin",
    "index":2},
  {
    "name":"read",
    "role":"dev",
    "index":3},
  {
    "name":"update",
    "role":"dev",
    "index":4},
  {
    "name":"collection-admin-read",
    "role":"dev",
    "index":5},
  {
    "name":"config-read",
    "role":"dev",
    "index":6}],
"user-role":{
  "admin":[
    "admin",
    "dev"],
  "user1":["dev"]},
"":{"v":39}}
}

when i try the following url,

curl -u admin:password -k -s "https://solrcloud-01.dfw.3mhis.vm:8080/solr/test/admin/ping?wt=json&indent=on"

Note: test is a collection of 2 shards with 1 replication on each shard. I get "200 STATUS OK" response, but i when i try it as user1 it gives me unauthorized request. what am i doing wrong here. Also the solr version is 6 where ping is one of the Implicit available endpoints available according to https://cwiki.apache.org/confluence/display/solr/Implicit+RequestHandlers


Solution

  • Basically i gave the permission as follows to the security.json

    {   "path":"/admin/ping",
        "role":"dev",
        "index":7
    }