On 12/25/2015 12:17 PM, Eric Dain wrote: > Does allowing javascript direct access to SolrCloud raise security concern? > should I build a REST service in between? > > I need to provide async search capability to web pages. the pages will be > public with no authentication.
End users should never have access to Solr. Access to Solr from the end-user machine is required if you want to accept Solr responses directly. In one of the other replies that you received, Doug has given you an nginx config for proxying access to Solr -- indirect access. This can protect against *changes* to the index, and it has protection against high start/rows values, but there are many other ways that an attacker can construct denial of service queries, which this proxy config will not prevent. I think that indirect access (through a proxy) should not be allowed either, unless you can trust all the people that will have access. If Solr is open to a sufficiently wide audience (especially the Internet), someone will find a way to abuse the service even with a proxy, either to cause harm or to learn things they shouldn't know. The most secure option is to only allow the webservers and trusted administrators to access Solr. All end user (Internet) access to Solr should be handled through a custom web application. This might be something that you find and install (such as wordpress, drupal, etc), or one that you write yourself. You can still do AJAX while maintaining security. You'll need to write something in a server-side web programming language like PHP, Java, etc. This code will need to accept the AJAX requests from your client-side javascript code, validate the request parameters to make sure they're sane, get a response from Solr, and return relevant data. If the parameters don't validate, return an error, and handle that error appropriately in the javascript code. Thanks, Shawn