-
Notifications
You must be signed in to change notification settings - Fork 152
Fallback to OpenShift user API if no role granted #59
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
Conversation
Using delegating authentication and authorization requires a cluster role `system:auth-delegator` to be assigned to the service account the oauth_proxy is running under. This might be difficult to add if the cluster is not under control of the user deploying oauth_proxy. This adds a fallback to use OpenShift user API for authentication and ignore authorization entirely.
|
/hold We can add a health check that fails to start the proxy if it is misconfigured (I thought we had something like this already). But we should not ignore the configuration in an attempt to get something that "works" but is not what the user requested. |
|
/assign @mrogers950 |
|
I feel this should be NACKed. |
|
The use case I'm trying to do is when the user is installing from a template, with rights only to the namespace the solution is being installed to. |
|
@simo5 @enj so the requirement is for using delegating authentication and authorization requires cluster-admin role and can not used by a normal e.g. on OpenShift Online where you obviously don't have this role. Is this correct ? Isn't that a bit too restrictive then as most users don't have cluster-admin on their clusters. What do you suggest as solution to @zregvart use case ? (actually this is a blocker for our project, Red Hat Fuse iPaaS) thanks ... |
|
When set up by an unprivileged user, oauth proxy runs in an untrusted mode ( When Note that cluster admin is not specifically required for the delegated auth configuration. A cluster role binding to |
|
@enj thank you for looking into this and for the providing additional details. Let me explain our use case in more detail, as far as I can understand When provisioning using templates to OpenShift Online and within this process we can't assign the We're delegating all security, which in our case boils down to just authentication and simplest authorization (if user can access the project) to oauth proxy. For browser use case this is not an issue as the cookie based flow you described is well suited. We are trying to find a way to make this work with non-browser (direct API) use using delegate auth. If there is another way of achieving that we'd be happy to adopt it. It seems to me that using |
|
What you do boils down to make it easy for untrusted users to steal other users credentials, don't do that. |
We definitely don't want to endanger our users so if we're doing that I would like to understand how, can you elaborate a bit on this? Our use case is that oauth proxy is in front of our application, not in front of any application. |
To be specific, you need to be able to create cluster role bindings and already have the powers of
You will need to go through the OAuth flow just like a browser would (i.e. client side HTML parsing and cookie management). The cookie would be used as the form of auth instead of a bearer token.
It may be sufficient for your business and technical requirements. However, it violates the core security requirement for OAuth proxy that untrusted users and SAs must not see other user's tokens. As such we cannot support this use case.
Any user can set up oauth proxy so there is no difference between the two scenarios. In the future we have plans to allow users to easily create scoped tokens. We may be able to leverage that to make an untrusted token based flow (without OAuth) safe. Closing per above. |
|
Thank you for your consideration, though I don't agree with the stated I see your point of view. We'll need to find some other way of accomplishing this. |
Using delegating authentication and authorization requires a cluster role
system:auth-delegatorto be assigned to the service account the oauth_proxy is running under. This might be difficult to add if the cluster is not under control of the user deploying oauth_proxy.This adds a fallback to use OpenShift user API for authentication and ignore authorization entirely.