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

Limit keycloak redirect urls #491

Merged
merged 5 commits into from
Oct 20, 2020
Merged

Limit keycloak redirect urls #491

merged 5 commits into from
Oct 20, 2020

Conversation

tolusha
Copy link
Contributor

@tolusha tolusha commented Oct 12, 2020

Signed-off-by: Anatolii Bazko abazko@redhat.com

Reference issue

eclipse-che/che#17902

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@openshift-ci-robot
Copy link

@tolusha: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/v5-che-operator-update 7696a7c link /test v5-che-operator-update

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/test-infra repository. I understand the commands that are listed here.

@@ -20,7 +20,7 @@ if [ $? -eq 0 ]; then echo "Realm exists"; exit 0; fi \
-s clientId=$keycloakClientId \
-s id=$keycloakClientId \
-s 'webOrigins=["http://$cheHost", "https://$cheHost"]' \
-s 'redirectUris=["http://$cheHost/*", "https://$cheHost/*"]' \
-s 'redirectUris=["http://$cheHost/dashboard/", "https://$cheHost/dashboard/", "http://$cheHost/workspace-loader/", "https://$cheHost/workspace-loader/", "http://$cheHost/_app/loader.html", "https://$cheHost/_app/loader.html"]' \
Copy link
Member

Choose a reason for hiding this comment

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

What about an ability to get token from localhost? I kept in mind running local dashboard/workspace-loader instance without modifying redirects uris manually on each new cluster, but I assume it could also help chectl server:login do login through web interface, as https://github.com/int128/kubelogin is able to do.

I assume it should be safe to do since it's allowed on OpenShift.io oauth.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure that it is secure, who can confirm that?

Copy link
Member

Choose a reason for hiding this comment

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

@ibuziuk Could you help to discover the answer here?

Copy link
Member

Choose a reason for hiding this comment

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

Seems _app/oauth.html needs to be added here as well https://github.com/eclipse/che/blob/master/assembly/assembly-root-war/src/main/webapp/_app/oauth.html.

What if we even add _app/* since we are sure that _app is an application hosted by Che Server and we don't really need to list them one by one. @skabashnyuk WDYT?

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@tolusha
Copy link
Contributor Author

tolusha commented Oct 20, 2020

/retest

@@ -20,7 +20,7 @@ if [ $? -eq 0 ]; then echo "Realm exists"; exit 0; fi \
-s clientId=$keycloakClientId \
-s id=$keycloakClientId \
-s 'webOrigins=["http://$cheHost", "https://$cheHost"]' \
-s 'redirectUris=["http://$cheHost/*", "https://$cheHost/*"]' \
-s 'redirectUris=["http://$cheHost/dashboard/*", "https://$cheHost/dashboard/*", "http://$cheHost/workspace-loader/*", "https://$cheHost/workspace-loader/*", "http://$cheHost/_app/*", "https://$cheHost/_app/*"]' \
Copy link
Member

Choose a reason for hiding this comment

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

Not really related to the current PR but can we instead of duplication http and https redirects just provide the right protocol via parameter as we provide $cheHost? It would help us be more secure and make sure token if not send through http when https is configured

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree

Copy link
Member

@sleshchenko sleshchenko left a comment

Choose a reason for hiding this comment

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

Approving since http/https issue is already in the code but it can be solved separately

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sleshchenko, tolusha
To complete the pull request process, please assign after the PR has been reviewed.
You can assign the PR to them by writing /assign in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tolusha tolusha merged commit 40b3904 into master Oct 20, 2020
@tolusha tolusha deleted the limitkeycloakredirecturls branch October 20, 2020 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants