Search code examples
mysqlsslherokuwhitelist

Security: SSL Connection vs IP Whitelist for a database


I'm setting up an application on Heroku that uses a MySQL database.

The client would like to use a MySQL database that has an explicit whitelist that allows it to connect. However, due to the dynamic IP nature of Heroku, this proves to be quite complex; we have to use an add-on such as QuotaGuard to provide us a static IP in which we can access the database.

This proxy routing is causing issues for us in other places as other services that use dynamic IPs are attempting to access the database and are failing.

My question is the degree of security a whitelist really provides rather than a complex username/password with SSL.

Has anyone had experience with the two and can speak to the advantages disadvantages?

Thanks


Solution

  • Allow me to rephrase your question:

    What is the advantage of setting up a complex dynamic IP tracker system vs. simply securing the link?

    An IP can be spoofed, by the way, so this solution is not that secure (right, such an attack requires some non-trivial black magic, but is quite feasible in fact).

    Configuring MySQL for SSL support is really not that complicated and very well documented.

    And if you can't recompile or reconfigure MySQL, you can still establish a simple VPN between your client application and your MySQL server (and only allow connections from this VPN).

    Unfortunately, I don't know if your provider allows this level of configuration on your instances.

    So if all of the above in not possible, you can still create a random 10000-character long password. Not secure enough for a purist, but I wish the hackers good luck :)