Skip to content
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

[OSDOCS-12792]More Secure Auth Flows in ROSA CLIs #90006

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

@openshift-ci openshift-ci bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 10, 2025
@mletalie mletalie changed the title Osdocs 12792 [OSDOCS-12792]More Secure Auth Flows in ROSA CLIs Mar 10, 2025
@mletalie mletalie closed this Mar 11, 2025
@mletalie mletalie reopened this Mar 11, 2025
@openshift-ci openshift-ci bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 13, 2025
@@ -10,8 +10,50 @@ Use the following commands to configure the {product-title} (ROSA) CLI, `rosa`.

[id="rosa-login_{context}"]
== login
There are several methods you can use to log into your Red{nbsp}Hat account using the {product-title} (ROSA) CLI (`rosa`).These methods are described in detail below.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] RedHat.TermsErrors: Use 'log in to' rather than 'log into'. For more information, see RedHat.TermsErrors.

=== login with single sign-on (SSO) authorization code
If your system supports a web-based browser, you can log in to the ROSA CLI (`rosa`) with a Red{nbsp}Hat single sign-on (SSO) authorization code.

. To log into the ROSA CLI (`rosa`) with a Red{nbsp}Hat single sign-on authorization code, run the following command:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] RedHat.TermsErrors: Use 'log in to' rather than 'log into'. For more information, see RedHat.TermsErrors.

@mletalie mletalie force-pushed the OSDOCS-12792 branch 2 times, most recently from c15b7c9 to 39681d5 Compare March 17, 2025 21:13
@openshift-ci openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 17, 2025
@mletalie mletalie force-pushed the OSDOCS-12792 branch 5 times, most recently from a94ead7 to e00887d Compare March 19, 2025 18:42
[id="rosa-login-token_{context}"]
=== login with an offline token

Log in to your Red{nbsp}Hat account, saving the credentials to the `rosa` configuration file. To use offline tokens for automation or other purposes, you can download the OpenShift Cluster Manager API token from the link:https://console.redhat.com/openshift/token/rosa[OpenShift Cluster Manager API Token] page.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] OpenShiftAsciiDoc.SuggestAttribute: Use the AsciiDoc attribute '{cluster-manager}' rather than the plain text product term 'OpenShift Cluster Manager', unless your use case is an exception.

[id="rosa-login-token_{context}"]
=== login with an offline token

Log in to your Red{nbsp}Hat account, saving the credentials to the `rosa` configuration file. To use offline tokens for automation or other purposes, you can download the OpenShift Cluster Manager API token from the link:https://console.redhat.com/openshift/token/rosa[OpenShift Cluster Manager API Token] page.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] OpenShiftAsciiDoc.SuggestAttribute: Use the AsciiDoc attribute '{cluster-manager}' rather than the plain text product term 'OpenShift Cluster Manager', unless your use case is an exception.

@mletalie
Copy link
Contributor Author

@yuwang-RH
Could please get a QE review for this PR? Thanks!


Log in to your Red{nbsp}Hat account, saving the credentials to the `rosa` configuration file.

To use offline tokens for automation purposes, you can download the OpenShift Cluster Manager API token from the link:https://console.redhat.com/openshift/token/rosa[OpenShift Cluster Manager API Token] page.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] OpenShiftAsciiDoc.SuggestAttribute: Use the AsciiDoc attribute '{cluster-manager}' rather than the plain text product term 'OpenShift Cluster Manager', unless your use case is an exception.


Log in to your Red{nbsp}Hat account, saving the credentials to the `rosa` configuration file.

To use offline tokens for automation purposes, you can download the OpenShift Cluster Manager API token from the link:https://console.redhat.com/openshift/token/rosa[OpenShift Cluster Manager API Token] page.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] OpenShiftAsciiDoc.SuggestAttribute: Use the AsciiDoc attribute '{cluster-manager}' rather than the plain text product term 'OpenShift Cluster Manager', unless your use case is an exception.

@yuwang-RH
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 20, 2025
@AedinC
Copy link
Contributor

AedinC commented Mar 20, 2025

/label peer-review-in-progress

@openshift-ci openshift-ci bot added the peer-review-in-progress Signifies that the peer review team is reviewing this PR label Mar 20, 2025
Copy link
Contributor

@AedinC AedinC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/remove-label peer-review-in-progress
/label peer-review-done

$ ocm login --use-auth-code
----
+
Running this command will redirect you to the Red Hat SSO login.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if it's of any benefit to add something like ' Log in with your Red{nbsp}Hat login or email' or is that overkill?

----
$ ocm login --use-device-code
----
Running this command will redirect you to the Red Hat SSO login and provide a log in code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Running this command will redirect you to the Red Hat SSO login and provide a log in code.
Running this command will redirect you to the Red{nbsp}Hat SSO login and provide a log in code.


+

To switch accounts, logout from https://sso.redhat.com and run the `ocm logout` command before attempting to login again.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To switch accounts, logout from https://sso.redhat.com and run the `ocm logout` command before attempting to login again.
To switch accounts, logout from https://sso.redhat.com and run the `ocm logout` command in your terminal before attempting to login again.

@@ -10,8 +10,91 @@ Use the following commands to configure the {product-title} (ROSA) CLI, `rosa`.

[id="rosa-login_{context}"]
== login
There are several methods you can use to log into your Red{nbsp}Hat account using the {product-title} (ROSA) CLI (`rosa`).These methods are described in detail below.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There are several methods you can use to log into your Red{nbsp}Hat account using the {product-title} (ROSA) CLI (`rosa`).These methods are described in detail below.
There are several methods you can use to log into your Red{nbsp}Hat account using the {product-title} (ROSA) CLI (`rosa`). These methods are described in detail below.

Log in to your Red{nbsp}Hat account, saving the credentials to the `rosa` configuration file. You must provide a token when logging in. You can copy your token from link:https://console.redhat.com/openshift/token/rosa[the ROSA token page].
[IMPORTANT]
====
An offline authentication token is long-lived, stored on your operating system, and cannot be revoked. These factors increase overall security risks and the likelihood of unauthorized access to your account. Alternatively, the Red{nbsp}Hat secure browser-based single sign-on (SSO) method automatically sends your CLI instance a refresh token that is valid for 10 hours. Because this authorization code is unique and temporary, it is more secure and the Red{nbsp}Hat recommended method of authentication.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
An offline authentication token is long-lived, stored on your operating system, and cannot be revoked. These factors increase overall security risks and the likelihood of unauthorized access to your account. Alternatively, the Red{nbsp}Hat secure browser-based single sign-on (SSO) method automatically sends your CLI instance a refresh token that is valid for 10 hours. Because this authorization code is unique and temporary, it is more secure and the Red{nbsp}Hat recommended method of authentication.
An offline authentication token is long-lived, stored on your operating system, and cannot be revoked. These factors increase overall security risks and the likelihood of unauthorized access to your account. Alternatively, the Red{nbsp}Hat secure browser-based single sign-on (SSO) method automatically sends your CLI instance a refresh token that is valid for 10 hours. Because this authorization code is unique and temporary, it is more secure and is the Red{nbsp}Hat recommended method of authentication.

$ rosa login --use-auth-code
----
+
Running this command will redirect you to the Red{nbsp}Hat SSO login.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a line similar to the one above about logging in with Red Hat login and email?


|===
+
To switch accounts, logout from link:https://sso.redhat.com[https://sso.redhat.com] and run the command `$ rosa logout` before attempting to login again.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To switch accounts, logout from link:https://sso.redhat.com[https://sso.redhat.com] and run the command `$ rosa logout` before attempting to login again.
To switch accounts, logout from link:https://sso.redhat.com[https://sso.redhat.com] and run the `rosa logout` command in your terminal before attempting to login again.


|===
+
To switch accounts, logout from link:https://sso.redhat.com[https://sso.redhat.com] and run `rosa logout` before attempting to login again.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To switch accounts, logout from link:https://sso.redhat.com[https://sso.redhat.com] and run `rosa logout` before attempting to login again.
To switch accounts, logout from link:https://sso.redhat.com[https://sso.redhat.com] and run the `rosa logout` command in your terminal before attempting to login again.

[NOTE]
====
Red{nbsp}Hat recommends using service accounts for automation purposes.
====

The ROSA CLI (`rosa`) looks for a token in the following priority order:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is out of scope but I have read this sentence and the 4 directly after it many times and I am still unsure what exactly is being said and how useful it is for the user to know this info.

Also out of scope, but could you edit the final login option so it matches the rest of the methods .' To log in to ROSA CLI (rosa) with a Red{nbsp}Hat offline token, run the following command:'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make point #2 work going to remove the info proceeding as not needed.

@openshift-ci openshift-ci bot added peer-review-done Signifies that the peer review team has reviewed this PR and removed peer-review-in-progress Signifies that the peer review team is reviewing this PR labels Mar 20, 2025
@AedinC
Copy link
Contributor

AedinC commented Mar 20, 2025

Hey @mletalie great job. Just a few nit picks and suggestions.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 20, 2025
@@ -10,22 +10,107 @@ Use the following commands to configure the {product-title} (ROSA) CLI, `rosa`.

[id="rosa-login_{context}"]
== login
There are several methods you can use to log into your Red{nbsp}Hat account using the {product-title} (ROSA) CLI (`rosa`). These methods are described in detail below.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] RedHat.TermsErrors: Use 'log in to' rather than 'log into'. For more information, see RedHat.TermsErrors.

@yuwang-RH
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 21, 2025
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 21, 2025
Copy link

openshift-ci bot commented Mar 21, 2025

New changes are detected. LGTM label has been removed.

Copy link

openshift-ci bot commented Mar 21, 2025

@mletalie: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@mletalie
Copy link
Contributor Author

@bmcelvee bmcelvee merged commit 7a50009 into openshift:main Mar 25, 2025
2 checks passed
@bmcelvee
Copy link
Contributor

/cherrypick enterprise-4.18

@openshift-cherrypick-robot

@bmcelvee: new pull request created: #91092

In response to this:

/cherrypick enterprise-4.18

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@bmcelvee
Copy link
Contributor

/cherrypick enterprise-4.19

@openshift-cherrypick-robot

@bmcelvee: new pull request created: #91093

In response to this:

/cherrypick enterprise-4.19

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch/enterprise-4.18 branch/enterprise-4.19 peer-review-done Signifies that the peer review team has reviewed this PR size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants