Skip to content

Commit 8591385

Browse files
committed
first-commit
1 parent c2eb3a7 commit 8591385

11 files changed

+443
-41
lines changed

docs/admin/runai-setup/authentication/authentication-overview.md

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,65 @@
1-
## Authentication Overview
1+
# Authentication & Authorization
22

3-
To access Run:ai resources, you have to authenticate. The purpose of this document is to explain how authentication works at Run:ai.
43

5-
## Authentication Endpoints
4+
Run:ai Authentication & Authorization enables a streamlined experience for the user with precise controls covering the data each user can see and the actions each user can perform in the Run:ai platform.
65

7-
Generally speaking, there are two authentication endpoints:
6+
Authentication verifies user identity during login, and Authorization assigns the user with specific permissions according to the assigned access rules.
87

9-
* The Run:ai control plane.
10-
* Run:ai GPU clusters.
8+
Authenticated access is required to use all aspects of the Run:ai interfaces, including the Run:ai platform, the Run:ai Command Line Interface (CLI) and APIs.
119

12-
Both endpoints are accessible via APIs as well as a user interface.
10+
## **Authentication**
1311

12+
There are multiple methods to authenticate and access Run:ai.
1413

15-
## Identity Service
14+
### **Single Sign-On (SSO)**
1615

17-
Run:ai includes an internal identity service. The identity service ensures users are who they claim to be and gives them the right kind of access to Run:ai.
18-
19-
## Users
16+
Single Sign-On (SSO) is the preferred authentication method by large organizations, as it avoids the need to manage duplicate sets of user identities.
2017

21-
Out of the box, The Run:ai identity service provides a way to create users and associate them with access roles.
18+
Run:ai offers SSO integration, enabling users to utilize existing organizational credentials to access Run:ai without requiring dedicated credentials.
2219

23-
It is also possible to configure the Run:ai identity service to connect to a company directory using the SAML protocol. For more information see [single sign-on](sso.md).
20+
Run:ai supports three methods to setup SSO:
2421

25-
## Authentication Method
22+
* SAML
23+
* OpenID Connect (OIDC)
24+
* OpenShift
2625

27-
Both endpoints described above are protected via time-limited oauth2-like JWT authentication tokens.
26+
When using SSO, it is highly recommended to manage at least one local user, as a breakglass account (an emergency account), in case access to SSO is not possible.
2827

29-
There are two ways of getting a token:
28+
### **Username and password**
3029

31-
* Using a user/password combination.
32-
* Using [client applications](../../../developer/overview-developer.md) for API access.
30+
Username and password access can be used when SSO integration is not possible.
3331

32+
### **Secret key (for Application programmatic access)**
3433

35-
## Authentication Flows
34+
Secret is the authentication method for Applications. Applications use the Run:ai APIs to perform automated tasks including scripts and pipelines based on its assigned access rules.
3635

37-
### Run:ai control plane
36+
## **Authorization**
3837

39-
You can use the Run:ai user interface to provide user/password. These are validated against the identity service. Run:ai will return a token with the right access rights for continued operation.
38+
The Run:ai platform uses Role Base Access Control (RBAC) to manage authorization.
4039

41-
You can also use a client application to get a token and then connect directly to the [administration API endpoint](../../../developer/admin-rest-api/overview.md).
42-
### Run:ai GPU Clusters
40+
Once a user or an application is authenticated, they can perform actions according to their assigned access rules.
4341

44-
The Run:ai GPU cluster is a _Kubernetes_ cluster. All communication into Kubernetes flows through the [Kubernetes API server](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/){target=_blank}.
42+
### **Role Based Access Control (RBAC) in Run:ai**
4543

46-
To facilitate authentication via Run:ai the Kubernetes API server must be configured to use the Run:ai identity service to validate authentication tokens. For more information on how to configure the Kubernetes API server see _Kubernetes configuration_ under [researcher authentication](researcher-authentication.md#mandatory-kubernetes-configuration).
44+
While Kubernetes RBAC is limited to a single cluster, Run:ai expands the scope of Kubernetes RBAC, making it easy for administrators to manage access rules across multiple clusters.
4745

48-
## Inactivity timeout
46+
RBAC at Run:ai is configured using access rules.
4947

50-
:octicons-versions-24: Version 2.10 and later.
48+
An access rule is the assignment of a role to a subject in a scope: \<Subject\> is a \<Role\> in a \<Scope\>.
5149

52-
Run:ai session should timeout after 1 hour of inactivity.
50+
* **Subject**
51+
* A user, a group, or an application assigned with the role
52+
* **Role**
53+
* A set of permissions that can be assigned to subjects
54+
* A permission is a set of actions (view, edit, create and delete) over a Run:ai entity (e.g. projects, workloads, users)
55+
* For example, a role might allow a user to create and read Project, but not update or delete them
56+
* Roles at Run:ai are system defined and cannot be created, edited or deleted
57+
* **Scope**
58+
* A set of resources that are accessible to a subject for a specific role
59+
* A scope is a part of an organization that can be accessed based on assigned roles. Scopes include Projects, Departments, Clusters, Account (all clusters)
5360

54-
!!! Note
55-
Timeout settings are configured in minutes.
61+
An example of an access rule: **username@company.com** is a **Department admin** in **Department: A**
5662

57-
To configure the inactivity timeout:
58-
1. Open `Settings | General`.
59-
2. Set the inactivity timeout in minutes. (Default is 60)
63+
![](img/auth-rbac.png)
6064

61-
## See also
6265

63-
* To configure authentication for researchers [researcher authentication](researcher-authentication.md).
64-
* To configure single sign-on, see [single sign-on](sso.md).
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
Single Sign-On (SSO) is an authentication scheme, allowing users to log-in with a single pair of credentials to multiple, independent software systems.
2+
3+
This article explains the procedure to configure single sign-on to Run:ai using the OpenID Connect protocol.
4+
5+
## **Prerequisites**
6+
7+
Before starting, make sure you have the following available from your identity provider:
8+
9+
* Discovery URL \- the OpenID server where the content discovery information is published.
10+
* ClientID \- the ID used to identify the client with the Authorization Server.
11+
* Client Secret \- a secret password that only the Client and Authorization server know.
12+
* Optional: Scopes \- a set of user attributes to be used during authentication to authorize access to a user's details.
13+
14+
## **Setup**
15+
16+
Follow the steps below to setup SSO with OpenID Connect.
17+
18+
### **Adding the identity provider**
19+
20+
1. Go to **Tools & Settings****General**
21+
1. Open the Security section and click **\+IDENTITY PROVIDER**
22+
1. Select **Custom OpenID Connect**
23+
1. Enter the **Discovery URL**, **Client ID**, and **Client Secret**
24+
1. Copy the Redirect URL to be used in your identity provider
25+
1. Optional: Add the OIDC scopes
26+
1. Optional: Enter the user attributes and their value in the identity provider (see the user attributes table below)
27+
1. Click **SAVE**
28+
User attributes
29+
30+
| Attribute | Default value in Run:ai | Description |
31+
| :---- | :---- | :---- |
32+
| User role groups | GROUPS | If it exists in the IDP, it allows you to assign Run:ai role groups via the IDP. The IDP attribute must be a list of strings. |
33+
| Linux User ID | UID | If it exists in the IDP, it allows Researcher containers to start with the Linux User UID. Used to map access to network resources such as file systems to users. The IDP attribute must be of type integer. |
34+
| Linux Group ID | GID | If it exists in the IDP, it allows Researcher containers to start with the Linux Group GID. The IDP attribute must be of type integer. |
35+
| Supplementary Groups | SUPPLEMENTARYGROUPS | If it exists in the IDP, it allows Researcher containers to start with the relevant Linux supplementary groups. The IDP attribute must be a list of integers. |
36+
| Email | email | Defines the user attribute in the IDP holding the user's email address, which is the user identifier in Run:ai |
37+
| User first name | firstName | Used as the user’s first name appearing in the Run:ai user interface |
38+
| User last name | lastName | Used as the user’s last name appearing in the Run:ai user interface |
39+
40+
### **Testing the setup**
41+
42+
1. Log-in to the Run:ai platform as an admin
43+
1. Add Access Rules to an SSO user defined in the IDP
44+
1. Open the Run:ai platform in an incognito browser tab
45+
1. On the sign-in page click **CONTINUE WITH SSO.** You should be redirected to the identity provider sign in page
46+
1. In the identity provider sign-in page, log in with the SSO user who you granted with access rules
47+
1. If you are unsuccessful signing-in to the identity provider, follow the Troubleshooting section below
48+
49+
### **Troubleshooting**
50+
51+
If testing the setup was unsuccessful, try the different troubleshooting scenarios according to the error you received.
52+
53+
#### **Troubleshooting scenarios**
54+
55+
**Error:** “403 \- Sorry, we can’t let you see this page. Something about permissions…”
56+
57+
![](img/openid-403.png)
58+
59+
**Description:** The authenticated user is missing permissions
60+
__Mitigation__:
61+
- Validate either the user or its related group/s are assigned with access rules
62+
- Validate groups attribute is available in the configured OIDC Scopes
63+
- Validate the user’s groups attribute is mapped correctly
64+
65+
__Advanced:__
66+
- Open the Chrome DevTools: Right-click on page → Inspect → Console tab
67+
- Run the following command to retrieve the user’s token: `localStorage.token;`
68+
- Paste in [https://jwt.io](https://jwt.io/)
69+
- Under the Payload section validate the value of the user’s attributes
70+
71+
**Error:** “We’re having trouble identifying your account because your email is incorrect or can’t be found.”
72+
73+
![](img/openid-imageincorrect.png)
74+
75+
**Description:** Authentication failed because email attribute was not found.
76+
**Mitigation**:
77+
- Validate email attribute is available in the configured OIDC Scopes
78+
- Validate the user’s email attribute is mapped correctly
79+
80+
81+
**Error:** “Unexpected error when authenticating with identity provider”
82+
**Description:** User authentication failed
83+
**Mitigation**:
84+
Validate the configured OIDC Scopes exist and match the Identity Provider’s available scopes
85+
**Advanced:**
86+
Look for the specific error message in the URL address
87+
88+
89+
**Error:** “Unexpected error when authenticating with identity provider” (SSO sign-in is not available)
90+
![](img/openid-unexpected.png)
91+
92+
**Description:** User authentication failed
93+
**Mitigation**:
94+
- Validate the configured OIDC scope exists in the Identity Provider
95+
- Validate the configured Client Secret matchs the Client Secret in the Identity Provider
96+
**Advanced:**
97+
Look for the specific error message in the URL address
98+
99+
100+
**Error:** “Client not found”
101+
**Description:** OIDC Client ID was not found in the Identity Provider
102+
**Mitigation**:
103+
Validate the configured Client ID matches the Identity Provider Client ID
104+
105+
### **Editing the identity provider**
106+
107+
You can view the identity provider details and edit its configuration:
108+
109+
1. Go to **Tools & Settings****General**
110+
1. Open the Security section
111+
1. On the identity provider box, click **Edit identity provider**
112+
1. You can edit either the **Discovery URL**, **Client ID**, **Client Secret**, **OIDC scopes**, or the **User attributes**
113+
114+
### **Removing the identity provider**
115+
116+
You can remove the identity provider configuration:
117+
118+
1. Go to **Tools & Settings****General**
119+
1. Open the Security section
120+
1. On the identity provider card, click **Remove identity provider**
121+
1. In the dialog, click **REMOVE** to confirm the action
122+
123+
!!!Note
124+
To avoid losing access, removing the identity provider must be carried out by a local user.
125+
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
Single Sign-On (SSO) is an authentication scheme, allowing users to log-in with a single pair of credentials to multiple, independent software systems.
2+
3+
This article explains the procedure to configure single sign-on to Run:ai using the OpenID Connect protocol in OpenShift V4.
4+
5+
## **Prerequisites**
6+
7+
Before starting, make sure you have the following available from your OpenShift cluster:
8+
9+
* OpenShift OAuth client \- see [Registering an additional OAuth client](https://docs.openshift.com/container-platform/4.16/authentication/configuring-oauth-clients.html\#oauth-register-additional-client\_configuring-oauth-clients)
10+
* ClientID \- the ID used to identify the client with the Authorization Server.
11+
* Client Secret \- a secret password that only the Client and Authorization Server know.
12+
* Base URL \- the OpenShift API Server endpoint (example: [https://api.\<cluster-url\>:6443](https://api.noa-ocp.runailabs.com:6443/))
13+
14+
## **Setup**
15+
16+
Follow the steps below to setup SSO with OpenShift.
17+
18+
### **Adding the identity provider**
19+
20+
1. Go to **Tools & Settings****General**
21+
1. Open the Security section and click **\+IDENTITY PROVIDER**
22+
1. Select **OpenShift V4**
23+
1. Enter the **Base URL**, Client ID, and **Client Secret** from your OpenShift OAuth client.
24+
1. Copy the Redirect URL to be used in your OpenShift OAuth client
25+
1. Optional: Enter the user attributes and their value in the identity provider (see the user attributes table below)
26+
1. Click **SAVE**
27+
User attributes
28+
29+
| Attribute | Default value in Run:ai | Description |
30+
| :---- | :---- | :---- |
31+
| User role groups | GROUPS | If it exists in the IDP, it allows you to assign Run:ai role groups via the IDP. The IDP attribute must be a list of strings. |
32+
| Linux User ID | UID | If it exists in the IDP, it allows Researcher containers to start with the Linux User UID. Used to map access to network resources such as file systems to users. The IDP attribute must be of type integer. |
33+
| Linux Group ID | GID | If it exists in the IDP, it allows Researcher containers to start with the Linux Group GID. The IDP attribute must be of type integer. |
34+
| Supplementary Groups | SUPPLEMENTARYGROUPS | If it exists in the IDP, it allows Researcher containers to start with the relevant Linux supplementary groups. The IDP attribute must be a list of integers. |
35+
| Email | email | Defines the user attribute in the IDP holding the user's email address, which is the user identifier in Run:ai |
36+
| User first name | firstName | Used as the user’s first name appearing in the Run:ai user interface |
37+
| User last name | lastName | Used as the user’s last name appearing in the Run:ai user interface |
38+
39+
### **Testing the setup**
40+
41+
1. Open the Run:ai platform as an admin
42+
1. Add Access Rules to an SSO user defined in the IDP
43+
1. Open the Run:ai platform in an incognito browser tab
44+
1. On the sign-in page click **CONTINUE WITH SSO.** You are redirected to the OpenShift IDP sign-in page
45+
1. In the identity provider sign-in page, log-in with the SSO user who you granted with access rules.
46+
1. If you are unsuccessful signing-in to the identity provider, follow the Troubleshooting section below
47+
48+
### **Troubleshooting**
49+
50+
If testing the setup was unsuccessful, try the different troubleshooting scenarios according to the error you received.
51+
52+
#### **Troubleshooting scenarios**
53+
54+
**Error:** “403 \- Sorry, we can’t let you see this page. Something about permissions…”
55+
![](img/openid-403.png)
56+
57+
**Description:** The authenticated user is missing permissions
58+
**Mitigation**:
59+
- Validate either the user or its related group/s are assigned with access rules.
60+
- Validate groups attribute is available in the configured OIDC Scopes
61+
- Validate the user’s groups attribute is mapped correctly
62+
**Advanced:**
63+
- Open the Chrome DevTools: Right-click on page → Inspect → Console tab
64+
- Run the following command to retrieve the user’s token: `localStorage.token;`
65+
- Paste in [https://jwt.io](https://jwt.io/)
66+
- Under the Payload section validate the value of the user’s attributes
67+
68+
**Error:** “We’re having trouble identifying your account because your email is incorrect or can’t be found.”
69+
70+
![](img/openid-imageincorrect.png)
71+
72+
**Description:** Authentication failed because email attribute was not found.
73+
**Mitigation**:
74+
- Validate email attribute is available in the configured OIDC Scopes
75+
- Validate the user’s email attribute is mapped correctly
76+
77+
**Error:** “Unexpected error when authenticating with identity provider”
78+
79+
![](img/openshift-identityerror.png)
80+
81+
**Description:** User authentication failed
82+
**Mitigation**:
83+
Validate the configured OIDC Scopes exist and match the Identity Provider’s available scopes
84+
**Advanced:**
85+
Look for the specific error message in the URL address
86+
87+
88+
**Error:** “Unexpected error when authenticating with identity provider” (SSO sign-in is not available)
89+
90+
![](img/openshift-identityerror-ssonotavail.png)
91+
92+
**Description:** User authentication failed
93+
**Mitigation**:
94+
- Validate the configured OIDC scope exists in the Identity Provider
95+
- Validate the configured Client Secret match the Client Secret value in the OAuthclient Kubernetes object.
96+
**Advanced:**
97+
Look for the specific error message in the URL address
98+
99+
**Error:** “Client not found”
100+
<!-- TBD \- OpenShift screenshot -->
101+
**Description:** OIDC Client ID was not found in the OpenShift IDP
102+
**Mitigation**:
103+
Validate the configured Client ID matches the value in the OAuthclient Kubernetes object.
104+
105+
### **Editing the identity provider**
106+
107+
You can view the identity provider details and edit its configuration:
108+
109+
1. Go to **Tools & Settings****General**
110+
1. Open the Security section
111+
1. On the identity provider box, click **Edit identity provider**
112+
1. You can edit either the **Base URL**, **Client ID**, **Client Secret**, or the **User attributes**
113+
114+
### **Removing the identity provider**
115+
116+
You can remove the identity provider configuration:
117+
118+
1. Go to **Tools & Settings****General**
119+
1. Open the Security section
120+
1. On the identity provider card, click **Remove identity provider**
121+
1. In the dialog, click **REMOVE** to confirm the action
122+
123+
!!!Note
124+
To avoid losing access, removing the identity provider must be carried out by a local user.
125+

0 commit comments

Comments
 (0)