Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate Docker API over TCP without TLS #36357

Open
justincormack opened this issue Feb 20, 2018 · 13 comments
Open

Deprecate Docker API over TCP without TLS #36357

justincormack opened this issue Feb 20, 2018 · 13 comments
Milestone

Comments

@justincormack
Copy link
Contributor

Running the Docker socket over TCP without any authentication, even on localhost (yes, JavaScript can connect to localhost from your browser) is very dangerous, even in non production environments. Since we have had named pipe support for Windows for some years now, and always have had unix socket support, there is no reason for this to be supported out of the box, and we should remove it. Obviously we will continue to support tcp with TLS.

If users really want to do this, they can make a proxy from tcp to the socket, which is pretty trivial, but then it is clearly their responsibility.

We could potentially have quite a long deprecation period, and should have warnings on the client and server.

@AkihiroSuda
Copy link
Member

SGTM but maybe except DIND?

@justincormack
Copy link
Contributor Author

@AkihiroSuda why do you need it in dind?

@AkihiroSuda
Copy link
Member

a nondind container may want to connect to a dind container.
I think non-tls is allowed when separate nw is created.

@justincormack
Copy link
Contributor Author

The problem is that Docker cannot know if there is a separate network. We could have a flag to allow the current behaviour still, but I would still rather you had to run a proxy. The dind container could include a suitable proxy option I guess.

@justincormack
Copy link
Contributor Author

We could add a feature to generate a TLS keypair for simple local use cases.

@AkihiroSuda
Copy link
Member

Yes, I think just including socat is fine (after some deprecation period of the current behaviour)

@AkihiroSuda
Copy link
Member

Still SGTM

@cyli
Copy link
Contributor

cyli commented Jun 21, 2018

It sounds like from the description the comments in from the comments from #37299, this feature for deprecating support for tcp without mutual TLS, as opposed to unauthenticated one-way TLS. If that's the case, would it make sense to clarify on the issue title?

@thaJeztah thaJeztah changed the title Deprecate Docker socket over TCP without TLS Deprecate Docker API over TCP without TLS Jul 20, 2023
@corhere
Copy link
Contributor

corhere commented Jul 20, 2023

#41285 (comment)

  • future release; enable both --tls and --tlsverify by default: if a user didn't specify options, the daemon will fail to start as no certs are provided
  • add options to explicitly disable tls / tlfverify: --disable-tls, --disable-tls-verify (name can be discussed)

@corhere corhere added this to the v-future milestone Jul 20, 2023
@corhere
Copy link
Contributor

corhere commented Jul 20, 2023

An entry needs to be added to the deprecation log before we can enable --tlsverify by default.

@neersighted neersighted modified the milestones: v-future, 27.0.0 Mar 20, 2024
@neersighted
Copy link
Member

neersighted commented Mar 20, 2024

Now that we're getting serious about doing this (refer to #47556), paging @tianon for thoughts on what to do for docker:dind. Whatever we do there, we'll probably want to replicate for our dev container (I make use of the TCP API a fair bit for testing, at least).

@vvoland vvoland modified the milestones: 26.1.0, 27.0.0 Apr 10, 2024
@tianon
Copy link
Member

tianon commented Apr 10, 2024

We've had the docker:dind image doing automatic generation of all the necessary self-signed certificates for a while now, with honestly pretty limited success.

(For details, see the insanely hairy mess that is https://github.com/docker-library/docker/blob/1b4d76a2e8049074e723b5b8ecec417b1450a065/dockerd-entrypoint.sh -- generating the certs correctly/acceptably/securely in the first place is way harder than it ought to be IMO, but we also have to be careful not to clobber certificates a user might provide)

One of the biggest sets of users that complains any time anything breaks in that image is GitLab, and last I knew it was kind of complicated for them to set up certificates correctly for this to work for their pipelines. I don't know whether that's changed, but I suspect it's still complicated because they (GitLab) don't directly control how users include this in their YAML, and many of their users have copy-pasted some boilerplate, and that's the main source of the consternation any time anything changes (like the recent xtables vs nftables snafu).

See docker-library/docker#430 for a currently-active example of a contributor/user who is pretty frustrated about this.

IMO, turning the current delay into an error is OK if we have an escape hatch for users to say "yes, I accept the risk, please be really insecure", but I don't personally think --tls=false --tlsverify=false really conveys the severity of how insecure this configuration is appropriately. 😞

@PeterFeicht
Copy link

I just came across the deprecation warning and I'm not entirely sure if there will or will not be a way to override this. Can someone clarify that please?

I'm using Docker on Windows by running the Docker daemon in a WSL 2 instance and connecting to it with the docker executable running in Windows. (To clarify, I'm talking about Linux containers running in a Linux VM, not Windows containers.) Because there is no remote access to the Windows machine, the daemon is not exposed at all in that setup.

I would very much appreciate not having to mess around with encryption for such a use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants