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

Document approaches for infrastructure providers to consider for securing sensitive bootstrap data #1739

Closed
ncdc opened this issue Nov 8, 2019 · 20 comments
Assignees
Labels
kind/documentation Categorizes issue or PR as related to documentation. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@ncdc
Copy link
Contributor

ncdc commented Nov 8, 2019

User Story

As a user/operator, I would like to avoid exposing sensitive data (such as certificate private keys) in hypervisor bootstrap data to minimize attack surfaces.

Detailed Description

CAPI generates sensitive cluster data (such as private keys) for the apiserver, etcd, etc. These are stored as secrets in Kubernetes. The kubeadm bootstrapper copies the contents of the secrets into bootstrap data in the KubeadmConfig resource, which is then copied into the Machine resource. Infrastructure providers such as CAPA and CAPV (and presumably others that use cloud-init style bootstrap data) use this bootstrap data as the user data for the VM/hypervisor. In many/most instances, if a user has read-only access to the VM in the provider's API (such as AWS's ec2:DescribeInstances permission), this likely grants them access to the user data, and therefore access to the sensitive data.

Ideally, the VM itself has permission to read the sensitive data, but a user with cloud provider API access to the VM must not be able to do so.

The method used to secure this sensitive data is likely specific to each infrastructure provider. We should document what types of mechanisms to look for (such as a secure data store) so the developers of an infrastructure provider can implement this functionality.

/kind documentation
/priority important-soon
/milestone v0.3.0

cc @akutz @detiber @randomvariable

@k8s-ci-robot k8s-ci-robot added this to the v0.3.0 milestone Nov 8, 2019
@k8s-ci-robot k8s-ci-robot added kind/documentation Categorizes issue or PR as related to documentation. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Nov 8, 2019
@randomvariable
Copy link
Member

/assign

@detiber
Copy link
Member

detiber commented Nov 8, 2019

@ncdc I would also probably add that beyond just the secrets injected during init, the bootstrap tokens and encryption key (for control plane) that we inject for join also fall under this category as well.

@ncdc
Copy link
Contributor Author

ncdc commented Nov 8, 2019

Right, I meant to mention the bootstrap tokens too. What encryption key are you referring to?

@detiber
Copy link
Member

detiber commented Nov 8, 2019

Ah, I didn't realize we were still injecting the CA and service account keypairs instead of leveraging the ability to transfer the secrets using kubeadm.

@randomvariable
Copy link
Member

We need to do the injection in any case for the initial control plane node.

@ncdc ncdc added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Jan 22, 2020
@vincepri
Copy link
Member

/milestone Next

@k8s-ci-robot k8s-ci-robot modified the milestones: v0.3.0, Next Feb 12, 2020
@vincepri
Copy link
Member

/help

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Mar 11, 2020
@alexeldeib
Copy link
Contributor

this and #1846 are very similar/dupes

@alexeldeib
Copy link
Contributor

@vincepri @fabriziopandini Started a doc and expanded on the existing PR. The doc is fairly short right now, I mostly wanted to highlight the API types and how the implementation would change from #1860

#3038

https://docs.google.com/document/d/1R_E3uu8Uvfe4pOcTrfQYUolJCK8mUS58Kq4A8zmqTr8/edit?usp=sharing

@alexeldeib
Copy link
Contributor

/assign

@alexeldeib
Copy link
Contributor

/remove help

@alexeldeib
Copy link
Contributor

/remove-help

@k8s-ci-robot k8s-ci-robot removed the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label May 10, 2020
@randomvariable
Copy link
Member

randomvariable commented May 12, 2020

Important to note that the history of this also included advising implementers to use provider specific features where necessary, for example kubernetes-sigs/cluster-api-provider-aws#1490 and kubernetes-sigs/cluster-api-provider-vsphere#582

@alexeldeib
Copy link
Contributor

Ah, I see there are two side to this issue:

  • Bootstrap provider needs secure sources for data (what i'm tackling)
  • Infrastructure providers may need a secure place to put that data (the issues you linked)

Perhaps i'll reopen one of the other issues I closed as dupes to reflect the work more accurately, as those are better aligned to the task. But i'm also about to open a PR to fix it, so maybe not a huge deal to disambiguate shrugs

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 19, 2020
@fabriziopandini
Copy link
Member

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 20, 2020
@vincepri
Copy link
Member

/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Aug 20, 2020
@randomvariable
Copy link
Member

related to kubernetes-sigs/cluster-api-provider-aws#1875

@vincepri
Copy link
Member

/close

Closing in favor of #3762

@k8s-ci-robot
Copy link
Contributor

@vincepri: Closing this issue.

In response to this:

/close

Closing in favor of #3762

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

8 participants