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

VW: Fix permission checking in root #1686

Merged
merged 3 commits into from
Aug 5, 2022

Conversation

davidfestal
Copy link
Member

Summary

We should only skip permission checking in the root workspace for the list verb, so that any user can always list the workspaces he has access to and can get.

Related issue(s)

No issues

@davidfestal davidfestal requested a review from sttts August 4, 2022 20:41
@openshift-ci openshift-ci bot requested a review from shawn-hurley August 4, 2022 20:41
@sttts sttts force-pushed the fix-root-vw-permissions branch from e76d851 to e8acb00 Compare August 5, 2022 11:23
@sttts sttts mentioned this pull request Aug 5, 2022
@@ -36,6 +40,19 @@ const (
func clusterRoleBindings() []rbacv1.ClusterRoleBinding {
return []rbacv1.ClusterRoleBinding{
clusterRoleBindingCustomName(rbacv1helpers.NewClusterBinding("cluster-admin").Groups(SystemKcpClusterWorkspaceAdminGroup, SystemKcpAdminGroup).BindingOrDie(), "system:kcp:clusterworkspace:admin"),
clusterRoleBindingCustomName(rbacv1helpers.NewClusterBinding("system:kcp:tenancy:reader").Groups(SystemKcpClusterWorkspaceAccessGroup).BindingOrDie(), "system:kcp:clusterworkspace:access"),
Copy link
Contributor

@p0lyn0mial p0lyn0mial Aug 5, 2022

Choose a reason for hiding this comment

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

so this is saying, system:kcp:clusterworkspace:access group will be assigned to system:kcp:tenancy:reader role, which allows list/watch on clusterworkspaces/workspace

Copy link
Contributor

Choose a reason for hiding this comment

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

which users are assigned to system:kcp:clusterworkspace:access group?

Copy link
Member

@sttts sttts Aug 5, 2022

Choose a reason for hiding this comment

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

{
ObjectMeta: metav1.ObjectMeta{Name: "system:kcp:tenancy:reader"},
Rules: []rbacv1.PolicyRule{
rbacv1helpers.NewRule("list", "watch").Groups(tenancy.GroupName).Resources("clusterworkspaces/workspace").RuleOrDie(), // "get" is by workspace name through workspace VW
Copy link
Contributor

Choose a reason for hiding this comment

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

what does list mean in this context? (clusterworkspaces/workspace)

Copy link
Member

Choose a reason for hiding this comment

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

kubectl get workspaces

subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:authenticated
Copy link
Contributor

Choose a reason for hiding this comment

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

is this correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think a user can be system:authenticated but not in SystemKcpClusterWorkspaceAccessGroup

Copy link
Member

Choose a reason for hiding this comment

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

that's intentional. That's one of the batteries in #1688. In a real service this binding might not make sense. But for demo and development it does.

@sttts sttts force-pushed the fix-root-vw-permissions branch 2 times, most recently from 5a41438 to 66f688a Compare August 5, 2022 12:30
@p0lyn0mial
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 5, 2022
@sttts sttts force-pushed the fix-root-vw-permissions branch from 66f688a to e0cde97 Compare August 5, 2022 15:05
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 5, 2022
@sttts
Copy link
Member

sttts commented Aug 5, 2022

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 5, 2022
@sttts
Copy link
Member

sttts commented Aug 5, 2022

/cherry-pick release-0.8

@openshift-cherrypick-robot

@sttts: once the present PR merges, I will cherry-pick it on top of release-0.8 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.8

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.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 5, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 5, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ncdc, sttts

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

@sttts
Copy link
Member

sttts commented Aug 5, 2022

/cherry-pick release-0.7

@openshift-cherrypick-robot

@sttts: once the present PR merges, I will cherry-pick it on top of release-0.7 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.7

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.

@openshift-ci openshift-ci bot merged commit f8ef79b into kcp-dev:main Aug 5, 2022
@openshift-cherrypick-robot

@sttts: cannot checkout release-0.8: error checking out release-0.8: exit status 1. output: error: pathspec 'release-0.8' did not match any file(s) known to git

In response to this:

/cherry-pick release-0.8

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.

@openshift-cherrypick-robot

@sttts: new pull request created: #1691

In response to this:

/cherry-pick release-0.7

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
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants