Description
Like tens of thousands of other MongoDB users, we were ransomed. This is embarrassing, especially for me who had told my developers that it's extremely unlikely that a widely used piece of database software distributed in 2023 would have insecure defaults. Yet it happened.
To recap:
- MongoDB by default binds to a local port
- When run inside the container, however, it must bind to an interface that can be exposed to outside the container
- When a user uses Docker's
-p
flag in its default incantation, the port is publicly exposed - Because docker writes straight to iptables, this happens even if a firewall is set up
- This container ships in a configuration where authentication is disabled
This issue appears to be well known to the developers, but so far there is no mentioning of this glaring problem on the Dockerhub page of this container.
This behavior breaks expectations, and although not all blame lies with MongoDB's lack of a password in the default configuration - Docker's default behavior to assume -p 0.0.0.0:host:container
is to blame as well - it seems to me that an "official" image should warn about this trap which is easy to fall into.
Please consider updating your documentation. The current idea - which to me appears to just not mention the behavior that occurs on -p
- and to bury the fact that authentication is disabled by default in the fine print is, in my view, suboptimal, to put it mildly.