Database Security and Defaults
Ayende Rahien warns that using the out-of-the-box defaults may expose your public-facing database far more than you realize.
Join the DZone community and get the full member experience.Join For Free
The nightmare scenario for a database vendor is something like this: Over 27,000 databases managed by MongoDB held to ransom; 99,000 still vulnerable.
To be fair, this isn’t quite the nightmare scenario. The nightmare scenario would be if this would be due to some vulnerability in the database, but in this case, this isn’t that at all. It is simply that admins have setup a publicly visible database with no permissions on the internet, and said “okay, we are done, what is the next ticket?”.
Now, I presume that it didn’t really went on like that, but the problem is that if you follow the proper instructions, you are fine, by default, all your data is exposed over the network. I’m assuming that a few of those were setup by a proper dev ops team, and mostly they were done by “Joe, we are going to prod, here are the server credentials, make sure that the db is running there”. Or, also likely, “We are done with dev, we can just use the same servers for prod”, with no one going in and setting them up properly.
You should note that this isn’t really about MongoDB specifically (although this is the one that has the most noise at the moment). This makes for a pretty sad reading, you literally require nothing to do to “hack” into production systems, and access over 600 TB of data (just for MongoDB).
The scary thing is that you have questions like this: bind_ip = 127.0.0.1 does not work, but 0.0.0.0 works.
So the user will actively try to fight any measure you have to protect them.
With RavenDB, we have actually made it a startup error (the server will abort) if you are running a production instance (identified with a license) but you don’t require authentication. Now, there are scenarios where this is valid, such as running on a secured network, but they are pretty far, so you have a configuration option that you can set that will enable this scenario, but that require an explicit step and hopefully get the user thinking. With RavenDB 4.0, we’ll require authentication (or explicit configuration override) whenever a user ask us to bind to an interface other than localhost.
I think that is one case where you have to reverse “let’s make it easy to use us” and also consider putting hurdles to actually get it running. Because in the long run, getting this wrong means that it is very easy to shoot yourself in the foot.
Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Which Is Better for IoT: Azure RTOS or FreeRTOS?
Integration Testing Tutorial: A Comprehensive Guide With Examples And Best Practices
Using OpenAI Embeddings Search With SingleStoreDB
Send Email Using Spring Boot (SMTP Integration)