Databases server firewalls in a load balanced setup

So I am in the process of planning my setup and reading up on things to get started. One of the things I was going to do was/is use iptables to restrict communication between an LB server and the one or more API servers I would be running. Seems fair I think.

Then I got to thinking about how I would be using iptables on the database servers, and I thought this isn’t really going to be feasible to update the iptables on all the database servers I have when, or if, I need to spin up a new API server.

So I was wondering if anyone had any tips when is comes to this type of firewalling problem or is it just a case of following the provided security tips from the relevant DB providers?

Just as a note I would using a MySQL, MongoDB and possible a Redis box.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

The easiest way to get around having to continually update your rules would be to access your database server via the private network and set up iptables to block all connections on your public IP. This way any droplet you spin up in the region will be able to reach your database server but it will not be accessible via a public IP at all.