This is what I have done so far to protect my SOLR application.
In SOLR web.xml I am trying to do the following
- Allow / select the request only for user or administrator requests.
- Deny any other SOLR request to another, and then to the administrator.
I have added security restrictions to the SOLR web.xml file
<security-constraint> <web-resource-collection> <web-resource-name>Solr Admin</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>admin</role-name> </auth-constraint> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>Public</web-resource-name> <url-pattern>/primary/select/*</url-pattern> <url-pattern>/reindex/select/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>user</role-name> <role-name>admin</role-name> </auth-constraint> </security-constraint>
This is how I create a SOLR HTTP connection in my client application
The tomcat-users.xml file has roles and users installed as
<role rolename="user"/> <user username="user" password="user" roles="user"/> <user password="admin" roles="manager-script,admin" username="admin"/>
The above works fine. Obviously, in production I will have a stronger username and password.
Question
Is there anything else to protect my SOLR instances or is this enough? I have 1 instance of Tomcat 7 that runs the client application and the SOLR application. This is what I am trying to achieve.
- Do not let anyone enter the admin without a username and password.
- You donβt want someone accessing another kernel, not my client application.
I can add Spring Security to SOLR on top of the above, but is this necessary?
source share