Rule ID
SV-289359r1319285_rule
Version
V1R1
CCIs
Users often choose passwords that are easy to remember but weak, predictable, or derived from common words and patterns. Automated password strength assistance reduces this risk by evaluating proposed passwords against defined policy and rejecting weak selections before they are accepted. In MySQL 9.x, the password validation component can test candidate passwords against configured strength requirements and dictionary content, and MySQL can also generate random passwords for internally managed accounts.
Review the system documentation to identify accounts that use passwords managed internally by MySQL and accounts whose passwords are managed by an external authentication system.
For accounts whose credentials are managed by an external authentication system such as Lightweight Directory Access Protocol (LDAP), Kerberos, or Pluggable Authentication Module (PAM), password strength assistance and password policy are provided by the external authentication system. Verify those accounts are documented as externally managed. This MySQL password validation check does not apply to those externally managed passwords.
For accounts using passwords managed internally by MySQL, verify that the MySQL password validation component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = 'file://component_validate_password';
Review the configured password-strength policy:
SHOW VARIABLES LIKE 'validate_password.%';
Verify that the settings comply with the organization-defined password policy.
MySQL automatically evaluates clear-text passwords supplied through "CREATE USER", "ALTER USER", and "SET PASSWORD" and rejects passwords that do not meet the configured policy.
Verify that MySQL can provide automated assistance in evaluating a proposed password using:
SELECT VALIDATE_PASSWORD_STRENGTH('<candidate_password>');
The function returns a value from "0" for a weak password through "100" for a strong password.
Perform a controlled test using an approved nonproduction account. Attempt to assign a password that does not meet the configured policy and verify that MySQL rejects it.
If locally managed MySQL passwords are used and the password validation component is not configured to provide automated password-strength evaluation and enforcement, this is a finding.Configure MySQL 9.x to use automated password strength assistance for password-based authentication. Install and enable the password validation component, then configure it with organization-approved values. At a minimum, enable automated checks for minimum length and username matching; where required, configure dictionary screening using an approved prohibited password file and "STRONG" policy. Example: INSTALL COMPONENT 'file://component_validate_password'; SET PERSIST validate_password.length = 14; SET PERSIST validate_password.check_user_name = ON; SET PERSIST validate_password.dictionary_file = '/path/to/approved/prohibited_passwords.txt'; SET PERSIST validate_password.policy = 'STRONG'; Where supported by operational procedures, use MySQL random password generation during account provisioning or password reset to assist in issuing strong temporary credentials: ALTER USER 'username'@'localhost' IDENTIFIED BY RANDOM PASSWORD PASSWORD EXPIRE;