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

[feature] CA Root rotation #1990

Closed
10 tasks done
cyli opened this issue Feb 28, 2017 · 1 comment
Closed
10 tasks done

[feature] CA Root rotation #1990

cyli opened this issue Feb 28, 2017 · 1 comment

Comments

@cyli
Copy link
Contributor

cyli commented Feb 28, 2017

The more detailed design document is here: https://docs.google.com/document/d/1ccKB78d0vZbRnN6odZs_VocSDZQtOcU9JmJUzCV1f1I/ was

Background

Currently, the swarm root CA certificate can never be changed. This may cause issues in the following cases:

  • A manager is compromised - managers have access to all the data in the cluster. While the secret data in that cluster should be rotated, it’d be helpful to maintain existing data such as service specs, networks, etc. after auditing, without having to replicate all that work. The root CA key material is the last piece of secure information that cannot be rotated.
  • Related to a manager getting compromised - if the raft logs and/or snapshots which contain the root key material is ever leaked.
  • Getting the root CA cert into the swarm cluster to use with an external CA requires that the CA cert be put in the correct directory before docker swarm init is run. Not being able to change the root CA means that one can never convert from an internal CA to an external CA or back.

Providing a way to rotate the root CA material would allow users to mitigate a manager or raft data compromise, and would allow users to be able to switch over to an external CA or back from an external CA.

Root rotation should not be a common occurrence.

Basic design

A common way to introduce a new root of trust is to use cross-signed certs (for example, https://letsencrypt.org/certificates/), whereby you have two certificates, each signed by a different entity, and each having the same public key and subject.

If we provide a cross-signed intermediate as part of our root rotation process, then we can distribute the new root bundle and renew the TLS certificates at the same time, so there are only 2 phases of root rotation:

  • All nodes get new TLS certificates signed with the new root and also including the cross-signed root with the TLS certificates. We may also distribute root bundles containing both the old and new root cert.
  • Once ALL the nodes have TLS certificates signed by the new root key, we can finish the rotation and trust only the new root cert on all nodes.

Logic

  1. User updates the Root CA material, providing a new public certificate, a new private key or external CA, or both of those.
  2. Swarm generates a cross-signed root that has the same public key and subject as the new root certificate, and will provide this as an intermediate certificate when generating new TLS certificates until the root rotation is complete.
  3. Swarm starts propagating the old+new root CA as trusted roots, and all the nodes get new TLS certificates
  4. User (or swarm) notices that all nodes have new TLS certificates, and tells all nodes to stop trusting the old certificate.

TODO items:

Other bugfixes: (#2134) (#2163)(#2210) (#2212) (#2218).

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

No branches or pull requests

1 participant