Whitelisting ips to a website database
-
- New to forums
- Posts: 1
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Thu Mar 05, 2015 12:35 pm
Whitelisting ips to a website database
I'm wondering if it's possible to whitelist ips to only allow their connection to a database, is it possible?
-
- A regular
- Posts: 44
- Joined: Thu Feb 19, 2015 6:50 am
Re: Whitelisting ips to a website database
Well, firstly, remember that IPs change by default. So all the IPs will either have to be static or else you will have to frequently update scripts or whatever.
Now then, you could use PHP. It has a couple tools (e.g. $_SERVER) for getting the ip, and when connecting, make sure with an if that the ip matches one of the ips before connecting. Or consider htaccess, although if it is just a page or two that you want protected,... then maybe not that way. If you also want to restrict phpMyAdmin access, if you are not on NFOServers and this may apply to other servers, remember first that it is password protected. If you still wish to continue, you could add a htaccess to the phpMyAdmin folder.
I hope this helps!
PHP Website, although it already installed on NFO servers and many others
Handy .htaccess reference. htaccess comes with Apache servers, which all NFO servers are currently, I think.
Now then, you could use PHP. It has a couple tools (e.g. $_SERVER) for getting the ip, and when connecting, make sure with an if that the ip matches one of the ips before connecting. Or consider htaccess, although if it is just a page or two that you want protected,... then maybe not that way. If you also want to restrict phpMyAdmin access, if you are not on NFOServers and this may apply to other servers, remember first that it is password protected. If you still wish to continue, you could add a htaccess to the phpMyAdmin folder.
I hope this helps!
PHP Website, although it already installed on NFO servers and many others
Handy .htaccess reference. htaccess comes with Apache servers, which all NFO servers are currently, I think.
Re: Whitelisting ips to a website database
On NFO's web hosting it isn't possible to make a whitelist of IPs that can access your database, you either allow all remote IPs or none.
If you are using your own database server, the most common practice I have seen is to make a new user for every IP address you wish to allow.
For example:
Allow user1@host1
Allow user1@host2
What database software are you using, and who is the host? I can help better if I know these details.
If you are using your own database server, the most common practice I have seen is to make a new user for every IP address you wish to allow.
For example:
Allow user1@host1
Allow user1@host2
What database software are you using, and who is the host? I can help better if I know these details.
Not a NFO employee
Re: Whitelisting ips to a website database
I'm using the NFoservers webhosting and I'd like this feature too. It seems like something good to add for security measures, just to block the mysql port to all except for a whitelist of IPs (whitelist localhost and maybe a few gameservers, block everything else)
Re: Whitelisting ips to a website database
The MySQL server on web hosting serves all clients. Blocking access using a firewall as you suggested wouldn't make sense.Jake wrote:I'm using the NFoservers webhosting and I'd like this feature too. It seems like something good to add for security measures, just to block the mysql port to all except for a whitelist of IPs (whitelist localhost and maybe a few gameservers, block everything else)
The traditional way of whitelisting IPs is using mysql users, which NFO doesn't currently support. You could do this on your own MySQL installation though if you'd like.
Not a NFO employee