News for hackers. Stuff that matters.
Re:The MongoDB hack and the importance of secure defaults by 51Cards on Wednesday January 11, 2017 @11:06AM (#13374885)
I have never used MongoDB so I admit I'm talking blind here, but can someone explain how/why a piece of highly popular software gets to version 2.6 allowing unsecured remote connections by default? Further to that is that type of thinking you want in the development process of something as critical as a database engine? It just seems amazing to me that it got so far before the community in general pushed back that this was really bad design? Hopefully someone with MongoDB history can explain if this was a long term sticking point, etc. Thanks.
Re:The MongoDB hack and the importance of secure defaults by pmlnr on Wednesday January 11, 2017 @12:20PM (#13375560)
If this is not addressed at a _very_ early state of a software, it will stick, because people get used to it and you drive people away by backwards-incompatible changes.

Especially if it's a software that's targeting people who wants things easy & fast, like Mongo did at the beginning.

See reasons[1] for WordPress needing to be PHP 5.2 compatible, which had been out of support for 6 years.

[1]: https://www.rarst.net/wordpress/technical-responsibility/

Re:The MongoDB hack and the importance of secure defaults by pjc50 on Wednesday January 11, 2017 @11:12AM (#13374928)
At a guess, it became popular through easy setup. That includes not having to configure login.

That's why so many other systems are insecure. Security nearly always increases friction.

Re:The MongoDB hack and the importance of secure defaults by __jal on Wednesday January 11, 2017 @12:21PM (#13375575)
This.

I once had a conversation with someone who started an open source project about the "10K meter" view. I strongly encouraged secure defaults. He asserted that when getting started, grabbing mindshare requires insecure-out-of-the-box. They could fix that later.

Later never came; the project died (Not due to security). But I'm pretty sure something like this would have happened if it had taken off, because later doesn't come until something like this happens.

I don't know how wide-spread this thinking is, but it slots in well with a lot of the decisions I see made by other startup types. There seems to be a lot of conventional wisdom about the slimy-ish shortcuts and deceptions, bad design decisions, and so on that are "OK" to make to get off the ground. I'm not going to comment on the necessity of that sort of bad behavior from a business context; I think the answer is complex, and kind of appalling. But on the engineering side, it seems to usually lead to nasty things coming back to bite you, and it is notable that it does so after you've gotten attention and people depend on you.

Re:The MongoDB hack and the importance of secure defaults by hinkley on Wednesday January 11, 2017 @01:00PM (#13375918)
I still think the XP guys had this figured out. You scale with your customers and stop trying to write it perfect the first time. I'm a huge proponent of never making the same mistake twice but there is just not enough time in the day for perfect.

Instead you write it in a way that it has the potential to be great.

Customers that have been using your software for a year will have different problems when they have been using it for four.

On one project we essentially had a goal of doubling our data capacity of our (on premises) software every year to stay ahead of our customers' data collection rate. So my goal was 10% per month. We kept on that treadmill for over two years. Yes a couple of those months involves some pretty deep changes to get to a better info architecture. But most of it was constant application of the campsite rule.

That said, in that same project we added security and permissions after the fact, and it was one of the most frustrating things I've ever done. A constant and unending stream of bad news from QA about some other spot we missed.

Re:The MongoDB hack and the importance of secure defaults by aclsid on Wednesday January 11, 2017 @02:50PM (#13376902)
Sounds a lot like translating a web app after it was released. In a company I was working on, we made a commitment to call out strings without gettext as a bug, regardless if it was really was going to be used for a single country/language. It really takes no effort to do it the first time, but adding that stuff later on is major bs.
Re:The MongoDB hack and the importance of secure defaults by Pxtl on Wednesday January 11, 2017 @05:23PM (#13378051)
The reason it's hard to bolt-on after the fact is that languages conflate the concept of "string" and "user-facing text". If "user-facing text" had a different type or method or whatever, it would be trivial to find all references in your codebase and consolidate them into gettext stuff. But instead, every inline dynamic sql, every dictionary key, every http parsing looks like user-facing text.
Re:The MongoDB hack and the importance of secure defaults by hinkley on Wednesday January 11, 2017 @03:30PM (#13377244)
I've found that you can grease the wheels a lot by explaining to management that using the localization features of the language means that stories don't get held up by arguments about terminology. That's been sufficient to get them to agree to localization on three products, two of which almost immediately got surprise customers (or new owners) for our "always english only" application that suddenly wanted it in 3 languages in 3 months. :/

But for now, if I use this technique in the code, and you business guys want to start calling files 'assets', or clients 'customers' (or vice versa), then you guys can go fight it out in a room and just tell me what you want afterward.

Re:The MongoDB hack and the importance of secure defaults by hinkley on Wednesday January 11, 2017 @03:15PM (#13377132)
Oh, we did that too (and somehow I ended up being in charge of both. Whoopie!) But I decided to cut myself off at two sob stories :)

Security, concurrency, and localization are three things you can't just tack on later. Anyone 'test infected' would add automated testing to that list too. They all involve a long game of whack-a-mole and they're IME bad for morale and productivity.

Re:The MongoDB hack and the importance of secure defaults by Bluestrike2 on Wednesday January 11, 2017 @03:07PM (#13377069)
It's really, really easy to pass things off for later and then lose track of them. What's worse is that, once some task is "lost," it's even easier to assume that it's already been completed. And when that happens, we can completely block it off from thought as we concentrate on other tasks unless some external stimulus causes us to think about it again.

It's not a perfect comparison, but there are some similarities to the tragic cases of children being left in hot cars in the summer. Dozens each year, largely by parents who aren't abusive, neglectful, or what most would consider to be "bad parents."[0] Instead, it's what's called a prospective memory failure: habitual memory processes override prospective memory, which by its very nature involves additional cognitive mechanisms. There are a couple of PM theories, but the multi-process model suggests that PM cues can trigger a prospective intention even without an active monitoring process. Miss or interrupt the cue, and the intention isn't retrieved and followed through on. Failures such as airplane crashes when pre-flight tasks are interrupted and tasks are missed,[2] fatal anesthesia incidents,[3], fires because gas appliances were left on, etc. A number of industries have been putting more effort into hedging against PM failures over the past few years through better checklists and other aids and precautions precisely because the consequences can be so tragic.

Getting back to the topic at hand, the issue with dumb shortcuts like insecure defaults isn't that they're bad on their own but that the way our brains work makes it less likely that we'll go back and fix all aspects of those shortcuts later before a problem arises. Documenting your shortcuts, setting reminders, and other actions can help minimize that likelihood, but how likely is it that you'll do so when you're in the middle of taking an ill-advised shortcut in the first place? At that point, you might as well spend the time to do it right.

It's the same danger that comes with hotfixes. Even when you have no other choice, you've put yourself in a position that could have unseen danger later on. Having a policy in place (checklists?) for dealing with something like that can help you avoid PM failures by forcing you to go back and retroactively apply your normal procedures to the patch in question. Style guides and other guidelines help as well in everyday circumstances, even though they can be a bit annoying at times. Because no matter how you look at it, mistakes will be made.

Insecure defaults and stupid shortcuts make it more likely by stacking the deck against the people working on a project.

0. http://www.cnn.com/2016/07/25/health/hot-car-deaths-explaine...

1. http://www.psych.wustl.edu/learning/McDaniel_Lab/Prospective...

2. http://www.psychologicalscience.org/news/releases/when-we-fo...

3. http://anesthesiology.duke.edu/?page_id=826043

Re:The MongoDB hack and the importance of secure defaults by giancarlostoro on Wednesday January 11, 2017 @11:34AM (#13375107)
IIRC on Debian it is by default not listening externally. So ideally on Ubuntu as well. Though that is Debian / Ubuntu specific, elsewhere they likely ship with default configs. Still no default authentication, but still better than just letting anyone externally connect to it.
Re:The MongoDB hack and the importance of secure defaults by hackcasual on Wednesday January 11, 2017 @11:41AM (#13375195)
But if a substantial use case requires it to listen remotely, you're just delaying disaster. Listening remotely should have required an authentication setup, or an additional configuration directive like "imbeingatotalidiotandamopeningmydatatuptoanymaluciousactors": true
Re:The MongoDB hack and the importance of secure defaults by at_tt on Friday January 13, 2017 @06:50PM (#13395828)
Yeah though configuring login is not something that takes more time than to set it up.
Re:The MongoDB hack and the importance of secure defaults by hinkley on Wednesday January 11, 2017 @12:41PM (#13375742)
In other disciplines they call this pandering. I'll never know why some of us see it as virtue.
Re:The MongoDB hack and the importance of secure defaults by recursive on Wednesday January 11, 2017 @01:48PM (#13376383)
It's easy to see why having a lot of users is desirable.
Re:The MongoDB hack and the importance of secure defaults by pjc50 on Wednesday January 11, 2017 @03:07PM (#13377063)
Pandering tends to be profitable in other disciplines too.
Re:The MongoDB hack and the importance of secure defaults by hinkley on Wednesday January 11, 2017 @03:17PM (#13377147)
I know a couple where it's -really- profitable.

But most of us chose not to do that for a living.

Re:The MongoDB hack and the importance of secure defaults by user5994461 on Wednesday January 11, 2017 @01:22PM (#13376134)
MongoDB was easy to setup and new. It got popular among developers who always jump to the latest trend and don't care about quality, maintenance or long term support.

Internally everything is screwed, from the architecture to the security settings, to the reliability of data storage (or lack thereof).

MongoDB is the school case of 1) Worse/bad software can succeed despite being bad. 2) Don't trust hype. 3) Developers in general have low standards.

Re:The MongoDB hack and the importance of secure defaults by bqe on Wednesday January 11, 2017 @12:07PM (#13375449)
This is also the case for Elasticsearch. In fact, to get a proper username/password/ACL setup, you need to pay for professional support.
Re:The MongoDB hack and the importance of secure defaults by reqres on Wednesday January 11, 2017 @12:20PM (#13375556)
IIRC, there was also a time when Elasticsearch used multicast by default to detect other ES nodes on the network and to add them to the cluster automatically. So any node joining the same network will join a cluster and have shards allocated to it
Re:The MongoDB hack and the importance of secure defaults by hinkley on Wednesday January 11, 2017 @01:04PM (#13375953)
Early J2EE frameworks did that too. Super fun when your dev box clusters with a coworker and undoes your regression testing because half of the tests run on an older version of the code!
Re:The MongoDB hack and the importance of secure defaults by sneakymichael on Wednesday January 11, 2017 @02:17PM (#13376647)
It seemingly still does; I'm just getting started with Elasticsearch & your description aligns with what I've read in the introduction guide
Re:The MongoDB hack and the importance of secure defaults by polyfractal on Wednesday January 11, 2017 @03:08PM (#13377080)
Just FYI, multicast discovery was moved to a plugin in v2.0 [1], deprecated in v2.2 [2] and removed entirely in v5.0 [3]

- [1] https://www.elastic.co/guide/en/elasticsearch/reference/2.0/...

- [2] https://www.elastic.co/guide/en/elasticsearch/plugins/2.2/di...

- [3] https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/di...

Re:The MongoDB hack and the importance of secure defaults by vkou on Wednesday January 11, 2017 @01:16PM (#13376078)
Because trivialities like requiring your users to set a password on their database are barriers to adoption.

Move fast, and break things - you're not responsible for the damage your product does. Our industry both optimizes for, and rewards this kind of behaviour.

Re:The MongoDB hack and the importance of secure defaults by andersonmvd on Wednesday January 11, 2017 @12:14PM (#13375503)
We usually can't see the same problems happening in front of our noses. Why shouldn't we discuss why docker images run as root by default then?
Re:The MongoDB hack and the importance of secure defaults by jcrawfordor on Wednesday January 11, 2017 @12:45PM (#13375769)
I think we absolutely should discuss this - the number of images I see on Docker Hub that run complex network services as the root user really concerns me. The security measures implemented by Docker reduce the risk but absolutely do not eliminate it, you're taking a big risk there.

This issue, along with its related issues with permissions on persistent storage, is one of the major reasons I'm hoping to move away from Docker as soon as possible.

Re:The MongoDB hack and the importance of secure defaults by tannhaeuser on Wednesday January 11, 2017 @01:55PM (#13376443)
What Docker security measures do you mean? Actually, I was wondering recently what isolation Docker provides that a basic chroot-jail doesn't.

Re root permisions I guess if you're running a typical network daemon (Apache, say), then requiring Docker to run as root is no worse than running the service on the host; root would be a requisite anyway for the daemon to open privileged ports/gain logging permissions etc. before dropping to "nobody" or what have you.

Re:The MongoDB hack and the importance of secure defaults by kccqzy on Wednesday January 11, 2017 @02:36PM (#13376795)
Docker drops capabilities of root by default. It doesn't drop everything but better than not dropping at all.

If you are not using docker, you can manually add the specific privilege to open low-numbered ports without running the program in question as root.

Re:The MongoDB hack and the importance of secure defaults by hitgeek on Wednesday January 11, 2017 @11:23AM (#13375008)
at v2.6 the product was only about 4 years old and underwent a lot of change during that time. (For comparison Postgres version 3 was released in 1991)

I think the main guilty parties at mongodb were/are in marketing.

technically sophisticated users understood the immaturity of the product and the tradeoffs that came with its architecture.

however it was sometimes marketed as a general purpose data store, or as an alternative to much more mature relational data stores, which was and still is an unfair comparison.

Re:The MongoDB hack and the importance of secure defaults by nailer on Wednesday January 11, 2017 @11:34AM (#13375113)
Even technically sophisticated users should be able to expect secure defaults.
Re:The MongoDB hack and the importance of secure defaults by omni on Wednesday January 11, 2017 @11:59AM (#13375377)
Semantic counterargument: If you put a database into production without understanding its network and auth configuration then you are by definition not "technically sophisticated"
Re:The MongoDB hack and the importance of secure defaults by salvor on Wednesday January 11, 2017 @12:48PM (#13375790)
This. So much this.
Re:The MongoDB hack and the importance of secure defaults by nailer on Wednesday January 11, 2017 @12:32PM (#13375667)
By this standard, every programmer who puts an app into production without understanding assembly is not technically sophisticated.

We could expect every programmer to have domain knowledge of databases, even when it's not normally needed to operate one.

Or we could just make databases not acknowledge writes that haven't happened, not listen on all ports, not hide information about data loss in non-clustered setups deep inside the documentation.

Counterargument: many people who are good at a particular topic enjoy feeling superior to people who don't have their knowledge.

Re:The MongoDB hack and the importance of secure defaults by hitgeek on Wednesday January 11, 2017 @01:03PM (#13375948)
at the time these versions of mongodb were released, it was only a few years old, and DID require considerable domain knowledge to run in production. This does not seem unreasonable for new immature technologies.

unfortunately, I don't think this was always communicated effectively by the explosion of mongodb marketing and hype.

Re:The MongoDB hack and the importance of secure defaults by nailer on Thursday January 12, 2017 @11:11AM (#13383354)
> DID require considerable domain knowledge to run in production.

What do you mean? If you you mean it took knowledge to run per se: it didn't: unzip and run the service, it's up. It wasn't any more complex than any other piece of software.

Or do you mean it did require considerable knowledge to avoid data loss on software marked as 'stable'? Yes, that's the problem, and yes, that's unreasonable.

Re:The MongoDB hack and the importance of secure defaults by user5994461 on Wednesday January 11, 2017 @01:27PM (#13376187)
Sophisticated users understand when to adopt a product. MongoDB had all the red flags, a sophisticated user would have done a trial and ban it with a company-wide memo after the first week and already the 3rd disaster.
Re:The MongoDB hack and the importance of secure defaults by at_tt on Friday January 13, 2017 @06:52PM (#13395844)
Sophisticated users without setting up authentication and backup for their valuable data?
Re:The MongoDB hack and the importance of secure defaults by raverbashing on Wednesday January 11, 2017 @02:53PM (#13376926)
Yes, you could expect. But you would check.
Re:The MongoDB hack and the importance of secure defaults by richardwhiuk on Wednesday January 11, 2017 @11:12AM (#13374932)
In production deployments, unsecured remote connections might be fine, because security would be handled at the network layer (e.g. by deploying MongoDB on a VLAN which only was accessible by your MongoDB clients which were on separate servers).
Re:The MongoDB hack and the importance of secure defaults by hinkley on Wednesday January 11, 2017 @01:14PM (#13376060)
Before VMs and the cloud you'd buy a server with three or more network cards in it and you ended up with physically separate networks just because you could and it staved off network saturation. That it simplified your security architecture was the cherry on top.

But Mongo pretty much rejected that world view (web scale!) so it's a little odd that they designed a system that only works in it.

Re:The MongoDB hack and the importance of secure defaults by raverbashing on Wednesday January 11, 2017 @12:28PM (#13375633)
> In production deployments, unsecured remote connections might be fine

No. Absolutely not

Unsecured local connections yes, anything from outside 127.0.0.1 should be explicitly allowed and secured (like port 80/443). Rate-limited, fail2banned, fuzzed during testing, etc

Re:The MongoDB hack and the importance of secure defaults by Pxtl on Wednesday January 11, 2017 @02:25PM (#13376714)
"I opened the ports on the firewall and gave the user access, why doesn't it work!? This system is stupid."

"I changed my password on one system and then on the other, but somehow my account got locked up in that brief time between changeover, how the hell do you unlock an account? This system is stupid."

"We're scaling up and we're running into outdated rate-limiting settings on every service we use, some of them even having multiple layers of rate-limiting within a single service, and each setting requires hours of debugging to figure out which setting is taking down the whole project. This system is stupid."

There's a reason Mongo got adoption while "secure" systems did not.

Re:The MongoDB hack and the importance of secure defaults by raverbashing on Wednesday January 11, 2017 @02:42PM (#13376843)
To be honest, the issue is that a lot of secure systems make things more convoluted, unintuitive and/or frustrating than it needs to be, then calls the user stupid when they can't set it up
Re:The MongoDB hack and the importance of secure defaults by extrapickles on Wednesday January 11, 2017 @02:26PM (#13376720)
I agree. You always want to have at least two mistakes between you and getting harmed (more if you are handling anything valuable).

If you only have a VLAN separating you from harm, it only takes 1 bad switch configuration or any other device on the VLAN to accidentally be running a proxy or router.

Re:The MongoDB hack and the importance of secure defaults by richardwhiuk on Tuesday January 24, 2017 @10:20PM (#13478173)
A firewall, and a VLAN configuration. If you are allowing white listed access through your frontend firewall, then you need to screw up both.
Re:The MongoDB hack and the importance of secure defaults by cpuguy83 on Wednesday January 11, 2017 @12:03PM (#13375406)
This is a really bad practice to follow. You can't rely on the network to be secure.
Re:The MongoDB hack and the importance of secure defaults by hueving on Wednesday January 11, 2017 @01:49PM (#13376386)
That's true in many cases, but if the network is solely for database access and the only servers with access to it would be configured with DB credentials anyway, then the path to compromise is equivalent (get into a server with db credentials/network access).
Re:The MongoDB hack and the importance of secure defaults by aclsid on Wednesday January 11, 2017 @02:58PM (#13376983)
But why bother though? If somehow that network defense comes down because of maintenance or whatnot, you have just tainted your most precious asset out of wanting to save a couple of minutes for securing the connection.
Re:The MongoDB hack and the importance of secure defaults by Cozumel on Wednesday January 11, 2017 @12:07PM (#13375447)
This problem was caused by broken 'thinking' like that.
Re:The MongoDB hack and the importance of secure defaults by bogomipz on Wednesday January 11, 2017 @12:24PM (#13375596)
This is not unique to MongoDB however Elasticsearch is similar. The line they seem to tow is "this is made to be run behind a firewall." I agree its unacceptable but its unfortunately not unique to MongoDB.
Re:The MongoDB hack and the importance of secure defaults by user5994461 on Wednesday January 11, 2017 @01:33PM (#13376237)
That's not a fair comparison. ElasticSearch doesn't have authentication in the free edition. You gotta pay to get the authentication plugin.

ElasticSearch => Dropped authentication (i.e. an important aspect for security) to get a chance at monetization.

MongoDB => Dropped everything, including your data. YOLO!

Re:The MongoDB hack and the importance of secure defaults by bogomipz on Wednesday January 11, 2017 @02:07PM (#13376561)
Elasticsearch never had authentication. So they never dropped it from the free version. I feel like it is an appropriate comparison. The general response to Elasticsearch's lack of security was "your'e supposed to run it behind a firewall"

Elasticsearch got all the way to version 1.4 with no authentication as part of the design. Between 1.4.1 and 1.5 release candidates is when they announced Shield as part of their enterprise offering.

Here are the release dates and announcements:

https://www.elastic.co/blog/shield-know-security-coming-soon

https://www.elastic.co/downloads/past-releases?page=16

Re:The MongoDB hack and the importance of secure defaults by jsmthrowaway on Wednesday January 11, 2017 @02:52PM (#13376919)
Because it absolutely wasn't, and still isn't, necessary. Full stop. ElasticSearch speaks HTTP. Why would I want it to reimplement HTTP authentication when I can place it behind a reverse proxy that's already integrated with my company's AAA and has been doing nothing but HTTP for oh, three decades or so? Separation of concerns.

This is how this goes, and I've seen the pattern followed with several infrastructure services, even here in this HN thread right now:

1) A bug report comes in to AwesomeDB. "You do not have authentication support. This is bad. I'm going to yell about it on social media and make fun of you until you can accept a username and password, because everything in existence should write its own authentication code. Even MySQL takes passwords, dude, get with 2017."

2) A rough version is implemented by an intern, because authorization is way less sexy than hyperdimensional bloom filter quantum hash tables to speed up random reads. The intern then departs back to beer pong and nobody at AwesomeDB now understands the security infrastructure of their product.

3A) A mid-level executive, seeing the announcement, instructs me that I no longer have to keep AwesomeDB behind my 'stupid' reverse proxy + ACL solution and we can finally use native authentication and be really secure!

3B) Alternatively and more reastically, someone at Qualys adds "authentication is not turned on in AwesomeDB" to their scanning product and I get nastygrams from a contractor clicking "Scan" and copying and pasting the results for each of my fifty AwesomeDB instances.

4) During testing, I capture the credentials in plain text in about three minutes because it's a database. Why on earth would it terminate TLS? If we are down the 3B path above: Ha! Your move, security team!

5) Another bug report is filed against AwesomeDB to terminate TLS. Equal shaming is performed, because every service in the world needs to link in OpenSSL and terminate TLS, because that's never been a problem or backfired in any way. Oh yeah, and everyone has a different mechanism for handling certificates, and most don't bother to consider revocation.

(Just like the broader point I'm making about auth, stop adding TLS support to your systems. Please. If you speak TCP I can wrap you in something uniform that does a much better job anyway. You know how I know your integration is shitty? Because OpenSSL is hopelessly undocumented and the APIs even more so. You Googled and read a guide. How about instead, I can drop a pretty awesome TLS listener in front of you, potentially even in hardware! Whoo!)

6) TLS support is added to AwesomeDB. Cool! Now we can really be secure! (But nobody implements client certificates, so we still have to do the username/password shared secret business. And alternate DH parameters? What are those? They weren't covered in the guide, so AwesomeDB hardcoded a couple.) At this point, most people would put credentials directly in their repo. I'd sit around making the Vault argument, but nobody would listen. We have now traded my ACLs and authentication stack for security on our private GitHub repos. I set to work automating changing all of our infrastructure passwords every time an intern leaves the company. We still secure the network, of course, but now there's special strings of characters in existence to work around a competent network security strategy that already existed.

7) As a growing company we introduce LDAP and Kerberos. Oh wait, AwesomeDB and its home brewed authentication stack do not support LDAP because what startup needs LDAP?

8) Another bug report is filed against AwesomeDB for "LDAP support." A bunch of startup engineers spend several months trying to understand the guts of LDAP (I feel your pain) and, worse, the cornucopia of vendor shenanigans in that space, and set the bug report to "holy shit, someday." A rough version that works with one exact schema and hopelessly avoids being just right for my needs might ship, or might not.

9) I redeploy my perfectly functional reverse proxy solution which has supported LDAP since the mid 90s and wire it up to Google OAuth for bonus points (getting rid of passwords for all corporate systems overnight! Neat!) while half the world pointlessly fights for every infrastructure service that exists to basically link in an operating system's worth of encryption and authentication support just to be a document store or search server.

Given the choice I would very much rather secure my network or use well-established software to secure an infrastructure service. Asking every database vendor in existence to reimplement this stuff is a bad idea. People who blindly advocate for this sort of work, then paper over it with "you can't trust the network" without really supporting that statement, just generate busy work for companies that write infrastructure services. If you can't trust your network, what business do you have operating a production service that maintains user data? Do you really think having ElasticSearch do its own HTTP basic is more secure than any other solution? They at least had the JVM/netty/whatever to fall back on, where a lot of these infrastructure services have had to write their own authentication.

There is a middle ground here and a lot of advocacy, both on HN and elsewhere, that misses the forest for the trees. Of course, none of this applies to MongoDB, because they were like sure, the world needs another bespoke binary protocol. You absolutely should be keeping your data on a secured network, though, and opaque strings of characters for system A to log in to system B might seem like defense in depth, but they end up in your source code, another system, or the working set of your executing process, and they are routinely captured by active adversaries. So.

Having a mode where an infrastructure service assumes a connection is legitimate and just services the client is important. Some of us have a little more confidence in our security strategy than others and feel that we know what we are doing. Wiring that mode up to a 0.0.0.0 bind, by default, is the bug.

Oh yeah, almost forgot:

10) All that custom authentication in AwesomeDB that you had an intern write becomes a CVE factory and starts reflecting on the security of the product. Womp womp.

Re:The MongoDB hack and the importance of secure defaults by bogomipz on Wednesday January 11, 2017 @03:44PM (#13377339)
>"Why would I want it to reimplement HTTP authentication when I can place it behind a reverse proxy that's already integrated with my company's AAA and has been doing nothing but HTTP for oh, three decades or so?"

Because getting RBAC right for individual indexes in Elasticsearch is not necessarily trivial. Example, I have multiple groups and users. And lets say I want to give some users access to these indexes but not these other ones and this group can access these indexes read-only and this group can add or delete but not access the admin endpoints etc. Just "putting it behind your company's proxy" doesn't work out of the box. And integrating this on Elasticsearch client Nodes - nodes where node.data is set to false and node.master is set to false, would have been very logical.

Also not every company has AAA with full LDAP integration, i.e any early stage start up that consists of a small handful of people wearing many hats because some of which are not their area of expertise. Lots of these types of companies are also using Elasticsearch for full text indexing.

Re:The MongoDB hack and the importance of secure defaults by jsmthrowaway on Wednesday January 11, 2017 @03:51PM (#13377380)
There's a difference between username/password gatekeeping security of an infrastructure service, which my post was quite clearly discussing, and fine-grained RBAC in the data plane. One is itself data within the database, while the other is gatekeeping to the database; they have vastly different impetuses, design constraints, and security strategy.

Conflating the two is wrong and, yes, many services themselves conflate the two which reduces the flexibility of both. Why not let my system do the AA and tell the backend what user it is so that RBAC can be implemented? I haven't used Shield but I'm guessing this is difficult to separate; in a number of other systems it is.

The key to your office is not nearly the same as the key to each drawer of your filing cabinet. Each can be shared independently and serve different purposes. You might decide to never use your office key, for example, because of the armed linebacker in your lobby. In my experience, most of the effort to make an infrastructure service speak authentication is intended for gatekeeping and RBAC comes later. ElasticSearch obviously went all the way with it. This whole conversation about infrastructure authorization tends to make people forget what the actual threat vectors are, which is really the subtext of my thesis here.

Every company has at least a subset of AAA, and hand waving it away as "eh, early startup stuff" is also dangerous. Putting stuff behind Google SSO is nice for startups these days and, boom, AA-sorta-A.

Re:The MongoDB hack and the importance of secure defaults by dd-pwc on Wednesday January 11, 2017 @09:24PM (#13379366)
This is a most excellent summary of how the technologies-de-jour seep their way into an organization!

Out of interest how did you handle the Google OAuth integration? Some kind of JWT module for httpd/nginx that validates the token, and acts on the subject?

Re:The MongoDB hack and the importance of secure defaults by jsmthrowaway on Thursday January 12, 2017 @12:19AM (#13379986)
Exactly that, yes. It's not the software I was talking about in my essay, but I've used Openresty to do the JWT lifting in about 100 lines of lovely, readable Lua. Made a nice page with a "Sign on with Google" button from their docs, served it statically from nginx, and had it mostly working in a day. I wouldn't write it again, though; I wasn't confident in its complete security owing to there being far more clever people in the world than me, and I'd do that specific task differently this time around.

Openresty/nginx is like an operations Leatherman. Very handy.

Re:The MongoDB hack and the importance of secure defaults by vacri on Wednesday January 11, 2017 @03:58PM (#13377430)
It's an entirely fair comparison. Just because they're hiding a feature from you to make you cough up money doesn't mean that a newbie won't be burned in exactly the same way.
Re:The MongoDB hack and the importance of secure defaults by aioprisan on Wednesday January 11, 2017 @01:31PM (#13376219)
You can set up the latest MySQL with a blank root password and open to the world as well. The lack of good security options is a 1.x-ism, now there are plenty of security mechanisms now https://docs.mongodb.com/v3.2/administration/security-checkl...
Re:The MongoDB hack and the importance of secure defaults by morgo on Wednesday January 11, 2017 @02:36PM (#13376794)
It is much harder to do this with MySQL.

The default is now a randomly generated password. You have to overwrite it with --initialize-insecure if you want to setup with a blank password.

Re:The MongoDB hack and the importance of secure defaults by aioprisan on Wednesday January 11, 2017 @04:32PM (#13377666)
I don't buy that. Just did an apt-get install mysql-server and it let me install with a blank password (Ubuntu 16.04 MySQL Server 5.7)
Re:The MongoDB hack and the importance of secure defaults by morgo on Wednesday January 11, 2017 @04:58PM (#13377872)
It is most likely appearing to work without a password because it is using socket authentication (vs tcp). See: http://mysqlserverteam.com/secure-by-default-in-mysql-5-7/

If you want to double check, try 'mysql --protocol=tcp'.

Re:The MongoDB hack and the importance of secure defaults by Sanddancer on Wednesday January 11, 2017 @07:07PM (#13378703)
That's ubuntu screwing things up, not mysql. When you run the init manually -- mysqld --initialize -- it does require a password.
Re:The MongoDB hack and the importance of secure defaults by aioprisan on Wednesday January 11, 2017 @11:15PM (#13379784)
Since we're just talking about defaults, you'd get an equally unsecured MySQL install on the latest and most popular AWS AMI today, as you would with old MongoDB installs.
Re:The MongoDB hack and the importance of secure defaults by cpuguy83 on Wednesday January 11, 2017 @12:07PM (#13375445)
Most likely this configuration is due to the traditional mongo use-case, which is to have data replicated between many nodes. This requires each participating node to be able to communicate with every other node.
Re:The MongoDB hack and the importance of secure defaults by edgan on Wednesday January 11, 2017 @05:54PM (#13378226)
Elasticsearch is still this way, and actually tries to make you pay for Shield, their way of securing it.