Skip to content

Day 2

Rotate BMC credentials

Stop the use of the factory password, and change the operator's BMC password on a schedule.

  • The endpoints are Verified. The operator writes nothing to a machine that it did not verify.
  • The factory credentials in the Asset credentialsRef work. The operator uses them to make its own account.
  • This change does not disturb the machine. It needs no approval.
  1. The operator makes its own account on the BMC, with the role Administrator.
  2. It keeps the password in the Secret endpoint-creds-<endpoint> in pk-metal.
  3. For a rotation, it writes the new password next to the working one, as next-username and next-password.
  4. It sets the new password on the BMC and logs in with it.
  5. Only after a good login, it replaces the working password.
  6. 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.

  1. Write an EndpointProfile with a credentials block. maxAge sets the schedule.

    managed-bmcs.yaml
    apiVersion: metal.platform-kit.org/v1alpha1
    kind: EndpointProfile
    metadata:
    name: managed-bmcs
    spec:
    match:
    matchLabels:
    metal.platform-kit.org/vlan: "100"
    credentials:
    username: pk-metal
    maxAge: 2160h
  2. Apply it.

    Terminal window
    kubectl apply -f managed-bmcs.yaml
  3. Monitor the endpoints.

    Terminal window
    kubectl get managementendpoints

    The phase goes through Configuring to Ready.

kubectl describe managementendpoint sim-0001 shows Configured=True.

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.

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.

  1. Make a new password. Store it in your site's password store, not in the cluster.

  2. 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/2

    The account number differs per vendor. Read /redfish/v1/AccountService/Accounts to find it.

  3. Do not update the Secret that the Asset credentialsRef names. 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.