-
Notifications
You must be signed in to change notification settings - Fork 414
Description
Feature Description
Workspaces can have initializers defined, depending on the WorkspaceType
that is referenced. To facilitate workspace initialisation, we have the initializingworkspaces
virtual workspace (https://github.com/kcp-dev/kcp/tree/main/pkg/virtual/initializingworkspaces/). This virtual workspace is used by both built-in controllers (for default API bindings defined by the universal
WorkspaceType) and potential external controllers.
The virtual workspace allows access to the "content" (i.e. to the whole workspace) of a logical cluster currently waiting for its initializer to be removed. This access is done via impersonation of the owner of the Workspace
object.
It would be nice if the impersonation in question would be enriched by a group that reflects the WorkspaceType
the initializer belongs to. This way it would be possible to assign permissions to a certain WorkspaceType
, not individual users (since the owner of a workspace needs to be able to e.g. bind APIExports
referenced in default API bindings).
The group schema could look like system:workspacetype:<workspace path>:<workspacetype name>
, e.g. system:workspacetype:root:universal
, but this would be up to discussion.
Proposed Solution
- Enrich
thisCfg.Impersonate = rest.ImpersonationConfig{ - Investigate ramifications of this change! In terms of APIBindings, this would mean that Workspaces can be initialised with APIBindings that the Workspace owner couldn't create themselves. Will this create problems? What happens if the user tries to modify the
APIBinding
now? - Add an e2e test that validates the scenario: A user creates a
Workspace
from a certainWorkspaceType
, but would not have the permission to bind anAPIExport
themselves. Since permissions are granted to the synthetic group, theWorkspace
should get an API bound successfully, but the user should not be able to create a similarAPIBinding
themselves.
Alternative Solutions
- Attach a warrant to the impersonation.
Want to contribute?
- I would like to work on this issue.
Additional Context
Metadata
Metadata
Assignees
Labels
Type
Projects
Status