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

Kubernetes Dashboard fails to authorise with group-based RBAC #6349

Closed
embik opened this issue Oct 30, 2023 · 9 comments
Closed

Kubernetes Dashboard fails to authorise with group-based RBAC #6349

embik opened this issue Oct 30, 2023 · 9 comments
Labels
customer-request kind/bug Categorizes issue or PR as related to a bug. sig/api Denotes a PR or issue as being assigned to SIG API.

Comments

@embik
Copy link
Member

embik commented Oct 30, 2023

What happened

I wanted to assign RBAC to users accessing my user cluster in KKP. Since they are all in OIDC groups and the KKP setup has OIDC for user clusters enabled, I only assigned group-based RBAC. When those users that only have access via group-based RBAC try to use the Kubernetes Dashboard built into KKP, they are getting errors insinuating that they do not have proper permissions:

nodes is forbidden: User "[email protected]" cannot list resource "nodes" in API group "" at the cluster scope

However, the same users can access the cluster via an OIDC-based kubeconfig downloaded from the KKP dashboard just fine. As a example from the error above: Accessing the list of nodes (and any other resources) works via kubectl, but not via the Kubernetes Dashboard (proxy). The dashboard stays empty.

Expected behavior

OIDC access via kubectl / kubeconfig or Kubernetes Dashboard based access should be consistent, my users should have access to the same resources via the Kubernetes Dashboard just based on group permissions.

How to reproduce

  1. Sign into KKP (e.g. dev) with an OIDC provider that has groups. In our example, GitHub. Make sure the setup supports OIDC for user clusters.
  2. Create a user cluster, enable Kubernetes Dashboard during the setup. Wait for the user cluster to finish deploying.
  3. Go to "RBAC" tab at the bottom, switch to "User". Remove the entry for your own user.
  4. Download kubeconfig from "Get Kubeconfig", verify with e.g. kubectl get nodes that you no longer have permissions.
  5. Go back to "RBAC", switch to "Group". Add a binding for a OIDC group that your user is part of (don't forget to add the oidc: prefix; an example is oidc:kubermatic:development). Chose cluster-admin as role for simplicity.
  6. Verify with the previously downloaded kubeconfig that your user is allowed to run kubectl get nodes again.
  7. Click "Open Dashboard". Sign in with the same identity provider. Observe errors from the bell icon on the top right, and click "Nodes" from the left side menu to see that you cannot access nodes (or any other resource) from the dashboard.

Environment

  • UI Version: v2.24.0-beta.1 (but also found on 2.23)
  • API Version: v2.24.0-beta.1 (but also found on 2.23)
  • Domain: -
  • Others: -

Current workaround

Add user-based RBAC bindings for each user.

Affected user persona

Developers given access to user clusters

Business goal to be improved

Metric to be improved

@embik embik added kind/bug Categorizes issue or PR as related to a bug. sig/api Denotes a PR or issue as being assigned to SIG API. labels Oct 30, 2023
@embik
Copy link
Member Author

embik commented Oct 30, 2023

As a note, I was debugging this briefly with a Kubermatic partner, and we saw the groups included in the OIDC token used by the Kubernetes Dashboard. It was therefore not clear to us why groups were seemingly ignored.

@kubermatic-bot
Copy link
Contributor

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

@kubermatic-bot kubermatic-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 14, 2024
@kubermatic-bot
Copy link
Contributor

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

@kubermatic-bot kubermatic-bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 14, 2024
@embik
Copy link
Member Author

embik commented Apr 14, 2024

/remove-lifecycle rotten

@kubermatic-bot kubermatic-bot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale. label Apr 14, 2024
@kubermatic-bot
Copy link
Contributor

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

@kubermatic-bot kubermatic-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 13, 2024
@embik
Copy link
Member Author

embik commented Jul 15, 2024

/remove-lifecycle stale

@kubermatic-bot kubermatic-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 15, 2024
@kubermatic-bot
Copy link
Contributor

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

@kubermatic-bot kubermatic-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 13, 2024
@embik
Copy link
Member Author

embik commented Oct 14, 2024

/remove-lifecycle stale

@kubermatic-bot kubermatic-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 14, 2024
@ahmedwaleedmalik
Copy link
Member

Should be fixed through #7014; if not please re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-request kind/bug Categorizes issue or PR as related to a bug. sig/api Denotes a PR or issue as being assigned to SIG API.
Projects
None yet
Development

No branches or pull requests

3 participants