|
| 1 | +<!-- vale off --> |
| 2 | +--- |
| 3 | +title: Disable the local admin account after SSO setup |
| 4 | +sidebar_label: Disable Local Admin |
| 5 | +sidebar_position: 6 |
| 6 | +description: Learn how to secure vCluster Platform by disabling the local admin account after configuring SSO authentication. |
| 7 | +--- |
| 8 | +<!-- vale on --> |
| 9 | + |
| 10 | +import Flow, { Step } from "@site/src/components/Flow"; |
| 11 | +import NavStep from "@site/src/components/NavStep"; |
| 12 | +import Label from "@site/src/components/Label"; |
| 13 | + |
| 14 | +<!-- vale off --> |
| 15 | +After configuring [single sign-on (SSO)](../configure/single-sign-on/overview.mdx) for vCluster Platform, disabling the local admin account is a recommended security practice for enterprise environments. This prevents unauthorized access through the default credentials and ensures all authentication flows through your identity provider. |
| 16 | +<!-- vale on --> |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +Before disabling the local admin account: |
| 21 | + |
| 22 | +- SSO is configured and tested successfully |
| 23 | +- At least one SSO user has global admin permissions |
| 24 | +- You have verified SSO login works with the expected permissions |
| 25 | +- You have kubectl access to the cluster running vCluster Platform |
| 26 | + |
| 27 | +:::warning Verify SSO access first |
| 28 | +Ensure you can log in via SSO with global admin permissions before disabling the local admin. Locking yourself out requires recovery steps. |
| 29 | +::: |
| 30 | + |
| 31 | +## Disable the admin account |
| 32 | + |
| 33 | +There are two steps to fully disable the local admin: |
| 34 | + |
| 35 | +1. Lock the admin user in the UI |
| 36 | +2. Prevent the admin from being recreated on upgrades |
| 37 | + |
| 38 | +### Lock the admin user |
| 39 | + |
| 40 | +<Flow id="lock-admin-user"> |
| 41 | + <Step> |
| 42 | + Log in to vCluster Platform using your SSO credentials with global admin permissions. |
| 43 | + </Step> |
| 44 | + <Step> |
| 45 | + Select the <NavStep>Users</NavStep> field on the left menu bar. |
| 46 | + </Step> |
| 47 | + <Step> |
| 48 | + In the admin user row, hover over the blue drop down arrow and select <Label>Lock User</Label> from the menu options. |
| 49 | + </Step> |
| 50 | +</Flow> |
| 51 | + |
| 52 | +The admin account is now locked. The user cannot log in and any access keys generated for the admin will stop working. |
| 53 | + |
| 54 | +### Prevent admin recreation |
| 55 | + |
| 56 | +To prevent the admin account from being recreated during upgrades, update your Helm values: |
| 57 | + |
| 58 | +```yaml title="vcluster-platform-values.yaml" |
| 59 | +admin: |
| 60 | + create: false |
| 61 | +``` |
| 62 | +
|
| 63 | +Apply the configuration: |
| 64 | +
|
| 65 | +```bash |
| 66 | +helm upgrade vcluster-platform loft/vcluster-platform \ |
| 67 | + --namespace vcluster-platform \ |
| 68 | + --values vcluster-platform-values.yaml \ |
| 69 | + --reuse-values |
| 70 | +``` |
| 71 | + |
| 72 | +:::note |
| 73 | +If you previously had admin credentials in your values file, remove them after locking the account. Leaving stale credentials in configuration files is a security risk. |
| 74 | +::: |
| 75 | + |
| 76 | +## Recovery |
| 77 | + |
| 78 | +If SSO becomes unavailable and you need to regain access: |
| 79 | + |
| 80 | +1. Re-enable password authentication if it was disabled. Run the following command to generate a new configuration with password login enabled: |
| 81 | + |
| 82 | + ```bash |
| 83 | + kubectl get secrets/loft-manager-config -n vcluster-platform \ |
| 84 | + -o jsonpath="{.data.config}" | base64 -d | \ |
| 85 | + yq "del(.auth.password.disabled)" | base64 |
| 86 | + ``` |
| 87 | + |
| 88 | + Copy the output, then edit the secret: |
| 89 | + |
| 90 | + ```bash |
| 91 | + kubectl edit secret loft-manager-config -n vcluster-platform |
| 92 | + ``` |
| 93 | + |
| 94 | + Replace `.data.config` with the new value and restart the vCluster Platform pods. |
| 95 | + |
| 96 | +<!-- vale off --> |
| 97 | +2. Reset the admin password using kubectl. See [Reset Admin Password](./reset-admin-password.mdx) for detailed instructions. |
| 98 | +<!-- vale on --> |
| 99 | + |
| 100 | +3. Unlock the admin user: |
| 101 | + - Log in with the reset password |
| 102 | + - Navigate to **Users** |
| 103 | + - Select **Unlock User** from the admin user's dropdown menu |
| 104 | + |
| 105 | +After regaining access, investigate the SSO issue, and fix it before re-locking the admin account. |
0 commit comments