by yjftsjthsd-h · 3y ago · 0 comments
I mean... if they weren't using docker it would have been fine, but because they used docker it wasn't fine. That reads like docker is the problem. That further layers could have mitigated it doesn't make docker not the problem.
They didn't secure their database with auth/access control and they misconfigured docker.
They have a few things at their disposal:
- Using the docker-user chain to set firewall rules
- Running docker such that the default bind address for the port directive is 127.0.0.1 instead of 0.0.0.0. This puts a safety on the footgun.
- Explicitly setting the bind address of the port directive when bringing up the container.
Docker didn't come along, install itself, and open up the port. The sysadmin did. It's unfortunate they didn't know how it interacted with the firewall or how to properly configure it, but given that, should they really have been rolling it out to production systems?
They tested on prod and learned in trial by fire.
True, although they had reason to believe that that was safe.
> they misconfigured docker.
Ah, no, that's where we disagree. They didn't configure it, docker shipped an insane default that bypasses existing security measures. There is absolutely no reason to expect that running a program in docker magically makes it ignore the system firewall.
By the same token having an unsecured database is a bad default, so we can keep passing the buck around.
That's like the antithesis of layered security. There would be no point in layers if you assume a single layer will protect you.
They shouldn't have needed to, for this.
> But because they didn't and used a software firewall as their only line of defense
Okay? That should have been safe. Like, sure, there are ways to add more layers, but that layer shouldn't have failed them.
> didn't bother with authentication for the DB server, it wasn't fine.
They shouldn't have needed to. Like yes, running a DB without authentication isn't a great idea, but they had good reason to believe that it wouldn't be exposed.
the problem is that it was possible to accidentally expose their credential-less db to the internet _at all_ and that they had no monitoring or tools in place to detect the misconfiguration. that’s a design flaw, and again, not a docker-specific problem.
Docker could not extend the host's firewall to containers without changing how iptables work.
That's exactly what happens. Docker sticking its rules before the normal filters is exactly what I mean when I say it bypasses the firewall rules. Like... you're literally describing the implementation details of what I said it does.
> The host's firewall just doesn't apply to containers and VMs, because they are not listening on a port on the host.
They clearly are? If a docker container was listening but not on a port on the host's internet-facing interface (indirected though it may be), none of this would be a problem. The problem is precisely that if you have a host firewall rule that says "this port is blocked", docker will "helpfully" preempt that and connect that port to a container, which is a massive and unreasonable footgun.
> Docker could not extend the host's firewall to containers without changing how iptables work.
podman seems to manage fine, so I have trouble believing that.