Search code examples
ajaxserverwebserverhttp-postws-security

How to make Web Server B only accessible by Web Server A


Explanation

I need to post form data from server A To B using AJAX to store the data on a database but I don't know how to achieve this securely to prevent cross site forgery attack.

Question

How Do I do it? Is it possible to access server B only by server A?


Solution

  • Safest way would be to use iptables or hosts.allow/deny if your servers are runing on a unix-system. The apache module is platform independent. But beware to use #-comments in the configuration because this may make your server vulnerable https://vigilance.fr/vulnerability/Apache-httpd-rules-added-by-mod-access-compa‌​t-or-mod-authz-host-16636