-
Notifications
You must be signed in to change notification settings - Fork 9
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
Create Admission Controller for user impersonation #189
Comments
Here is an approach to discuss. Since admission controllers intercept request after authentication/authorization has been applied, we can create a mutating admission webhook server to process requests related to Razee resources. Example workflow:
Based on the outcome and the value Case 1: The authenticated user does not have impersonate permission:
Case 2: The authenticated user has impersonate permission:
Concerns:
For example, given the following nested resource tree:
If cluster admin allows the initiating/authenticated user to impersonate only user A, we will need an efficient way to pass this information downstream. Otherwise, The cluster admin may be confused because he/she explicitly grants the authenticated user impersonate permission on user A only. The current implementation also causes this problem even we are limiting the effect of impersonation to a specific namespace, razeedeploy. @alewitt2 @adamkingit Any thoughts? |
|
New admission controller webhook created: https://github.com/razee-io/ImpersonationWebhook With the introduction of this webhook, users will likely need to create and manage additional role bindings. Razee controllers (or razee deploy core) should be updated to give users options:
|
Once we have the ability to do user impersonation, we will need a way to limit who is allowed to use it.
I think the most likely place to do that is in an Admission Controller. We will need the admission controller to know who is trying to make the request, and validate that they are authorized to do user impersonation (possibly via new config or rbac). If the user is allowed to do impersonation, allow whatever they put in the impersonate field to stay as is. If they arent allowed, the controller should inject the user's name in the impersonate field (whether they were trying to do impersonation or not).
Until this is implemented, we are limiting user impersonation only to razeedeploy resources created in the
razeedeploy
namespace. NOTE: For now, cluster owners should be aware that they should prevent their users from creating razeedeploy resources in the razeedeploy namespace if they want to prevent them from using user-impersonation.The text was updated successfully, but these errors were encountered: