Bug 1939403 - oc 4.7 client requests token for user/password identity provider when using LDAP-only
Summary: oc 4.7 client requests token for user/password identity provider when using L...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.7
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Arda Guclu
QA Contact: zhou ying
URL:
Whiteboard:
: 1955344 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-16 10:52 UTC by Pablo Alonso Rodriguez
Modified: 2024-12-20 19:45 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-10-11 10:33:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Pablo Alonso Rodriguez 2021-03-16 10:52:17 UTC
Description of problem:

While trying to "oc login" with a 4.7.1 oc client to a 4.6.z cluster, it requests to get a token from the web console even for identity providers which usually allow providing user and pasword via oc (reproduced with kubeadmin and LDAP). 

Version-Release number of selected component (if applicable):

Client: 4.7.1
Server: 4.6.20 and some older ones

How reproducible:

Always

Steps to Reproduce:
1. oc login with the version combination above
2.
3.

Actual results:

Request to get token from web page


Expected results:

Prompt for user and password so I provide them via oc


Additional info:

Kubernetes guarantees client/server compatibility for 1 version difference, so 4.7.1 client should behave with a 4.6.20 server correctly as a 4.6.20 does.

I'll be attaching detailed "oc login --loglevel=9" outputs in private attachments.

Comment 3 Maciej Szulik 2021-03-17 11:43:58 UTC
This was intentional change, you can still fallback to the other behavior by explicitly specifying --username flag which will trigger the usual login. 
The reasoning behind is to force users of using basic-auth credentials which are considered less secure towards web-based flows.

Comment 4 Pablo Alonso Rodriguez 2021-03-19 09:25:08 UTC
Hi,

However this leads to a number of problems:
- First of all, any security improvement goes away if this is workaroundable with --username
- Given the point above, this just makes "oc login" usability worse with no real improvement. At the end of the day, we will have the users just following the workaround and having a worse experience using the product for nothing.
- Last but not least, with the current change implemented, "oc login" would stop working without the workaround if the console is down, even if oauth works. That doesn't look like an acceptable behavior.

If you still think this change is still worth it regardless of all these points, I'd be thankful if you could at least provide a full explanation on how this improves security.

Comment 5 Maciej Szulik 2021-03-19 09:52:11 UTC
Let's step back and ask why do you think passing username and password is secure?

Comment 6 Pablo Alonso Rodriguez 2021-03-19 16:35:27 UTC
Hi,

I understand it was secure enough to have been shipped in every OCP version until OCP 4.7, apart from the obvious things like the use of HTTPS, etc.

I also understand that using the other oauth flow is intended to add additional security and it is that benefit what I am asking clarification about.

Comment 8 Maciej Szulik 2021-03-22 09:52:22 UTC
The idea was that basic authentication (iow. passing username/password directly with kubeadmin user) is enabled initially 
in the cluster only to help during initial setup. As one of the post-installation steps [1] we advise users to remove kubeadmin 
(which is using basic authentication provider). To ensure and encourage users to switch away from kubeadmin user we've decided 
not to promote this mechanism by hiding it behind explicit requirement to pass the flag. 

Again, what is the exact user request that this is preventing them from working with? 

[1] https://docs.openshift.com/container-platform/4.7/post_installation_configuration/preparing-for-users.html#understanding-kubeadmin_post-install-preparing-for-users

Comment 9 Pablo Alonso Rodriguez 2021-03-22 09:57:20 UTC
Basically, the perceived impact comes from 2 points:
- The reduced usability due to either requiring the browser or using an extra flag with user/password identity providers (like LDAP or htpasswd).
- That usability reduction may become worse in a scenario where the console is down, but oauth isn't, so basic-auth oc login should still work.

Not sure if there is some room of this to be reconsidered, but thanks for your insights anyway.

Comment 18 Maciej Szulik 2021-03-22 11:24:15 UTC
Yeah, if LDAP is their only provider this is definitely a bug and should be fixed, re-opening.

Comment 19 Armin Kunaschik 2021-05-09 23:13:42 UTC
Any update on this? I don't like to install 4.7 without this fixed. Moving this fix to 4.8 is a no go.

Comment 24 Maciej Szulik 2021-06-08 14:44:34 UTC
*** Bug 1955344 has been marked as a duplicate of this bug. ***

Comment 25 Maciej Szulik 2021-06-10 16:46:19 UTC
I need to consult with our auth team how to best approach this topic, since on the client side we don't have the information if LDAP is configured as a authentication source.

Comment 29 Maciej Szulik 2021-06-15 14:53:16 UTC
There's https://issues.redhat.com/browse/RFE-1588 which could potentially improve this situation having the ability so specify the IdP directly would make it obvious what to do and how to react.

Comment 31 Fatima 2021-06-21 04:55:59 UTC
Hey, any updates hereon #comment 30?

Comment 53 Arda Guclu 2022-10-11 10:33:05 UTC
Since this is an intentional change, I'm closing this as WONTFIX and feel free to re-open it if you think otherwise.


Note You need to log in before you can comment on or make changes to this bug.