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

Make it possible to authenticate a Bootstrap Token in different groups #49306

Closed
luxas opened this issue Jul 20, 2017 · 3 comments · Fixed by #50933
Closed

Make it possible to authenticate a Bootstrap Token in different groups #49306

luxas opened this issue Jul 20, 2017 · 3 comments · Fixed by #50933
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle.
Milestone

Comments

@luxas
Copy link
Member

luxas commented Jul 20, 2017

Is this a BUG REPORT or FEATURE REQUEST?:

/kind feature

It should be possible to set auth-groups or a similar key on a Bootstrap Token Secret to get the BootstrapTokenAuthenticator add those group(s) when authenticating.
This has many benefits, but primarily that it's possible to give different Bootstrap Tokens different identities.

For example, you may want to have one Bootstrap Token only for adding normal nodes to the cluster, but have some Bootstrap Tokens to be able to add masters to the cluster, etc.

This mechanism will also imply that the "default" BT (where auth-groups isn't set) has no specific privileges in the cluster. The sysadmin must explicitely assign the BT some groups in order give it privileges.

auth-groups takes a comma-separated list of groups to use for authentication. The group must have the system:bootstrappers: prefix so that it is easily distinguishable from other groups. (And to avoid having someone assigning its bootstrap token system:masters for instance)

This is part of getting Bootstrap Tokens to beta in v1.8

@kubernetes/sig-auth-feature-requests @kubernetes/sig-cluster-lifecycle-feature-requests

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. labels Jul 20, 2017
@luxas luxas added this to the v1.8 milestone Jul 20, 2017
@luxas
Copy link
Member Author

luxas commented Jul 20, 2017

@mattmoyer will take ownership over implementing this 🎉

@ericchiang
Copy link
Contributor

/assign @mattmoyer

@mattmoyer
Copy link
Contributor

cc @mikedanese I think the spirit of this feature overlaps a bit with the improvements to the CSR verification improvements you mentioned today.

k8s-github-robot pushed a commit that referenced this issue Aug 28, 2017
Automatic merge from submit-queue (batch tested with PRs 49861, 50933, 51380, 50688, 51305)

Add configurable groups to bootstrap tokens.

**What this PR does / why we need it**:
This change adds support for authenticating bootstrap tokens into a configurable set of extra groups in addition to `system:bootstrappers`. Previously, bootstrap tokens could only ever authenticate to the `system:bootstrappers` group.

Groups are specified as a comma-separated list in the `auth-extra-groups` key of the `bootstrap.kubernetes.io/token` Secret, and must begin with the prefix `system:bootstrapper:` (and match a validation regex that checks against our normal convention). Whether or not any extra groups are configured, `system:bootstrappers` will still be added.

This also adds a `--groups` flag for `kubeadm token create`, which sets the `auth-extra-groups` key on the resulting Secret. The default is to not set the key.

`kubeadm token list` is also updated to include a `EXTRA GROUPS` output column.

**Which issue this PR fixes**: fixes #49306

**Special notes for your reviewer**: 
The use case for this is in #49306. Comments on the feature itself are probably better over there. It will be part of how HA/self-hosting kubeadm bootstraps new master nodes (post 1.8).

**Release note**:
```release-note
Add support for configurable groups for bootstrap token authentication.
```

cc @luxas @kubernetes/sig-cluster-lifecycle-api-reviews @kubernetes/sig-auth-api-reviews 

/kind feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants