kcp icon indicating copy to clipboard operation
kcp copied to clipboard

To use CWT the user needs to have "access" permissions in workspaces where the CWT exists

Open MatousJobanek opened this issue 3 years ago • 5 comments

Describe the bug Consider that there is a CWT Foo in a workspace root:org:plane. The workspace contains also a CR & CRB granting use permissions to the system:authenticated group. Then a user bob wants to create a workspace of the type Foo in his home workspace, but this fails:

$ k ws create bar --type root:org:plane:Foo
Error: workspaces.tenancy.kcp.dev "bar" is forbidden: use of the cluster workspace type "root:org:plane:Foo" in workspace "root:users:qa:kh:bob" is not allowed

the kcp logs contain:

E0713 14:19:32.825814  472150 rest.go:629] user "bob" lacks (denied) clusterworkspacetypes "use" permission for "foo" in root:users:qa:kh:bob: workspace access not permitted

This is because the user bob doesn't have any permission in the root:org:plane workspace. When kcp does SAR for the CWT then it expects that the user has access permissions in the workspace (and also all parent workspaces).

To Reproduce Steps to reproduce the behavior:

  1. Create CWT Foo in root:org:plane (with the necessary CR & CRB granting use permissions)
  2. k ws create bar --type root:org:plane:Foo

Expected behavior it should not require access permissions in the workspace where CWT is defined.

Additional context https://coreos.slack.com/archives/C020QAF9D46/p1657716975579069

MatousJobanek avatar Jul 14 '22 08:07 MatousJobanek

This technically applies to all SARs that are executed for any other resource - for example an APIExport

MatousJobanek avatar Jul 18 '22 11:07 MatousJobanek

This might be helped with a generic Export mechanism, where users could export things (CWT, APIExport) into a "catalog" in the root

ncdc avatar Jul 19 '22 15:07 ncdc

@s-urbaniak Looks like #1739 fixed this, is that true?

nrb avatar Oct 14 '22 19:10 nrb

Issues go stale after 90d of inactivity. After a furter 30 days, they will turn rotten. Mark the issue as fresh with /remove-lifecycle stale.

If this issue is safe to close now please do so with /close.

/lifecycle stale

kcp-ci-bot avatar Apr 13 '24 20:04 kcp-ci-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

kcp-ci-bot avatar May 13 '24 20:05 kcp-ci-bot

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

kcp-ci-bot avatar Jun 12 '24 20:06 kcp-ci-bot

@kcp-ci-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

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.

kcp-ci-bot avatar Jun 12 '24 20:06 kcp-ci-bot