Proxy port with basex

Friday, 12 September 2014 · 3 messages · last reply 18 Sep 2014
FK
Furqan Khan12 Sep 2014 07:22 #
i was wondering if u could suggest how to use the proxy port option that comes wit basiX. Or is there any way by which i can capture the xpath queries issued from a web application ,before the actually hit the BasiX database at back end (Sort of proxy between a web app and database server 'basix in this case'.). Any suggestions would be highly appreciated.....
CG
Christian Grün12 Sep 2014 17:50 #
Hi Furquan, do you use the classical REST interface to send your XQuery expressions to the server? In that case, you could either check out the logging facilities by the applied web server (possibly Jetty) or play around with another proxy like nginx [1]. You will be more flexible by using RESTXQ [2] and writing server-side XQuery code. The XQuery Module [3] or the Client Module [4] can be used to evaluate the received query. Hope this helps (and thanks for writing to the mailing list), Christian [1] http://nginx.org/ [2] http://docs.basex.org/wiki/RESTXQ [3] http://docs.basex.org/wiki/XQuery_Module [4] http://docs.basex.org/wiki/Client_Module
CG
Christian Grün18 Sep 2014 10:50 #
Hi Furqan (cc to the list), sorry for letting you wait.
Quoted text · Christian Grün · 3 lines
> how ever what i intend to do is that,after the query is issued from the web > application for the basex -db running on port 8984,i want to capture it > before it hits the database,in order to evaluate malacious queries.....
What should happen in your opinion if a query is malicious? Would you like to prevent its execution, or would you rather want to be able to track that a malicious query has been evaluated at some stage? In the latter case, you could check out the log files [1], in which all commands and server requests will be listed.
Quoted text · Christian Grün · 10 lines
> So i was wondering if this would be possible using a reverse-proxy in front > of basex-db,such that all the traffic intended for the database would be > passed thrugh my proxy......say on port 80 > Or if there is any other way i could do it. > Basex comes with an option of proxy port and proxy host...will they work for > the scenerio that i described. > i mean if i set the proxy port of basex to be port 80 :where my appache or > nginx server would be running > ,will the queries from web application (xpath n xquery),pass through that > server running on port 80......
I guess that the BaseX proxy options won't help you there, because these mainly exist to handle firewall restrictions. Hope this helps, Christian [1] http://docs.basex.org/wiki/Logging
Quoted text · Christian Grün · 33 lines
> i tried out nginx without setting proxy port of basex ,but it gives n error > as nginx runs on port 80 and i want it to monitor traffic of port > 8994(basix),and at this port already basex server is running cuz of which my > nginx server cant listen to traffic (the error i got was a access > /permission error)n i guess it was cuz basex had permission rights over the > port.... > > i would greatly n highly appritiate any help and suggestions. > regards > > On Fri, Sep 12, 2014 at 8:50 AM, Christian Grün <christian.gruen at gmail.com> > wrote: >> >> Hi Furquan, >> >> do you use the classical REST interface to send your XQuery >> expressions to the server? In that case, you could either check out >> the logging facilities by the applied web server (possibly Jetty) or >> play around with another proxy like nginx [1]. >> >> You will be more flexible by using RESTXQ [2] and writing server-side >> XQuery code. The XQuery Module [3] or the Client Module [4] can be >> used to evaluate the received query. >> >> Hope this helps (and thanks for writing to the mailing list), >> Christian >> >> [1] http://nginx.org/ >> [2] http://docs.basex.org/wiki/RESTXQ >> [3] http://docs.basex.org/wiki/XQuery_Module >> [4] http://docs.basex.org/wiki/Client_Module > >

⚡Generated with XQuery