Skip to content

Conversation

ntnn
Copy link
Member

@ntnn ntnn commented Aug 27, 2025

What type of PR is this?

See kcp-dev/kcp#3513

Two types of users get to keep groups starting with system:cluster:*:

  1. Service Accounts
  2. Authenticated users not originating from the cluster the request was made from

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@kcp-ci-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign liggitt for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@ntnn ntnn changed the title [WIP] UPSTREAM: <carry>: Keep system:cluster:* groups UPSTREAM: <carry>: Keep system:cluster:* groups Aug 27, 2025
Signed-off-by: Nelo-T. Wallus <[email protected]>
Signed-off-by: Nelo-T. Wallus <[email protected]>
@mjudeikis
Copy link

Do we need to care if people can use these groups in their configuration? Do we have some safe-guards?

@ntnn
Copy link
Member Author

ntnn commented Aug 28, 2025

Kube should protect system: users and groups by itself, for per-workspace auth I'm not so sure anymore after I've noticed that the system:authenticated group is missing.

At least we also have the ForbidSystemUsername for per-workspace auth: https://github.com/kcp-dev/kcp/blob/e23e1b842eef9d6850736764d24b17ffd34c4f88/pkg/authentication/usernames.go#L28
I think we'd need the same for ForbidSystemGroups and some tests on top.

@ntnn
Copy link
Member Author

ntnn commented Aug 28, 2025

Ah, you can't assign groups directly via per-workspace auth. That's only happening by manually mapping it in the authentication configuration.
But we could and should protect the system:cluster: groups.

And we do: https://github.com/kcp-dev/kcp/blob/e23e1b842eef9d6850736764d24b17ffd34c4f88/pkg/authentication/index.go#L241-L245
And there's a test for it: https://github.com/kcp-dev/kcp/blob/e23e1b842eef9d6850736764d24b17ffd34c4f88/test/e2e/authentication/workspace_test.go#L209-L221
So it's all good

@ntnn ntnn requested a review from xrstf September 2, 2025 11:27
@embik embik merged commit 9347928 into kcp-dev:kcp-1.33.3-1 Sep 3, 2025
@ntnn ntnn deleted the kcp3513 branch September 3, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants