apache - Securing Update and Delete queries in Solr -


i have website displays product information using solr, , managed via url. curious how go preventing regular users updating or deleting apache solr documents via url. want admins can submit these queries.

i assume there way have username , password verify arbitrary user admin, allowing url request modify data. useful, problem don't want users website ui have opportunity see log-in message in event enters query url.

does know of solution / done similar?

1) 1 solution run solr on different port (say 8081) , have os firewall block requests port 8081 excluding public ip of machine using manage admin, allowing local machine access 8081.

this firewall configuration i'm using in iptables on centos machine

-a input -p tcp --dport 8081 -s 111.222.333.444 -j accept

-a input -p tcp -m tcp --dport 8081 -j drop

and secure admin further added following security-constraint web.xml digest auth-method

<security-constraint>      <web-resource-collection>          <web-resource-name>admin</web-resource-name>          <url-pattern>/admin/*</url-pattern>          <url-pattern>/admin.html</url-pattern>     </web-resource-collection>     <auth-constraint>          <role-name>admin</role-name>      </auth-constraint> </security-constraint>   <security-constraint>     <web-resource-collection>         <web-resource-name>admin images</web-resource-name>         <url-pattern>*.png</url-pattern>     </web-resource-collection>     <auth-contraint>         <role-name>admin</role-name>     </auth-contraint> </security-constraint>  <login-config>     <auth-method>digest</auth-method>     <realm-name>secure</realm-name> </login-config> 

2) option add above security-constraint 2 different roles i.e. user , admin. user's user role able access select url-pattern , users admin role able access admin url-pattern.

i recommend using digest authentication because basic authentication can spoofed attackers.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -