Live data from Hacker News

A Docker footgun led to a vandal deleting NewsBlur's MongoDB database (2021)

blog.newsblur.com

21–30 of 117 posts

Re: A Docker footgun led to a vandal deleting NewsBlur's MongoDB database (2021)

#21

Using "ufw" on a production server is an anti-pattern, in my opinion. You should use something like ferm instead.

ferm is absolutely fantastic, but in my experience, it doesn't always cope well with some more obscure iptables features; I've inherited a couple systems where retrofitting ferm was not possible, because it literally barfed when parsing the legacy ruleset. If you can use it, you should use it though.

Also, I do need to play with nftables.

Re: A Docker footgun led to a vandal deleting NewsBlur's MongoDB database (2021)

#22
Great writeup! Writeups like these help everyone learn from each other's mistakes.

> We had been relying on the firewall to provide protection against threats, but when the firewall silently failed, we were left exposed.

> a change needs to be made as to which database users have permission to drop the database

I think these two definitely highlight the importance of the always using the "layered onion" model of security.

The combination of a firewall, a password, and a nuanced permissions model would have been sufficient to mitigate the attack, even if one or both of the others failed simultaneously.

Re: A Docker footgun led to a vandal deleting NewsBlur's MongoDB database (2021)

#23
I am not able to follow the reasoning of this part of the write-up:

The most important bit of information the above chart shows us is what a full database transfer looks like in terms of bandwidth. From 6p to 9:30p, the amount of data was the expected amount from a working primary server with multiple secondaries syncing to it. At 3a, you’ll see an enormous amount of data transfered.

This tells us that the hacker was an automated digital vandal rather than a concerted hacking attempt. And if we were to pay the ransom, it wouldn’t do anything because the vandals don’t have the data and have nothing to release.

Re: A Docker footgun led to a vandal deleting NewsBlur's MongoDB database (2021)

#24

Great writeup! Writeups like these help everyone learn from each other's mistakes. > We had been relying on the firewall to provide protection against threats, but when the firewall silently failed, we were left exposed. > a change needs to be made as to which database users have permission to drop the database I think these two definitely highlight the importance of the always using the "layered onion" model of secu…

And, also, develop an understanding of what the software you chose to run is doing.

Re: A Docker footgun led to a vandal deleting NewsBlur's MongoDB database (2021)

#25
post #5

Lol, that’s the same footgun I discovered myself when was checking open ports. Who that wise guy in Docket team who decided to pass default firewall rules and open containers ports to public?

> Who that wise guy in Docket team who decided to pass default firewall rules and open containers ports to public?

This is pure ignorance and slandering the Docker team for it seems weird.

Re: A Docker footgun led to a vandal deleting NewsBlur's MongoDB database (2021)

#26

Kinda weird to blame Docker. This is pure user error.

Yes it's user error, but it's also a nasty trap for users who are not careful. And it hurts the most, where people are most likely to make the mistake (developers need to publish ports to access local containers on their development machines, but must take care not to do so when deploying to production).

Re: A Docker footgun led to a vandal deleting NewsBlur's MongoDB database (2021)

#27

You should consider yourself lucky that you didn't lose your users data. My 2c: - NEVER expose a database to the public. Use at least a micro-service BFEs that do exactly what the app needs and nothing more. - Use a load balancer/gateway between your servers and the outside world (only port 80 and 443 should be open, 80 should redirect to 443). - Use Docker-(Compose) as runtime/orchestrator only for development. For…

I think even "better best practices" should be something like this:

Even in case we accidently violate some security rules (like open ports,...) the application is still safe ?

Re: A Docker footgun led to a vandal deleting NewsBlur's MongoDB database (2021)

#28
post #9

It's a pity that the chances of nailing the perps is so low. Obviously docker and the person that put this together share some of the blame but: the original internet would have never gotten off the ground if it wasn't for people cooperating with each other rather than to try to tear things down all the time. And with the chances of your average script kiddie/hacker/idiot getting caught being lower than a typical bik…

If we accept that this is the default state of the Internet (insecure) then I think it is a correct assumption and forces everyone to think twice before exposing anything to the Internet by default. Here the default Docker behaviour was very much at fault but also the assumption that a Linux level firewall is good for Docker. We have docker deployments that are completely hidden behind NAT in AWS and such things are a non issue.

Re: A Docker footgun led to a vandal deleting NewsBlur's MongoDB database (2021)

#29
post #26

Kinda weird to blame Docker. This is pure user error.

Yes it's user error, but it's also a nasty trap for users who are not careful. And it hurts the most, where people are most likely to make the mistake (developers need to publish ports to access local containers on their development machines, but must take care not to do so when deploying to production).

Use `docker network` or the equivalent in the docker-compose file. Not taking time to think about how the software works is not the fault of the software.
Post reply on HN