Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

solr security for web apps

I have a web app which gets its data from a Solr instance (Tomcat) Additional queries are done client side with AJAX, the data is directly pulled from Solr. Now this gives users the option to perform any query they like, and is of course a huge security hole. It's not a particular big issue for this particular app, but I'm curious at how to fix this. How to secure Solr, when client side AJAX calls are required? (Preferably I would solve this with PHP.)

like image 565
Eelke Avatar asked May 04 '26 02:05

Eelke


1 Answers

Instead of querying solr directly, you could create a simple PHP wrapper that limits the types of queries that are possible. Then, the client queries this PHP script which then queries solr. Once you've done that, you can limit access to the solr server to localhost either through the firewall or with your Java applications server.

like image 156
jmans Avatar answered May 05 '26 23:05

jmans



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!