MYS8-00-005100 - If passwords are used for authentication, the MySQL Database Server 8.0 must store only hashed, salted representations of passwords.

Information

The DOD standard for authentication is DOD-approved PKI certificates.

Authentication based on User ID and Password may be used only when it is not possible to employ a PKI certificate, and requires Authorizing Official (AO) approval.

In such cases, database passwords stored in clear text, using reversible encryption, or using unsalted hashes would be vulnerable to unauthorized disclosure. Database passwords must always be in the form of one-way, salted hashes when stored internally or externally to the Database Management System (DBMS).

To prevent the compromise of authentication information, such as passwords and PINs, during the authentication process, the feedback from the information system must not provide any information that would allow an unauthorized user to compromise the authentication mechanism.

Obfuscation of user-provided information when typed into the system is a method used in addressing this risk.

For example, displaying asterisks when a user types in a password or PIN, is an example of obscuring feedback of authentication information.

The password requirement is applicable when caching_sha2_password, sha2_password, native_mysql, or LDAP user/password authentication is enabled. When this is the case, password-authenticated accounts can be created in, and authenticated by, the MySQL Server. Other STIG requirements prohibit the use of password-based authentication except when justified and approved. This deals with the exceptions.

The mysql, mysqlsh, and other command line tools are part of most MySQL installations. These tools can accept a plain-text password, but do offer alternative techniques. Since the typical user of these tools is a Database Administrator (DBA), the consequences of password compromise are particularly serious. Therefore, the use of plain-text passwords must be prohibited as a matter of practice and procedure.

Solution

Develop, document, and maintain a list of DBMS database objects, database configuration files, associated scripts, and applications defined within or external to the DBMS that access the database, and DBMS/user environment files/settings in the System Security Plan.

Record whether they do or do not contain DBMS passwords. If passwords are present, ensure they are encoded or encrypted and protected by host system security.

Where possible, alter the authentication mode to X509 or LDAP SASL/Kerberos:
Just X509 certificate - for example
ALTER USER 'jeffrey'@'localhost' REQUIRE X509;

Specific X509 example:
ALTER USER 'jeffrey'@'localhost'
REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/
O=MySQL demo client certificate/
CN=client/[email protected]'
AND ISSUER '/C=SE/ST=Stockholm/L=Stockholm/
O=MySQL/CN=CA/[email protected]'
AND CIPHER 'EDH-RSA-DES-CBC3-SHA';

LDAP SASL example:
CREATE USER 'boris'@'localhost'
IDENTIFIED WITH authentication_ldap_sasl
AS 'uid=boris_ldap,ou=People,dc=example,dc=com';

If password authentication is necessary, then for mysql and mysqlsh command lines which cannot be configured not to accept a plain-text password when mixed-mode authentication is enabled, and any other essential tool with the same limitation:
1) Document the need for it, who uses it, any relevant mitigations, and obtain AO approval.
2) Train all users of the tool in the importance of not using the plain-text password option and in how to keep the password hidden.

See Also

https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_Oracle_MySQL_8-0_V2R2_STIG.zip

Item Details

Category: IDENTIFICATION AND AUTHENTICATION

References: 800-53|IA-5(1)(c), CAT|II, CCI|CCI-000196, CCI|CCI-004062, Rule-ID|SV-235138r1018613_rule, STIG-ID|MYS8-00-005100, Vuln-ID|V-235138

Plugin: MySQLDB

Control ID: 6f74fe4a057447ab46f6da8afd6a059f271d8430c0fd327f6d84cfd41bf131bf