Solr 5.3 & Zookeeper Security Authentication & Authorization

眉间皱痕 提交于 2019-12-04 19:59:55
Gaurav Kumar

I also faced the same issue and then I looked at the source code.

The read permission in RuleBasedAuthorizationPlugin is defined as :

         read :{" +
         path:['/update/*', '/get']}," +

Which will never work.

I have raised an issue:

https://issues.apache.org/jira/browse/SOLR-8439

Now, to lock down your admin ui completely, you need to define a new permission, with path="/", which will going to solve your issue, something like this:

curl --user solr:SolrRocks http://localhost:8983/solr/admin/authorization -H 'Content-type:application/json' -d '{
"set-permission" : {"name":"admin-ui",
                     "path":"/",
                     "before":"update",
                     "role":"admin"}}' 

Start by using the default user/Pw given in the Solr tutorials.

The passwords are hashed sha512 with a salt. Solr provides the encryption from the plaintext passwords when you create new authenticated users, but the pw in the Lucidworks instructions is already encrypted for the plaintext value: solrRocks (or similar) - use that account to create others, give them appropriate permissions, then remove the solr:solrRocks account.

Did you forget setting the blockUnknown to true? Your authentication block in security.json should be:

"authentication":{
   "blockUnknown": true,
   "class":"solr.BasicAuthPlugin",
   "credentials":{"solr":"..."}
},

If you don't set it, it will allow all anonymous access! It is strange but here is the source: 'blockUknown:true' means that unauthenticated requests are not allowed to pass through [1]

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!