Dynamically generate namespace and rbac from user attributes #2200
Replies: 3 comments 5 replies
-
|
Hi @gberche-orange, Pinniped will help your users auth and will help you extract their usernames and group names from your IDP (potentially transformed by CEL expressions too) and get those usernames and group names into your Kubernetes clusters. However, it does not offer any features to help you manage your RBAC policies for those usernames and group names. There are probably other projects to help you manage RBAC policies, but I don't personally have any specific recommendations for that. |
Beta Was this translation helpful? Give feedback.
-
|
thanks @cfryanr for your response. My team is considering using crossplane to observe user name, groups in the K8S api, and as a result dynamically create namespace and RBAC objects from observed data.
Can usernames, group names be observed through the K8S api once a user has logged in thanks to pinniped ? Looking at the API reference, I have so far identified that the WhoAmIRequest would include in its status the KubernetesUserInfo However, I'm not yet clear on how to issue a WhoAmIRequest to the API server, as the associated tests seem to rather currently illustrate a user-generated REST api call. Is the pinniped cli automatically submitting this Also, I'd hope that through CEL transformations I'd be able to propagate extra elements from the OIDC id token exchanged with the OIDC provider (say gitlab), into the WhoAmIRequest status extra fields. For instance, the id token issued by Gitlab, provides rich additional details that would be leveraged when generating the namespace and rbac objects. |
Beta Was this translation helpful? Give feedback.
-
|
Another use-case I am exploring, is the ability during user enrollment to pinniped, to request for additional scope/claims beyond openid, and upon user consent, to leverage the return oauth access tokens to act on the user behalf to observe additional data beyond what is available in the id token. I'm annotating the documented diagram at https://github.com/vmware-tanzu/pinniped/blob/8b7fec5049f79e790e27e009994e1069d93eba11/site/content/docs/img/pinniped-concierge-supervisor-sequence.svg to illustrate the flows that I would like to act upon, typically in the context of a gitlab IDP with Authorization code flow
Our crossplane-based controller would then observe the secret produced by pinniped to request the gitlab api on behalf of the user, in accordance with the granted scope given during consent. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for maintaining this great project over the years. Here is an idea in the context of a k8s-centric
Internal Develop PlatformIn the pinniped tutorial at https://pinniped.dev/docs/tutorials/concierge-and-supervisor-demo/#configure-rbac-rules-for-the-developer-and-devops-users, the namespace and rbac granted to a user are statically created by an operator
I'm exploring a scenario where namespaces and rbac are automatically created/mirrored from the upstream identity sources, using templating with upstream identity providers attributes as inputs (username, groups, email ...), with some vague similarities to pinniped transformation expressions https://github.com/vmware-tanzu/pinniped/blob/876f626e7d9c1cd655bed2fbe1c6a0a6498d399a/site/content/docs/howto/supervisor/configure-supervisor-federationdomain-idps.md?plain=1#L177-L184
Let's take the example of a user who has an identity on a gitlab IDP, is member of multiple groups, this templating system would map these groups to a set of namespaces and rbac resources, so that the user can then subscribe to cloud resources through K8S CRs within these namespaces.
Can you think of a way pinniped could help in this scenario ? Are you instead aware of other community projects that could be setup to fulfill this goal ?
Beta Was this translation helpful? Give feedback.
All reactions