mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-05-17 18:37:03 +00:00
Merge pull request #468 from rancher/release/v2.6.11
Release/v2.6.11 to main
This commit is contained in:
+59
-57
@@ -2,13 +2,15 @@
|
||||
title: Configure Azure AD
|
||||
---
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="Rancher v2.6.7">
|
||||
<Tabs>
|
||||
<TabItem value="Rancher v2.6.7+">
|
||||
|
||||
## Microsoft Graph API
|
||||
|
||||
Microsoft Graph API is now the flow through which you will set up Azure AD. The below sections will assist [new users](#new-user-setup) in configuring Azure AD with a new instance as well as assist existing Azure app owners in [migrating to the new flow](#migrating-from-azure-ad-graph-api-to-microsoft-graph-api).
|
||||
|
||||
The Microsoft Graph API flow in Rancher is constantly evolving. We recommend that you use the latest patched version of 2.6, as it is still in active development and will continue to receive new features and improvements.
|
||||
|
||||
### New User Setup
|
||||
|
||||
If you have an instance of Active Directory (AD) hosted in Azure, you can configure Rancher to allow your users to log in using their AD accounts. Configuration of Azure AD external authentication requires you to make configurations in both Azure and Rancher.
|
||||
@@ -26,7 +28,7 @@ Configuring Rancher to allow your users to authenticate with their Azure AD acco
|
||||
|
||||
:::tip
|
||||
|
||||
Before you start, we recommend creating an empty text file. You can use this file to copy values from Azure that you'll paste into Rancher later.
|
||||
Before you start, open two browser tabs: one for Rancher, and one for the Azure portal. This will help with copying and pasting configuration values from the portal to Rancher.
|
||||
|
||||
:::
|
||||
|
||||
@@ -39,9 +41,7 @@ Before enabling Azure AD within Rancher, you must register Rancher with Azure.
|
||||
|
||||
1. Use search to open the **App registrations** service.
|
||||
|
||||

|
||||
|
||||
1. Click **New registrations** and complete the **Create** form.
|
||||
1. Click **New registration** and complete the form.
|
||||
|
||||

|
||||
|
||||
@@ -80,20 +80,17 @@ From the Azure portal, create a client secret. Rancher will use this key to auth
|
||||
|
||||

|
||||
|
||||
1. From the navigation pane on left, click **Certificates and Secrets**.
|
||||
1. From the navigation pane, click **Certificates & secrets**.
|
||||
|
||||
1. Click **New client secret**.
|
||||

|
||||
1. Enter a **Description** (something like `Rancher`).
|
||||
1. Select duration for the key from the options under **Expires**. This drop-down sets the expiration date for the key. Shorter durations are more secure, but require you to create a new key after expiration.
|
||||
1. Select the duration from the options under **Expires**. This drop-down menu sets the expiration date for the key. Shorter durations are more secure, but require you to create a new key more frequently.
|
||||
Note that users won't be able to log in to Rancher if it detects that the application secret has expired. To avoid this problem, rotate the secret in Azure and update it in Rancher before it expires.
|
||||
1. Click **Add** (you don't need to enter a value—it will automatically populate after you save).
|
||||
<a id="secret"></a>
|
||||
|
||||
1. Copy the key value and save it to an [empty text file](#tip).
|
||||
|
||||
You'll enter this key into the Rancher UI later as your **Application Secret**.
|
||||
|
||||
You won't be able to access the key value again within the Azure UI.
|
||||
1. You'll enter this key into the Rancher UI later as your **Application Secret**. Since you won't be able to access the key value again within the Azure UI, keep this window open for the rest of the setup process.
|
||||
|
||||
#### 3. Set Required Permissions for Rancher
|
||||
|
||||
@@ -101,71 +98,69 @@ Next, set API permissions for Rancher within Azure.
|
||||
|
||||
:::caution
|
||||
|
||||
Ensure that you set the permissions of type Application and NOT Delegated. Otherwise, you may not be able to login to Azure AD. This issue will persist even after you disable/re-enable Azure AD and will require an hour wait, or manual deletion of a cache value to resolve.
|
||||
Ensure that you set Application permissions, and *not* Delegated permissions. Otherwise, you won't be able to login to Azure AD.
|
||||
|
||||
:::
|
||||
|
||||
1. From the navigation pane on left, select **API permissions**.
|
||||
|
||||

|
||||
1. From the navigation pane on, select **API permissions**.
|
||||
|
||||
1. Click **Add a permission**.
|
||||
|
||||
1. From the **Microsoft Graph**, select the following **Application Permissions**:
|
||||
- `Group.Read.All`
|
||||
- `User.Read.All`
|
||||
1. From the Microsoft Graph API, select the following **Application Permissions**: `Directory.Read.All`
|
||||
|
||||

|
||||

|
||||
|
||||
1. Return to **API permissions** in the left nav bar. From there, click **Grant admin consent**. Then click **Yes**.
|
||||
:::note
|
||||
|
||||
:::note
|
||||
In Rancher versions 2.6.7-2.6.10, you'll need to use `User.Read.All` and `Group.Read.All` for permissions. This was changed to allow for lower-scoped permissions (such as `Directory.Read.All`) in v2.6.11.
|
||||
|
||||
You must be signed in as an Azure administrator to successfully save your permission settings.
|
||||
:::
|
||||
|
||||
:::
|
||||
1. Return to **API permissions** in the nav bar. From there, click **Grant admin consent**. Then click **Yes**. The app's permissions should look like the following:
|
||||
|
||||

|
||||
|
||||
:::note
|
||||
|
||||
Rancher doesn't validate the permissions you grant to the app in Azure. We only support the use of the `Directory.Read.All` application permission.
|
||||
|
||||
:::
|
||||
|
||||
#### 4. Copy Azure Application Data
|
||||
|
||||

|
||||
|
||||
1. Obtain your Rancher **Tenant ID**.
|
||||
|
||||
1. Use search to open **App registrations**.
|
||||
|
||||

|
||||
|
||||
1. Find the entry you created for Rancher.
|
||||
|
||||
1. Copy the **Directory ID** and paste it into your [text file](#tip).
|
||||
|
||||

|
||||
|
||||
- You'll paste this value into Rancher as your **Tenant ID**.
|
||||
1. Copy the **Directory ID** and paste it into Rancher as your **Tenant ID**.
|
||||
|
||||
1. Obtain your Rancher **Application (Client) ID**.
|
||||
|
||||
2.1. Use search to open **App registrations** (if not already there).
|
||||
1. If you aren't already there, use search to open **App registrations**.
|
||||
|
||||
2.2. In **Overview**, find the entry you created for Rancher.
|
||||
1. In **Overview**, find the entry you created for Rancher.
|
||||
|
||||
2.3. Copy the **Application (Client) ID** and paste it to your [text file](#tip).
|
||||
1. Copy the **Application (Client) ID** and paste it into Rancher as your **Application ID**.
|
||||
|
||||

|
||||
|
||||
1. Your endpoint options will typically be [Standard](#global) and [China](#china). With these options, you need only enter the **Tenant ID**, **Application ID**, and **Application Secret** (Rancher will take care of the rest).
|
||||
1. In most cases, your endpoint options will either be [Standard](#global) or [China](#china). For either of these options, you only need to enter the **Tenant ID**, **Application ID**, and **Application Secret**.
|
||||
|
||||

|
||||
|
||||
**For Custom Endpoints:**
|
||||
|
||||
**Warning:** Custom Endpoints are not supported nor fully tested by Rancher.
|
||||
**Warning:** Custom Endpoints are not tested or fully supported by Rancher.
|
||||
|
||||
You will need to also manually enter the Graph, Token, and Auth Endpoints.
|
||||
You'll also need to manually enter the Graph, Token, and Auth Endpoints.
|
||||
|
||||
- From <b>App registrations</b>, click <b>Endpoints</b>:
|
||||
|
||||

|
||||
|
||||
- Copy the following endpoints to your clipboard and paste them into your [text file](#tip) (these values will be your Rancher endpoint values). Make sure to copy the v1 version of the endpoints.
|
||||
- The following endpoints will be your Rancher endpoint values. Make sure to use the v1 version of these endpoints:
|
||||
- **Microsoft Graph API endpoint** (Graph Endpoint)
|
||||
- **OAuth 2.0 token endpoint (v1)** (Token Endpoint)
|
||||
- **OAuth 2.0 authorization endpoint (v1)** (Auth Endpoint)
|
||||
@@ -176,7 +171,7 @@ From the Rancher UI, enter information about your AD instance hosted in Azure to
|
||||
|
||||
1. Log into Rancher.
|
||||
|
||||
1. In the top left corner, click **☰ > Users & Authentication**.
|
||||
1. In the top left corner, click **☰ > Users & Authentication**.
|
||||
|
||||
1. In the left navigation menu, click **Auth Provider**.
|
||||
|
||||
@@ -184,14 +179,14 @@ From the Rancher UI, enter information about your AD instance hosted in Azure to
|
||||
|
||||
1. Complete the **Configure Azure AD Account** form using the information you copied while completing [Copy Azure Application Data](#4-copy-azure-application-data).
|
||||
|
||||
:::caution
|
||||
|
||||
:::caution
|
||||
|
||||
The Azure AD account will be granted administrator privileges, since its details will be mapped to the Rancher local principal account. Make sure that this level of privilege is appropriate before you continue.
|
||||
|
||||
|
||||
:::
|
||||
|
||||
**For Standard or China Endpoints:**
|
||||
|
||||
|
||||
The following table maps the values you copied in the Azure portal to the fields in Rancher:
|
||||
|
||||
| Rancher Field | Azure Value |
|
||||
@@ -222,14 +217,19 @@ From the Rancher UI, enter information about your AD instance hosted in Azure to
|
||||
|
||||
### Migrating from Azure AD Graph API to Microsoft Graph API
|
||||
|
||||
Since [Azure AD Graph API](https://docs.microsoft.com/en-us/graph/migrate-azure-ad-graph-overview) was deprecated in June 2022 and will be retired at the end of 2022, users should update their Azure AD App to use the new [Microsoft Graph API](https://docs.microsoft.com/en-us/graph/use-the-api) in Rancher.
|
||||
Since the [Azure AD Graph API](https://docs.microsoft.com/en-us/graph/migrate-azure-ad-graph-overview) is deprecated and slated to retire in June 2023, admins should update their Azure AD App to use the [Microsoft Graph API](https://docs.microsoft.com/en-us/graph/use-the-api) in Rancher.
|
||||
This needs to be done well in advance of the endpoint being retired.
|
||||
If Rancher is still configured to use the Azure AD Graph API when it is retired, users may not be able to log into Rancher using Azure AD.
|
||||
|
||||
#### Updating Endpoints in the Rancher UI
|
||||
|
||||
>**Important:** Admins should create a [backup](../../../new-user-guides/backup-restore-and-disaster-recovery/back-up-rancher.md) right before they commit to the endpoint migration in Step 4 below.
|
||||
:::caution
|
||||
|
||||
1. Update the permissions of your Azure AD app registration as described [here](#3-set-required-permissions-for-rancher).
|
||||
**This is critical.**
|
||||
Admins should create a [Rancher backup](../../../new-user-guides/backup-restore-and-disaster-recovery/back-up-rancher.md) before they commit to the endpoint migration described below.
|
||||
|
||||
:::
|
||||
|
||||
1. [Update](#3-set-required-permissions-for-rancher) the permissions of your Azure AD app registration. This is critical.
|
||||
|
||||
1. Log into Rancher.
|
||||
|
||||
@@ -261,7 +261,11 @@ If you need to roll back your migration, please note the following:
|
||||
|
||||
1. Azure app owners who want to rotate the Application Secret will need to also rotate it in Rancher as Rancher does not automatically update the Application Secret when it is changed in Azure. In Rancher, note that it is stored in a Kubernetes secret called `azureadconfig-applicationsecret` which is in the `cattle-global-data` namespace.
|
||||
|
||||
1. **Caution:** If admins upgrade to Rancher v2.6.7 with an existing Azure AD setup and choose to disable the auth provider, they won't be able to restore the previous setup and also will not be able to set up Azure AD anew using the old flow. Admins will then need to register again with the new auth flow. Rancher now uses the new Graph API and, therefore, users need set up the [proper permissions in the Azure portal](#3-set-required-permissions-for-rancher).
|
||||
:::caution
|
||||
|
||||
If you upgrade to Rancher v2.6.7+ with an existing Azure AD setup, and choose to disable the auth provider, you won't be able to restore the previous setup. You also won't be able to set up Azure AD anew using the old flow. You'll need to re-register with the new auth flow. Since Rancher now uses the Graph API, users need set up the [proper permissions in the Azure portal](#3-set-required-permissions-for-rancher).
|
||||
|
||||
:::
|
||||
|
||||
#### Global:
|
||||
|
||||
@@ -271,7 +275,6 @@ Auth Endpoint | https://login.microsoftonline.com/{tenantID}/oauth2/authorize
|
||||
Endpoint | https://login.microsoftonline.com/
|
||||
Graph Endpoint | https://graph.windows.net/
|
||||
Token Endpoint | https://login.microsoftonline.com/{tenantID}/oauth2/token
|
||||
---
|
||||
|
||||
Rancher Field | New Endpoints
|
||||
---------------- | ------------------------------------------------------------------
|
||||
@@ -288,7 +291,6 @@ Auth Endpoint | https://login.chinacloudapi.cn/{tenantID}/oauth2/authorize
|
||||
Endpoint | https://login.chinacloudapi.cn/
|
||||
Graph Endpoint | https://graph.chinacloudapi.cn/
|
||||
Token Endpoint | https://login.chinacloudapi.cn/{tenantID}/oauth2/token
|
||||
---
|
||||
|
||||
Rancher Field | New Endpoints
|
||||
---------------- | -------------------------------------------------------------------------
|
||||
@@ -301,17 +303,17 @@ Token Endpoint | https://login.partner.microsoftonline.cn/{tenantID}/oauth2/v2
|
||||
</TabItem>
|
||||
<TabItem value="Rancher v2.6.0 - v2.6.6">
|
||||
|
||||
## Azure AD Graph API
|
||||
## Deprecated Azure AD Graph API
|
||||
|
||||
>**Important:**
|
||||
>
|
||||
>- The [Azure AD Graph API](https://docs.microsoft.com/en-us/graph/migrate-azure-ad-graph-overview) was deprecated in June 2022 and will be retired at the end of 2022. We will update our docs to advise the community when it is retired. Rancher now uses the [Microsoft Graph API](https://docs.microsoft.com/en-us/graph/use-the-api) as the new flow to set up Azure AD as the external auth provider.
|
||||
>- The [Azure AD Graph API](https://docs.microsoft.com/en-us/graph/migrate-azure-ad-graph-overview) is deprecated and will be retired by Microsoft at any time after June 30, 2023, without advance notice. We will update our docs to advise the community when it is retired. Rancher now uses the [Microsoft Graph API](https://docs.microsoft.com/en-us/graph/use-the-api) as the new flow to set up Azure AD as the external auth provider.
|
||||
>
|
||||
>
|
||||
>- For new users, or existing users who wish to migrate, refer to the new flow instructions on the <a href="#microsoft-graph-api/" target="_blank">Rancher v2.6.7</a> tab.
|
||||
>- If you're a new user, or wish to migrate, refer to the new flow instructions for <a href="#microsoft-graph-api/" target="_blank">Rancher v2.6.7+</a>.
|
||||
>
|
||||
>
|
||||
>- For existing users who do not wish to upgrade to v2.6.7 after the Azure AD Graph API is retired, they will need to either:
|
||||
>- If you don't wish to upgrade to v2.6.7+ after the Azure AD Graph API is retired, you'll need to either:
|
||||
- Use the built-in Rancher auth or
|
||||
- Use another third-party auth system and set that up in Rancher. Please see the [authentication docs](../../../../pages-for-subheaders/authentication-config.md) to learn how to configure other open authentication providers.
|
||||
|
||||
|
||||
@@ -109,3 +109,28 @@ If you need to reconfigure or disable then re-enable a provider that had been pr
|
||||
is logged in to Rancher as an external user, not the local admin.
|
||||
|
||||
:::
|
||||
|
||||
## Disabling An Auth Provider
|
||||
|
||||
When you disable an auth provider, Rancher deletes all resources associated with it, such as:
|
||||
- Secrets
|
||||
- Global role bindings
|
||||
- Cluster role template bindings
|
||||
- Project role template bindings
|
||||
- External users associated with the provider, who never logged in as local users to Rancher
|
||||
|
||||
As this operation may lead to a loss of many resources, you may want to add a safeguard on the provider.
|
||||
To ensure this cleanup process doesn't run when the auth provider is disabled, add a special annoation to the corresponding auth config.
|
||||
|
||||
For example, to add a safeguard to the Azure AD provider, annotate the `azuread` authconfig object:
|
||||
|
||||
`kubectl annotate --overwrite authconfig azuread management.cattle.io/auth-provider-cleanup='user-locked'`
|
||||
|
||||
Rancher won't perform cleanup until you set the annotation to `unlocked`.
|
||||
|
||||
### Running Resource Cleanup Manually
|
||||
|
||||
Rancher might retain resources from a previously disabled auth provider configuration in the local cluster, even after you configure another auth provider. For example, if you used Provider A, then disabled it and started using Provider B, when you upgrade to a new version of Rancher, you can manually trigger cleanup on resources configured by Provider A.
|
||||
|
||||
To manually trigger cleanup for a disabled auth provider, add the `management.cattle.io/auth-provider-cleanup` annotation with the `unlocked` value
|
||||
to its auth config.
|
||||
|
||||
Reference in New Issue
Block a user