moby/api/client/swarm
Aaron Lehmann a00d12a8dd Generate a swarm joining secret if none is specified
The current behavior of `docker swarm init` is to set up a swarm that
has no secret for joining, and does not require manual acceptance for
workers. Since workers may sometimes receive sensitive data such as pull
credentials, it makes sense to harden the defaults.

This change makes `docker swarm init` generate a random secret if none
is provided, and print it to the terminal. This secret will be needed to
join workers or managers to the swarm. In addition to improving access
control to the cluster, this setup removes an avenue for
denial-of-service attacks, since the secret is necessary to even create
an entry in the node list.

`docker swarm init --secret ""` will set up a swarm without a secret,
matching the old behavior. `docker swarm update --secret ""` removes the
automatically generated secret after `docker swarm init`.

Closes #23785

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 7342e42fce)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:27 -07:00
..
cmd.go Add experimental docker stack commands 2016-06-14 14:56:35 -04:00
init.go Generate a swarm joining secret if none is specified 2016-07-08 15:33:27 -07:00
inspect.go Add Swarm management CLI commands 2016-06-13 22:17:15 -07:00
join.go Use flag constants for swarm flag. 2016-06-30 16:47:39 -07:00
leave.go Use flag constants for swarm flag. 2016-06-30 16:47:39 -07:00
opts.go Generate a swarm joining secret if none is specified 2016-07-08 15:33:27 -07:00
opts_test.go Unify swarm init and update options 2016-06-30 16:47:44 -07:00
secret.go Generate a swarm joining secret if none is specified 2016-07-08 15:33:27 -07:00
update.go fix stdout and stderr in api client 2016-07-08 15:32:14 -07:00