Replies: 7 comments 5 replies
-
|
Found similar issue |
Beta Was this translation helpful? Give feedback.
-
|
Hi @gadzillos, your assessment of the identity bypass is correct. When Headlamp uses a static ServiceAccount token for remote clusters, the API server sees the ServiceAccount, not the OIDC user. Technical Feasibility of Impersonation: Your proposal to use impersonate-user and impersonate-group headers is the standard Kubernetes architectural solution for this. However, for this to work in Headlamp, the backend proxy must be explicitly configured to extract the OIDC user identity and inject these headers into the proxied request. Current Implementation Gaps: Identity Propagation: We need to verify if the Headlamp backend proxy logic currently supports dynamic impersonation header injection based on the authenticated OIDC session. Security Scoping: Granting impersonate permissions to the Headlamp ServiceAccount on remote clusters is powerful (effectively making it a proxy for any user). It is recommended to scope the ClusterRole to specific groups or users to maintain a least-privilege stance. Next Steps: I am currently contributing to the plugin and OIDC areas of the project. I'll investigate the backend proxy code to see if we can implement a 'User Impersonation Toggle' for multi-cluster configurations that automatically handles this header delegation |
Beta Was this translation helpful? Give feedback.
-
|
@achalcipher, do you have any ETA or plans we can follow to track the implementation progress? |
Beta Was this translation helpful? Give feedback.
-
|
Yes Sir, I do have my plans and ETA to do all these things and align them smoothly |
Beta Was this translation helpful? Give feedback.
-
@gadzillos This is not completely correct, headlamp can use OIDC for remote clusters, you just need to adjust the kubeconfig you provide. This is an example of how I use it in my clusters: I omitted the certificate data for the cluster, but everything else should work when adapting an existing kubeconfig. If you need help feel free to drop me a message |
Beta Was this translation helpful? Give feedback.
-
|
Following up on this discussion — I've been running into the exact pain @gadzillos described (single ingress, mounted multi-cluster kubeconfig, OIDC re-login per cluster) and I want to propose a concrete design before opening a PR. There are two viable approaches; I'd like maintainer input on which you'd accept. Approach A — OIDC token broadcast (what I've prototyped)Idea: After a successful OIDC login on cluster X, if other kubeconfig contexts use OIDC with the same Why: Most real deployments register one OIDC app for "the platform" and have every Precondition (validated at runtime, not at config time): Opt-in flag: Scope of change: ~50 lines in Trade-offs:
Approach B — Impersonation headersIdea: Headlamp's SA on each remote cluster gets Trade-offs:
My recommendationApproach A is the right default for the common deployment shape; Approach B is the right escape hatch for orgs that can't (or won't) configure IdP trust on every cluster. They're not mutually exclusive — A should land first because it's smaller and unblocks the majority case. Open questions for maintainers
I have a working prototype already (in my fork) that I can clean up and PR within a week if A sounds right. Happy to iterate on the design here first. |
Beta Was this translation helpful? Give feedback.
-
|
Opened #5929 as a draft implementing Approach A (opt-in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys, the best lamp for k8s there is
I've deployed InCluster headlamp via ingress with keycloack OIDC
Headlamp uses its own service account and users can login into UI via OIDC woth correct permission
for example: admin can do anything, developer has view/edit only on itheir namespace (via RBAC and OIDC groups)
But when I want to manage multiple cluster with singe ingress so I can access clusters and create projects - there is a problem
I provide volumemount for kubeconfig with service accounts for multiple clusters
And... OIDC simply dissapears - I can access clusters as if I am the service account without any login
the purpose of OIDC groups and RBAC dissapers
I understand correctly that Headlamp itself can't use OIDC login for a remote cluster and uses ServiceAccount (although I've tried ungodly setup by adding kubectl and oidc-login to the dockerfile and rebuilding image)
I guess I could provide admin ServiceAccount for clusters (which is against audit policies - oidc is forced) but such setup still doesnt function as OIDC for users
When you provide a kubeconfig with a hardcoded ServiceAccount token for remote clusters, Headlamp uses those credentials directly from the backend. Since the backend already has valid credentials (the ServiceAccount token), it doesn't trigger a "Sign In" flow for those clusters. Consequently, the user is effectively "logged in" as that ServiceAccount, bypassing individual RBAC.
Maybe I need Service Account with a permission
impersonate-userimpersonate-group?I'm sure someone was able to keep OIDC groups permissions for users with multiple clusters UI
Beta Was this translation helpful? Give feedback.
All reactions