Skip to content

Switch RBAC escalation check to use active authorizer#56358

Merged
k8s-github-robot merged 1 commit intokubernetes:masterfrom
liggitt:rbac-alternate-authorizer
Jun 20, 2018
Merged

Switch RBAC escalation check to use active authorizer#56358
k8s-github-robot merged 1 commit intokubernetes:masterfrom
liggitt:rbac-alternate-authorizer

Conversation

@liggitt
Copy link
Copy Markdown
Member

@liggitt liggitt commented Nov 24, 2017

Closes #43409

RBAC: all configured authorizers are now checked to determine if an RBAC role or clusterrole escalation (setting permissions the user does not currently have via RBAC) is allowed. This is done by checking if the user is authorized to perform the "escalate" verb on the "roles" or "clusterroles" resource.

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 24, 2017
@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 24, 2017
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 24, 2017
@liggitt liggitt added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 24, 2017
@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Nov 24, 2017

cc @kubernetes/sig-auth-pr-reviews

@k8s-ci-robot k8s-ci-robot added the sig/auth Categorizes an issue or PR as relevant to SIG Auth. label Nov 24, 2017
@liggitt liggitt assigned ericchiang and unassigned enj Nov 24, 2017
@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Nov 24, 2017

cc @cjcullen

@liggitt liggitt force-pushed the rbac-alternate-authorizer branch 2 times, most recently from f961f68 to cab5f75 Compare November 25, 2017 03:04
@k8s-github-robot k8s-github-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 25, 2017
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should these errors be logged?

@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Nov 25, 2017

/retest

1 similar comment
@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Nov 25, 2017

/retest

@deads2k
Copy link
Copy Markdown
Contributor

deads2k commented Nov 27, 2017

/approve

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 27, 2017
@deads2k
Copy link
Copy Markdown
Contributor

deads2k commented Nov 27, 2017

lgtm. I have no preference about logging since its a wholely internal request that attempts a secondary path on errors, but I'll leave it to you.

@enj
Copy link
Copy Markdown
Member

enj commented Nov 27, 2017

LGTM

@enj
Copy link
Copy Markdown
Member

enj commented Nov 27, 2017

A GKE test showing this works would be nice.

@liggitt liggitt force-pushed the rbac-alternate-authorizer branch from cab5f75 to 30728d3 Compare November 27, 2017 15:03
@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Nov 27, 2017

/retest

@liggitt
Copy link
Copy Markdown
Member Author

liggitt commented Nov 27, 2017

A GKE test showing this works would be nice.

@cjcullen thoughts on how to write this? as far as I can tell, the e2e user is given superuser permissions by the cluster setup, and service accounts don't have GKE IAM permissions

@liggitt liggitt added this to the v1.10 milestone Nov 28, 2017
@liggitt liggitt force-pushed the rbac-alternate-authorizer branch from e3b4b73 to 2719b6a Compare May 2, 2018 20:40
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do these return false lines merit a log (at least an Info.V4)? If we can't pull a user/requestInfo off the context in this call, something is broken, right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we care about the reason?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might help the upkeep of these tests to add a little meat to the comments (like if we decide to switch the order of the escalation checks or something).

// Superuser: Can create/update role w/o escalation, so authorizer is not called, and create/update call should succeed.

// Unauthorized: Bob must escalate to create/update the role. When he doesn't have "escalate" permission, the calls should fail.

// Authorized: Bob must escalate to create/update the role. When he does have "escalate permission, the calls should succeed.

// Implicitly authorized: Alice ...

Actually, I wasn't sure why the Alice thing worked the way it did. I'll take another look in a little bit.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

made it a table test, added more descriptions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome. That's even better.

@liggitt liggitt force-pushed the rbac-alternate-authorizer branch from 2719b6a to 1790611 Compare May 3, 2018 03:14
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 3, 2018
@cjcullen
Copy link
Copy Markdown
Member

cjcullen commented May 5, 2018

Pretty much LGTM. I still want to bikeshed on where the verb should live (and if "escalate" is the right name). I think we should bring it up at the next sig-auth.

@cjcullen
Copy link
Copy Markdown
Member

cjcullen commented Jun 5, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 5, 2018
@fejta-bot
Copy link
Copy Markdown

/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 comment for consistent failures.

7 similar comments
@fejta-bot
Copy link
Copy Markdown

/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 comment for consistent failures.

@fejta-bot
Copy link
Copy Markdown

/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 comment for consistent failures.

@fejta-bot
Copy link
Copy Markdown

/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 comment for consistent failures.

@fejta-bot
Copy link
Copy Markdown

/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 comment for consistent failures.

@fejta-bot
Copy link
Copy Markdown

/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 comment for consistent failures.

@fejta-bot
Copy link
Copy Markdown

/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 comment for consistent failures.

@fejta-bot
Copy link
Copy Markdown

/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 comment for consistent failures.

@liggitt liggitt force-pushed the rbac-alternate-authorizer branch from 1790611 to 1034efd Compare June 6, 2018 19:31
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 6, 2018
@cjcullen
Copy link
Copy Markdown
Member

cjcullen commented Jun 8, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 8, 2018
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cjcullen, deads2k, liggitt

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

The pull request process is described here

Details 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

@fejta-bot
Copy link
Copy Markdown

/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 comment for consistent failures.

@k8s-github-robot
Copy link
Copy Markdown

[MILESTONENOTIFIER] Milestone Pull Request Labels Incomplete

@cjcullen @deads2k @ericchiang @liggitt

Action required: This pull request requires label changes. If the required changes are not made within 3 days, the pull request will be moved out of the v1.12 milestone.

priority: Must specify exactly one of priority/critical-urgent, priority/important-longterm or priority/important-soon.

Help

@k8s-github-robot
Copy link
Copy Markdown

Automatic merge from submit-queue (batch tested with PRs 64688, 64451, 64504, 64506, 56358). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit d9272f8 into kubernetes:master Jun 20, 2018
@liggitt liggitt deleted the rbac-alternate-authorizer branch June 28, 2018 20:34
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. milestone/incomplete-labels release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/auth Categorizes an issue or PR as relevant to SIG Auth. 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.

9 participants