I have a PHP Application, hosted on IIS 7 Server.
The Application needs to be secure for a customer (based in Germany).
The problem I face is that the only security I have used is cookies.
Their solution would be to use some sort of IP Address based security, where only access from certain IP Addresses would be permitted.
The problem I see with this is that the customer has numerous different ‘sites’ across Germany, which would have their own servers and therefore different IP Addresses and in some cases, no server at all.
So my questions are:
- Is IP Address security a viable option?
- Would the customer’s request be a valid concern?
- What would be the best practice of implementing the request?
Why cant you just use username/password authentication using sessions?
OK, some of their divisions, might delete cookies on closing their browser, or each time they login to their PC, and they don’t want to login each time, IP Address check would be preferable.
They are “the boss” of course, but I would not recommend that. If someone makes mess in system - who would be held responsible? To your application whole division might look like single IP address.
Anyhow… if they insist on this solution - you have several options:
- Specify allowed addresses at firewall level (that would however provide all or nothing access, meaning, that no part of site would be accessible from non approved IP address)
- Specify allowed addresses at web-server level (in case of httpd using mod_access and .htaccess file you can specify which addresses would be able to open which url)
- Specify allowed addresses at application level (in PHP that would mean using $_SERVER[‘REMOTE_ADDR’] - this gives you most flexibility, but also requires most expertise on your part)
IP address validation is very unreliable. The client IP can be blocked from the web server by various proxy servers and some firewalls. If you want to restrict access to only certain computers maybe a VPN would be a more bulletproof solution.