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: delete bootstrap-kubelet.conf after TLS bootstrap #80676

Merged

Conversation

fabriziopandini
Copy link
Member

@fabriziopandini fabriziopandini commented Jul 27, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
#66482 enabled kubeadm join --discovery-file with a discovery file with embedded credentials. This PR makes sure that kubeadm removes the bootstrap-kubelet.conf after completing the TLS bootstrap process, so copies of the above credentials won't be left around.

Which issue(s) this PR fixes:
Fixes #kubernetes/kubeadm#1689

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

ACTION REQUIRED:
kubeadm now deletes the bootstrap-kubelet.conf file after TLS bootstrap
User relying on bootstrap-kubelet.conf should switch to kubelet.conf that contains node credentials

/sig cluster-lifecycle
/priority important-soon
/assign @timothysc
/assign @neolit123

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 27, 2019
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 27, 2019
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is mostly OK, but i recommend adding a ACTION REQUIRED: prefix to the release note.
the boostrap credential can be bound to existing infrastructures, which was probably not a great idea in the first place, but we should visibly notify about such changes.

/lgtm
/hold
for other reviews.

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jul 28, 2019
@neolit123
Copy link
Member

neolit123 commented Jul 28, 2019

if we really want to be on the safe side there should be a grace period of say 1 release while kubeadm join supports a knob for this that defaults to false.

EDIT and of course another option is not add this change and leave it to user infrastructure to call rm /etc/kubernetes/kubelet-bootstrap.conf.

Copy link
Member

@timothysc timothysc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve
/hold cancel

Given that this is a security hole I'd be ok with a backport of this.
I don't think an action is required on the release note.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 29, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini, timothysc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jul 29, 2019
@fabriziopandini
Copy link
Member Author

/test pull-kubernetes-dependencies

@neolit123
Copy link
Member

neolit123 commented Jul 30, 2019

Given that this is a security hole I'd be ok with a backport of this.

i'm -1 given the workaround is very simple:
kubeadm join .... && sudo rm /etc/kubernetes/kubelet-bootstrap.conf

I don't think an action is required on the release note.

i worry about somebody is copying or doing something with the bootstrap credentials.
with kubeadm being GA we should avoid such changes without notification.

@fabriziopandini
Copy link
Member Author

AFAIK there is no risk in backporting this fix

  • if users are using token discovery, then bootstrap-kubelet can’t be used because it expires
  • if users are using file discovery, there is no way to get other credentials in until Fix kubeadm file discovery #80675 merge

But I leave the final call on this on @timothysc / @neolit123

@neolit123
Copy link
Member

/retest

1 similar comment
@neolit123
Copy link
Member

/retest

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

Copy link
Member

@yagonobre yagonobre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 82a252a into kubernetes:master Jul 31, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.16 milestone Jul 31, 2019
@stealthybox
Copy link
Member

the delete should be moved to defer here:
https://github.com/kubernetes/kubernetes/pull/80676/files#diff-3c566a0c1e3b213a34b39503abf4fc11R104

otherwise it's possible for the token to be left behind when the function errors

@neolit123
Copy link
Member

neolit123 commented Jul 31, 2019

yep, +1 to use defer.
let me log a ticket.

@fabriziopandini fabriziopandini deleted the delete-bootstrap-kubelet.conf branch August 8, 2019 11:53
chirangaalwis added a commit to chirangaalwis/website that referenced this pull request Oct 19, 2021
Kubeadm deletes the file `/etc/kubernetes/bootstrap-kubelet.conf` as per kubernetes/kubernetes#80676
trierra pushed a commit to trierra/website that referenced this pull request Nov 16, 2021
Kubeadm deletes the file `/etc/kubernetes/bootstrap-kubelet.conf` as per kubernetes/kubernetes#80676
trierra pushed a commit to trierra/website that referenced this pull request Nov 16, 2021
Kubeadm deletes the file `/etc/kubernetes/bootstrap-kubelet.conf` as per kubernetes/kubernetes#80676
trierra pushed a commit to trierra/website that referenced this pull request Nov 16, 2021
Kubeadm deletes the file `/etc/kubernetes/bootstrap-kubelet.conf` as per kubernetes/kubernetes#80676
trierra pushed a commit to trierra/website that referenced this pull request Nov 16, 2021
Kubeadm deletes the file `/etc/kubernetes/bootstrap-kubelet.conf` as per kubernetes/kubernetes#80676
kevindelgado pushed a commit to kevindelgado/kubernetes.github.io that referenced this pull request Nov 17, 2021
Kubeadm deletes the file `/etc/kubernetes/bootstrap-kubelet.conf` as per kubernetes/kubernetes#80676
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants