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

procedures: native user auth docs #2187

Merged
merged 37 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1b93390
native user auth docs
sparkoo Dec 8, 2021
89b4f18
fix lang errors
sparkoo Dec 8, 2021
707daac
Merge branch 'master' into gh20847-nativeUserAuth
sparkoo Dec 8, 2021
5394b64
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 9, 2021
caf2214
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 9, 2021
e2a698e
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 9, 2021
e4d96e8
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 9, 2021
7bee785
Merge branch 'master' into gh20847-nativeUserAuth
themr0c Dec 9, 2021
0c9005c
Update Spelling.yml
themr0c Dec 9, 2021
fffdb05
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 9, 2021
272cadd
Merge branch 'master' into gh20847-nativeUserAuth
themr0c Dec 9, 2021
9555318
Merge branch 'master' into gh20847-nativeUserAuth
themr0c Dec 10, 2021
d2e48b3
update devworkspace installation doc
sparkoo Dec 10, 2021
42998dc
Merge branch 'master' into gh20847-nativeUserAuth
sparkoo Dec 10, 2021
ebfcdce
link to kubernetes oidc docs, cleanup
sparkoo Dec 10, 2021
ec8c196
Merge branch 'master' into gh20847-nativeUserAuth
sparkoo Dec 16, 2021
51d51da
Merge branch 'master' into gh20847-nativeUserAuth
themr0c Dec 16, 2021
f575033
Apply suggestions from code review
themr0c Dec 21, 2021
7b1b6cf
Apply suggestions from code review
themr0c Dec 21, 2021
1a5762c
Add links as attributes
themr0c Dec 21, 2021
e1871dc
Apply suggestions from code review
themr0c Dec 21, 2021
5353ab3
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
6209401
Update modules/administration-guide/partials/con_gateway.adoc
themr0c Dec 21, 2021
a6545ce
Apply suggestions from code review
themr0c Dec 21, 2021
9738741
Update modules/installation-guide/partials/proc_enabling-dev-workspac…
themr0c Dec 21, 2021
3b91a8a
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
46b9f32
Update modules/administration-guide/partials/con_gateway.adoc
themr0c Dec 21, 2021
fae8a58
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
ff7eb5d
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
972e96e
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
f6c3fb3
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
e64d989
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
e8ee0bc
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
065c669
Update modules/administration-guide/partials/con_gateway.adoc
themr0c Dec 21, 2021
fa5d00a
grammar fixes
sparkoo Dec 22, 2021
a38244f
Merge branch 'master' into gh20847-nativeUserAuth
sparkoo Dec 22, 2021
67e99ff
Apply suggestions from code review
themr0c Dec 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vale/styles/CheDocs/Spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ filters:
- Datadog
- Dev
- DevWorkspace
- Dex
themr0c marked this conversation as resolved.
Show resolved Hide resolved
- DNS
- Docker
- Dockerfile
Expand Down
3 changes: 3 additions & 0 deletions antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ asciidoc:
link-installing-an-instance: xref:installation-guide:installing-che.adoc[]
link-server-identity-provider-dockerfile-location: https://github.com/eclipse-che/che-server/tree/main/dockerfiles/keycloak
link-viewing-the-state-of-the-cluster-deployment-using-openshift-4-cli-tools: xref:overview:installing-che-on-openshift-4-using-operatorhub.adoc[]
link-oauth2-proxy: link:https://github.com/oauth2-proxy/oauth2-proxy[OAuth2 Proxy]
link-kube-rbac-proxy: link:https://github.com/brancz/kube-rbac-proxy[kube-rbac-proxy]
link-oidc-issuer: link:https://dexidp.io/[Dex]
namespace: namespace # In context: API namespace
nodejs-stack: nodejs
ocp: OpenShift Container Platform
Expand Down
4 changes: 3 additions & 1 deletion modules/administration-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,7 @@
** xref:authenticating-users.adoc[]
** xref:authorizing-users.adoc[]
** xref:configuring-authorization.adoc[]
** xref:configuring-openshift-oauth.adoc[]
*** xref:configuring-openshift-oauth.adoc[]
*** xref:configuring-minikube-github-authentication.adoc[]

** xref:removing-user-data.adoc[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[id="configuring-openshift-oauth"]
// = Configuring OpenShift OAuth
:navtitle: Configuring Minikube GitHub Authentication
:keywords: administration-guide, configuring-openshift-oauth
:page-aliases: .:configuring-minikube-github-authentication

include::partial$proc_configuring-minikube-github-authentication.adoc[]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[id="configuring-openshift-oauth"]
// = Configuring OpenShift OAuth
:navtitle: Configuring OpenShift OAuth
:keywords: end-user-guide, configuring-openshift-oauth
:keywords: administration-guide, configuring-openshift-oauth
:page-aliases: .:configuring-openshift-oauth

include::partial$proc_configuring-openshift-oauth.adoc[]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[id="managing-identities-and-authorizations"]
// = Managing identities and authorizations
:navtitle: Managing identities and authorizations
:keywords: end-user-guide, managing-identities-and-authorizations
:keywords: administration-guide, managing-identities-and-authorizations
:page-aliases: .:managing-identities-and-authorizations

include::partial$assembly_managing-identities-and-authorizations.adoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ include::partial$proc_listing-che-permissions.adoc[leveloffset=+1]

include::partial$proc_assigning-che-permissions.adoc[leveloffset=+1]


:context: {parent-context-of-authorizing-users}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ This section describes different aspects of managing identities and authorizatio
* xref:configuring-authorization.adoc[]
* xref:removing-user-data.adoc[]
* xref:configuring-openshift-oauth.adoc[]
* xref:configuring-minikube-github-authentication.adoc[]

:context: {parent-context-of-managing-identities-and-authorizations}
10 changes: 9 additions & 1 deletion modules/administration-guide/partials/con_che-operator.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ Defines the `CheCluster` {orch-name} object.
Creates and controls the necessary {orch-name} objects to run a {prod-short} instance, such as pods, services, and persistent volumes.

`CheCluster` custom resource (CR)::
On a cluster with the {prod-short} operator, it is possible to create a `CheCluster` custom resource (CR). The {prod-short} operator ensure full lifecycle management of the {prod-short} server components on this {prod-short} instance.
On a cluster with the {prod-short} operator, it is possible to create a `CheCluster` custom resource (CR). The {prod-short} operator ensure full lifecycle management of the {prod-short} server components on this {prod-short} instance:
sparkoo marked this conversation as resolved.
Show resolved Hide resolved
+
* xref:devworkspace-operator.adoc[]
* xref:gateway.adoc[]
* xref:dashboard.adoc[]
* xref:devfile-registries.adoc[]
* xref:che-server.adoc[]
* xref:postgresql.adoc[]
* xref:plug-in-registry.adoc[]

.Additional resources

Expand Down
9 changes: 8 additions & 1 deletion modules/administration-guide/partials/con_gateway.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
[id="gateway_{context}"]
= Gateway

The {prod-short} gateway is a Traefik instance applying {orch-name} Role based access control (RBAC) policies to control access to any {prod-short} resource.
The {prod-short} gateway has following roles:

* Routing requests. It uses link:https://github.com/traefik/traefik[Traefik].

* Authenticating users with OpenID Connect (OIDC). It uses {link-oauth2-proxy}.

* Applying {orch-name} Role based access control (RBAC) policies to control access to any {prod-short} resource. It uses {link-kube-rbac-proxy}.

themr0c marked this conversation as resolved.
Show resolved Hide resolved
The {prod-short} operator manages it as the `che-gateway` Deployment.

It controls access to:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[id="configuring-minikube-github-authentication_{context}"]
= Configuring Minikube with GitHub Authentication
themr0c marked this conversation as resolved.
Show resolved Hide resolved


On Minikube, {prod-cli} provides a default OpenID Connect (OIDC) issuer, which can serve as a bridge to third party {identity-provider}, such as GitHub.
{link-oidc-issuer} is the default OIDC issuer, preconfigured with static users.
Configure {link-oidc-issuer} to use GitHub authentication.

.Prerequisites

* {prod-short} is installed on Minikube. See xref:installation-guide:installing-che-on-minikube.adoc[].


.Procedure
. Get Minikube IP and remember it as `_<minikube_ip>_`:
+
----
$ minikube ip
----

. link:https://github.com/settings/applications/new[Create an OAuth App] for your Minikube instance in GitHub. See link:https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app[GitHub documentation].
+
[source]
themr0c marked this conversation as resolved.
Show resolved Hide resolved
----
Application name: Eclipse Che <1>
themr0c marked this conversation as resolved.
Show resolved Hide resolved
themr0c marked this conversation as resolved.
Show resolved Hide resolved
Homepage URL: https://<minikube_ip>.nip.io <2>
Authorization callback URL: https://dex.<minikube_ip>.nip.io/callback <3>
----
+
<1> Name is only displayed on GitHub. It is not used internally so it can be any name.
<2> Main URL to Che instance.
sparkoo marked this conversation as resolved.
Show resolved Hide resolved
<3> Callback URL to Dex. Chectl deploys Dex on `dex.` subdomain.
sparkoo marked this conversation as resolved.
Show resolved Hide resolved


. In the GitHub OAuth application page, click btn:[Generate a new client secret] and remember the value of the generated client secret as `_<client_secret>_`.

. Edit the {link-oidc-issuer} config map:
+
----
$ kubectl edit configmap dex -n dex
----
+
[source,yaml,subs="+attributes,macros,quotes"]
----
connectors:
- type: github
id: github
name: GitHub
config:
clientID: _<client_id>_ <1>
clientSecret: _<client_secret>_ <2>
redirectURI: https://dex._<minikube_ip>_.nip.io/callback <3>
----
+
<1> OAuth client id copied from GitHub OAuth application
<2> OAuth client secret, generated at GitHub in previous step
<3> Callback URL to Dex. This must match configuration in GitHub OAuth application from step 1.

Note: To remove Dex static users, delete all `enablePasswordDB` and `staticPasswords` sections.

. Restart the {link-oidc-issuer} pod:
+
----
$ kubectl delete pod dex -n dex
----

.Verification steps

* Open {prod-short} URL. The dashboard displays GitHub login prompt.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[id="enabling-dev-workspace-operator_{context}"]
= Enabling {devworkspace} operator

This procedure describes how to enable the {devworkspace} operator to support the Devfile 2.0.0 file format and mentions how to do so on existing instances or those about to be installed.
This procedure describes how to enable the {devworkspace} operator to support the Devfile v2 file format and mentions how to do so on existing instances or those about to be installed.

.Prerequisites

Expand Down Expand Up @@ -32,18 +32,25 @@ spec:
+
[subs="+quotes,+attributes"]
----
$ {prod-cli} server:deploy --che-operator-cr-patch-yaml=patch.yaml ...
$ {prod-cli} server:deploy --workspace-engine=dev-workspace ...
Copy link
Contributor

Choose a reason for hiding this comment

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

if it's merged into 7.42 this flag won't be needed as devWorkspace will be the default

Copy link
Member Author

Choose a reason for hiding this comment

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

does it break anything? tbh I'm not sure about the release process so I don't know where exactly this will land if I merge today.

----
+
`patch.yaml` must contain the following:
+

ifeval::["{project-context}" == "che"]
[WARNING]
====
{prod-cli} will automatically setup Dex as OIDC provider on Minikube. For other {kubernetes} clusters setup link:https://kubernetes.io/docs/reference/access-authn-authz/authentication/#configuring-the-api-server[{kubernetes} OIDC] provider following cluster provider documentation and set the following values in {prod-checluster} Custom Resource (CR):
sparkoo marked this conversation as resolved.
Show resolved Hide resolved

[source,yaml,subs="+quotes"]
----
spec:
devWorkspace:
enable: true
auth:
identityProviderURL: '__<oidc_url>__' <1>
----

<1> URL to OIDC provider.
sparkoo marked this conversation as resolved.
Show resolved Hide resolved
====
endif::[]

* For already existing {prod-short} installation:
+
. Update `{prod-checluster}` CR using the `{orch-cli}` tool:
Expand Down