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

Kubeadm "init" via a Root CA #1631

Closed
moshloop opened this issue Jun 21, 2019 · 4 comments
Closed

Kubeadm "init" via a Root CA #1631

moshloop opened this issue Jun 21, 2019 · 4 comments
Assignees
Labels
area/security kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.

Comments

@moshloop
Copy link

/kind feature request

The new --upload-certs option is great for joining additional control plane nodes, but it doesn't solve the problem of securely distributing certificates for use cases like Cluster API.

I think this could be solved by turning the problem around, and rather than distributing certificates followed a typical CSR model.

  1. CAPI generates a new root CA for a child cluster
  2. SA is created with CertificateSigningRequest rights (perhaps per new node with a very short TTL)
  3. kubeadm --init --token <> --management-api-server <>
  4. kubeadm generates and submits CSR, requesting signing by the child cluster CA
  5. Certificate Approval Controller approves CSR's, creating new intermediate CA's for every controller node.
  6. Kubeadm specifies the child cluster CA instead of its own intermediate CA when configuring the components applicable --cafiles

I think this will also need changes to k/k Certificate Controller to support more than 1 root CA, or an out of tree controller.

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 21, 2019
@neolit123 neolit123 added area/security priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. labels Jun 21, 2019
@neolit123
Copy link
Member

The new --upload-certs option is great for joining additional control plane nodes, but it doesn't solve the problem of securely distributing certificates for use cases like Cluster API.

the problem needs a better definition. could you provide more detail?

what prevents CAPI to copy the root CA to the primary kubeadm init node, treat it as external CA (kubeadm supports that) and let the other CP nodes to join using --certificate-key?

I think this will also need changes to k/k Certificate Controller to support more than 1 root CA, or an out of tree controller.

this change in the in-tree controller might not make it in, or it might after 1-2 years of discussion.

/assign @detiber @vincepri
cc @fabriziopandini

@moshloop
Copy link
Author

what prevents CAPI to copy the root CA to the primary kubeadm init node

Copying the certificates to the primary nodes is what CAPA/CAPV does currently, however, the method used to get the keys on the host is insecure (user-data) and starts creating other issues around user-data size limitations (kubernetes-sigs/cluster-api-provider-aws#847 (comment))

This doesn't strictly need to be done in kubeadm, it could be implemented in a "wrapper" around kubeadm or via something like SPIRE

this change in the in-tree controller might not make it in, or it might after 1-2 years of discussion.

I agree, the only reason I would even suggest doing it in k/k, is to not add any dependencies for kubeadm - after thinking about it kubeadm could just fallback to using a single root CA (with a warning that cross-talk between clusters will be possible)

@neolit123
Copy link
Member

This doesn't strictly need to be done in kubeadm, it could be implemented in a "wrapper" around kubeadm or via something like SPIRE

it does seem like a problem that can be resolved higher up the stack.

@neolit123
Copy link
Member

closing as something that can be resolved by tools wrapping kubeadm.
on the kubeadm side we might support alternative certificate distribution methods in a "kubeadm operator":
#1698

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Projects
None yet
Development

No branches or pull requests

5 participants