4 ms·
"When I containerized MongoDB, Docker helpfully inserted an allow rule into iptables, opening up MongoDB to the world." Yet another reminder that the most impo
by mannykannot 4y ago
"When I containerized MongoDB, Docker helpfully inserted an allow rule into iptables, opening up MongoDB to the world."
Yet another reminder that the most important ability in systems engineering is good judgement.
- cpuguy83 4y agoTo be clear, Docker inserted an allow rule because the user asked it to. Docker is relatively easy to set up without needing to use port forwarding to allow communication. Docker's networking model is explicitly designed to prevent the scenario in the post. Not to negate the fact that many are surprised by how docker bypasses ufw rules. This is painful and I would love to see a way for people to safely use port forwarding without surprises like this.
- remram 4y agoDocker does not "insert an allow rule", it uses the "nat" table to forward connections to the container, and not the "filter" table where the firewall rules live. So packets never go through those filters. This is not a consequence of Docker's action but a fact of how Linux networking works. Docker could have bigger warnings, or default to only accepting connections from localhost (I think it should), but it could not easily change the way Linux networking works to extend the host's firewall to the containers.
- cpuguy83 4y agoThanks, I was just using the parent's vocabulary to make my point.
- c7DJTLrn 4y agoThe poor judgement here is not using an appliance firewall in addition to a system firewall. Exposing an instance directly to the public Internet is just not a good move.
- ilyt 4y agoAnd not having password. And not even trying to nmap the service after configuration to verify if firewall is doing what is intended.