you are viewing a single comment's thread
view the rest of the comments
[–] 8 points 6 days ago (2 children)

How do you expose the ports? With just 3000:3000 or with a defined IP like 127.0.0.1:3000:30000?

Docker does for example also circumvent firewalls like ufw when using the first port mapping and basically mapping the ports to every IP.

  • source
  • hideshow 2 child comments
  • [–] 1 point 6 days ago*

    It doesn't "circumvent firewalls", it's helping you. You're asking it to forward a port from the container's internal interface, through the bridge to the host, and expose it on all interfaces on the host.

    There's a small set of people who apparently like to do that by hand(?) but the vast majority prefer Docker to write and maintain all those rules... especially since it also takes them up and down as needed when the container starts and stops, and also updates them with the correct IPs from its internal networks, which can be allocated semi-randomly.

    (Fair warning, gonna be ranting and shaking my fist for the rest of this comment.)

    I've never understood what the problem is, I mean why ask it to expose on all interfaces and then complain it's actually reachable. And how do these people orchestrate their rules anyway? My bet is they write a manual rule opening port 3000 on one IP then leave it up and forget about it. Meanwhile the port is bleeding into all the host interfaces and ends up being exposed to tunnels and all kinds of things it shouldn't be. But somehow that's more secure?

    As a rule of thumb, people really shouldn't be using network rules unless they're prepared to describe ALL the device's networking in every detail. The rules should always start with DENY across the board and open things up explicitly.

    Calling them "firewall" has done a great deal of damage and encouraged people to think it's somehow secure and ok to have ALLOW on everything then slap DENY on one particular public IP and open some ports on it. If you don't want to expose a service then the first step would be to not run that service, and the second is to only bind it to the interfaces it really needs to be on. Not opening it up to everything then slapping a "firewall" on top.

  • source
  • parent