Day 2
Rotate BMC credentials
Stop the use of the factory password, and change the operator's BMC password on a schedule.
Before you start
Section titled “Before you start”- The endpoints are
Verified. The operator writes nothing to a machine that it did not verify. - The factory credentials in the Asset
credentialsRefwork. The operator uses them to make its own account. - This change does not disturb the machine. It needs no approval.
How it works
Section titled “How it works”- The operator makes its own account on the BMC, with the role Administrator.
- It keeps the password in the Secret
endpoint-creds-<endpoint>inpk-metal. - For a rotation, it writes the new password next to the working one, as
next-usernameandnext-password. - It sets the new password on the BMC and logs in with it.
- Only after a good login, it replaces the working password.
- If the profile names a new username, the operator disables the old account after the new one logs in.
The Audit trail records each change with the event bmc.account.set or bmc.account.disabled. It never records a password.
The factory account stays as it is. It is the way back in.
-
Write an EndpointProfile with a
credentialsblock.maxAgesets the schedule.managed-bmcs.yaml apiVersion: metal.platform-kit.org/v1alpha1kind: EndpointProfilemetadata:name: managed-bmcsspec:match:matchLabels:metal.platform-kit.org/vlan: "100"credentials:username: pk-metalmaxAge: 2160h -
Apply it.
Terminal window kubectl apply -f managed-bmcs.yaml -
Monitor the endpoints.
Terminal window kubectl get managementendpointsThe phase goes through
ConfiguringtoReady.
Verify
Section titled “Verify”kubectl describe managementendpoint sim-0001 shows Configured=True.
If it fails
Section titled “If it fails”Reason on Configured |
Fix |
|---|---|
RotationFailed |
The BMC refused the new password. The working password stays. Read the message for the password rules of the BMC. |
AccountRetireFailed |
The BMC did not disable the account that a new username replaced. The old account can still log in. The operator tries again on each pass. Disable the account on the BMC console if it stays. |
AwaitingVerification |
The endpoint is not Verified. See Host in Mismatch. |
NTPFailed |
The operator could not write the ntp block of the profile. |
Change the factory password
Section titled “Change the factory password”The operator does not change the factory account. Its password is often on a label on the server, and in the records of the sale. Change it to a break-glass value that only your site holds. Do this for each BMC after the operator manages its own account.
-
Make a new password. Store it in your site's password store, not in the cluster.
-
Set it on the BMC console or with Redfish, as the factory user. For example:
Terminal window curl --cacert bmc-ca.crt -u admin -X PATCH \-H 'Content-Type: application/json' -H 'If-Match: *' \-d '{"Password": "<the new password>"}' \https://192.0.2.21/redfish/v1/AccountService/Accounts/2The account number differs per vendor. Read
/redfish/v1/AccountService/Accountsto find it. -
Do not update the Secret that the Asset
credentialsRefnames. Then the operator does not hold the break-glass password. It works through its managed account. While the managed password works, it needs no factory login.
Related
Section titled “Related”- EndpointProfile, Endpoint convergence controller
- Credential rotation
- Rotate cluster credentials is for the Talos and Kubernetes credentials.