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

Allow kube:admin to be scoped #21712

Merged
merged 2 commits into from
Jan 2, 2019

Conversation

enj
Copy link
Contributor

@enj enj commented Jan 2, 2019

Move bootstrap user data to BootstrapUserData struct

This change moves the bootstrap OAuth user behind an interface to
isolate the logic. The data needed to validate flows for this user
are now stored in a BootstrapUserData struct to make it easier to
extend the associated flows.

Signed-off-by: Monis Khan [email protected]


Allow kube:admin to be scoped

When I originally wrote the authenticator for the bootstrap user, I
was thinking of a user that could always perform any action, similar
to an x509 cert based user. However, unlike a cert based user, the
bootstrap user can go through OAuth flows, meaning that untrusted
clients can get scoped tokens for it. We need those tokens to not
be all powerful, otherwise we break the safety guarantees of those
flows.

This change removes the use of the system:masters group and instead
uses the system:cluster-admins group. The former does not honor
scopes or any other deny authorizer due to how it is wired. The
latter is authorized via RBAC and thus interacts correctly with deny
authorizers.

This change also passes the token scopes via the standard extra
field scopes.authorization.openshift.io (this was originally omitted
due to my incorrect thought process around the bootstrap user).

Signed-off-by: Monis Khan [email protected]


xrefs:
#18922
#18966
#21530
kubernetes/kubernetes#70670
kubernetes/kubernetes#70671

@openshift/sig-auth
/assign @mrogers950

enj added 2 commits December 31, 2018 10:29
This change moves the bootstrap OAuth user behind an interface to
isolate the logic.  The data needed to validate flows for this user
are now stored in a BootstrapUserData struct to make it easier to
extend the associated flows.

Signed-off-by: Monis Khan <[email protected]>
When I originally wrote the authenticator for the bootstrap user, I
was thinking of a user that could always perform any action, similar
to an x509 cert based user.  However, unlike a cert based user, the
bootstrap user can go through OAuth flows, meaning that untrusted
clients can get scoped tokens for it.  We need those tokens to not
be all powerful, otherwise we break the safety guarantees of those
flows.

This change removes the use of the system:masters group and instead
uses the system:cluster-admins group.  The former does not honor
scopes or any other deny authorizer due to how it is wired.  The
latter is authorized via RBAC and thus interacts correctly with deny
authorizers.

This change also passes the token scopes via the standard extra
field scopes.authorization.openshift.io (this was originally omitted
due to my incorrect thought process around the bootstrap user).

Signed-off-by: Monis Khan <[email protected]>
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 2, 2019
@stlaz
Copy link
Contributor

stlaz commented Jan 2, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 2, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enj, stlaz

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

@enj
Copy link
Contributor Author

enj commented Jan 2, 2019

/refresh

@enj
Copy link
Contributor Author

enj commented Jan 2, 2019

/test e2e-gcp-serial

@enj
Copy link
Contributor Author

enj commented Jan 2, 2019

/test e2e-aws-builds
/test e2e-aws-image-registry

@enj
Copy link
Contributor Author

enj commented Jan 2, 2019

/skip

@enj
Copy link
Contributor Author

enj commented Jan 2, 2019

/refresh

@openshift-merge-robot openshift-merge-robot merged commit 2b12c78 into openshift:master Jan 2, 2019
@openshift-ci-robot
Copy link

@enj: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws-builds ef6d52f link /test e2e-aws-builds

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants