-
Notifications
You must be signed in to change notification settings - Fork 5
CAST-38539: Warn and prompt in sat bmccreds for long passwords
#376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Here is a detailed description of my testing. These are the nodes on the system and the ones I chose for the test: Proving that I currently know the password and can use Setting the password to a short user-specified value: Now I can no longer use the old password: The new password works: Now if I try to set a too-long generated password: Trying to set a too-longer user-provided password: I think this behavior is going to depend on the Redfish implementation and the maximum length password it accepts. In this case, the Redfish implementation on the management node rejected it. The previously set password still works: Trying to set the password to something too long on only non-management (in this case, compute) nodes. Note the lack of the prompt because we do not necessarily need Trying with Trying with a password of exactly 20 characters: Now the previously set password does not work: And the new one does: Just for thoroughness, checking that passwords entered at a prompt are handled correctly as well: Cleaning up and setting it back to the starting value: |
Add logic to `sat bmccreds` to log a warning if the provided or generated password is longer than 20 characters. This is the maximum password length supported by `ipmitool`, which is required to control management nodes during system boot and shutdown procedures. The warning is logged whenever the password exceeds 20 characters. The user must answer the prompt if it is determined that the affected xnames include management node BMCs or if that can't be determined (i.e. if the HSM query fails, or `--no-hsm-check` is specified). Added unit tests for the new `validate_password_length` method. Test Description: Unit tests pass. Tested the following cases with `sat bmmcreds` on vinland: - User-specified password of an acceptable length against a compute and management node BMC - Too long generated password against a compute and management node BMC - Too long user-specified password against a compute and management node BMC - Too long user-specified password against only compute BMC - Exactly 20-character password against both BMCs - Too long password entered at the prompt against both BMCs
9c57b73 to
b55cf31
Compare
|
/backport release/3.36 |
|
Backporting into branch release/3.36 was successful. New PR: #377 |
Summary and Scope
Add logic to
sat bmccredsto log a warning if the provided orgenerated password is longer than 20 characters. This is the maximum
password length supported by
ipmitool, which is required to controlmanagement nodes during system boot and shutdown procedures.
The warning is logged whenever the password exceeds 20 characters. The
user must answer the prompt if it is determined that the affected xnames
include management node BMCs or if that can't be determined (i.e. if the
HSM query fails, or
--no-hsm-checkis specified).Added unit tests for the new
validate_password_lengthmethod.Issues and Related PRs
Testing
Tested on:
Test description:
Unit tests pass. Tested the following cases with
sat bmmcredsonvinland:
management node BMC
BMC
Risks and Mitigations
This is pretty low-risk as it is still possible to proceed with passwords longer
than 20 characters if the user really wants to. Such passwords would cause
problems during the system shutdown and boot procedures anyway, even if accepted
by the Redfish implementation on the system hardware.
Pull Request Checklist