Live data from Hacker News

I just learned: Docker edits firewall rules for you

geoff.tuxpup.com

111–120 of 126 posts

Re: I just learned: Docker edits firewall rules for you

#111
post #102

Earlier quoted context omitted.

This is exactly right. The alternative is ridiculous. Also, comparing expectations of Docker vs. something like nginx is crazy.

> the alternative is ridiculous. Like what is, having full control over your own system? I don’t think there’s anything wrong with not messing with my firewall and leaving this part to me. > is crazy And this is why, exactly?

You do have full control over your system.

You could choose not to install docker, for once.

Re: I just learned: Docker edits firewall rules for you

#112

Earlier quoted context omitted.

It clearly states “this will publish the mentioned port to the outside world”. How do you expect this to work? Magic?

No, it doesn't. That's not written anywhere on the page. And even if it were, the obvious interpretation of "outside world" would just be that it's available outside the container. And maybe that it's bound to the external network interfaces, but not that it bypasses the firewall.

The documentation clearly states that ports are published. You just didn't follow up on it. Publishing is a docker term different from exposing. There is information on the page about exposing a port without publishing it. Under `long syntax` there is the following information: "published: the publicly exposed port" [0]. How much more clear than "publicly exposed" can you get?

What is a published port? Again, look in the documentation, it's clearly states there [1].

You need to learn to read the documentation of potentially dangerous tools fully. If you don't, you're in for a world of hurt. The outside world is clearly just that.

[0]: https://docs.docker.com/compose/compose-file/compose-file-v3... [1]: https://docs.docker.com/config/containers/container-networki...

Re: I just learned: Docker edits firewall rules for you

#113
post #101

Earlier quoted context omitted.

It clearly states “this will publish the mentioned port to the outside world”. How do you expect this to work? Magic?

Except it is not clear at all and should mention the firewall changes. I expect that publishing means listening on 0.0.0.0, not messing with the firewall.

See my comment above. Firewall changes are clearly mentioned under the section "published ports".

What you expect does not matter. What you're thinking of is exposing. It's even in the word "publish".

The documentation has two sections entirely devoted to the terms. It's in the section "container networking", which is marked as required reading by the docs.

It's not dockers fault that you're copy pasting configuration examples from medium blogs.

[0]: https://docs.docker.com/config/containers/container-networki...

Re: I just learned: Docker edits firewall rules for you

#114
post #51

Earlier quoted context omitted.

No they shouldn't, just how nginx shouldn't manipulate iptables just because you've said it should listen to 443 on "the network". Many times you don't even want docker containers to go "to the network" directly and it shouldn't assume unsecure behaviour by default. Moreover, CRITICALLY, you can't prevent Docker from doing that and you can ONLY secure the machine by adding another rule on top that supresses Dockers r…

You can prevent docker from doing that by editing its config, but you have to read the documentation to know that. As you have to, to actually know what a certain command does, too.

What horror. Now we actually have to read the documentation of potentially dangerous tools instead of guessing or following twitter tutorials.

Re: I just learned: Docker edits firewall rules for you

#115
post #65

Earlier quoted context omitted.

It really is. I am astonished by the simple mindedness of some people in this thread. Half knowledge really is dangerous.

No need to call people simple minded, friend. It completely debases your point to the extent that it makes me question whether you understood their point. Consider the possibility that you simply misunderstood their point.

Expecting a potentially dangerous tool to "just work" when the documentation is several thousands of words long is simple minded, especially when you watched a 10 minute video on it from some random tech blogger.

Re: I just learned: Docker edits firewall rules for you

#116
post #63

Earlier quoted context omitted.

No. This is not the case. There is a different term that does what you mean: "publishing" a port. It's different from the "EXPOSE XYZ" syntax, and is used in the docker cli with the "-p" command.

Maybe a lesson learned from this conversation is that the documentation isn't clear about what's going on and should be updated.

The documentation is incredibly clear about this and does not need to be updated. It's mentioned multiple times. The beginning of the documentation offers information about the difference of publishing and exposing. The docker networking tab explicitly mentions that publishing a port means it's visible to the outside world.

Re: I just learned: Docker edits firewall rules for you

#117

While docker's port exposure should be more explicit, he should also mention that he used docker without reading the parts of the doc he neeeded to, blindly trusting some dangerous half-knowledge from a forum or other persons. If he'd bind the host port to localhost or put caddy in a container in the same vlan, it wouldn't have happened. From the blogpost I'm not even sure if he's aware of the binding option. If you…

Failed to read the entire docs is orthagonal to harmful default behavior. Maybe he also smells bad some days. So what? Docker is still wrong, and further, more wrong than the user.

No. Docker is correct in this case. There is no other way for traffic to get to your container. You must explicitly tell it to amend your firewall rules with the "-p" argument.

Re: I just learned: Docker edits firewall rules for you

#118
This is the kind of case that is a good argument for regulated liability even on open source or gratis software components in the egregrious cases - the actor is a big tech company and clearly exposing users to compromise breakins in a calculated, fully aware way, for ~7 years.

[1] https://github.com/moby/moby/issues/22054

Re: I just learned: Docker edits firewall rules for you

#120
post #101

Earlier quoted context omitted.

Except it is not clear at all and should mention the firewall changes. I expect that publishing means listening on 0.0.0.0, not messing with the firewall.

See my comment above. Firewall changes are clearly mentioned under the section "published ports". What you expect does not matter. What you're thinking of is exposing. It's even in the word "publish". The documentation has two sections entirely devoted to the terms. It's in the section "container networking", which is marked as required reading by the docs. It's not dockers fault that you're copy pasting configuratio…

You know, it would be nice for you to actually read the docs before posting insulting comments.

> This creates a firewall rule in the container

We’re done here.

Post reply on HN