7.1 Ensure your authentication_policy is Set to a Secure Option

Information

Define your authentication policy by setting the mysql system variable authentication_policy.

The default value of authentication_policy is '*,,'. This means that factor 1 is required in account definitions and can use any authentication plugin (with caching_sha2_password being the default), and that factors 2 and 3 are optional and each can use any authentication plugin.

Note theThe default_authentication_plugin was deprecated in MySQL 8.0.27, and removed from 8.4.

Use authentication_policy instead.The -default-authentication-plugin system variable governs two things:

- Authentication plugin used by a new user account if a plugin is not specified explicitly through CREATE USER statement
- Initial authentication data payload generated by server in case of a new connection.

Caching SHA-2 Authentication is the default in MySQL 8.4.

It provides stronger password protection than the prior Native Authentication and provides better performance than SHA2 Authentication. Alternatively, there are additional methods to securely connect using Lightweight Directory Access Protocol (LDAP) and Active Directory authentication.

MySQL Native Authentication relies on the Secure Hash Algorithm 1 (SHA1) algorithm and the National Institute of Standards and Technology (NIST) has suggested to stop using it.

The MySQL Native Authentication plugin leverages this weak hashing algorithm that can be quickly brute forced.

Solution

Assess the value of the system variable authentication_policy.If it is set to *,,This means the default policy is single factor using mysql caching_sha2

Determine if any users are using mysql_native_password.

select host, user, plugin from mysql.user;

Migrate these users from mysql_native_password.

ALTER USER user
IDENTIFIED WITH caching_sha2_password IDENTIFIED BY RANDOM PASSWORD PASSWORD EXPIRE;

Provide users the random password value through a secure mechanism - on next login they will be forced to change the password.

Set the policy to meet compliance requirements and to enhance security by defining specific authentication methods and the number of authentication factors required.

https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html#sysvar_authentication_policy

See Also

https://workbench.cisecurity.org/benchmarks/20915

Item Details

Category: IDENTIFICATION AND AUTHENTICATION, SYSTEM AND COMMUNICATIONS PROTECTION

References: 800-53|IA-5(1), 800-53|SC-28, 800-53|SC-28(1), CSCv7|16.4

Plugin: MySQLDB

Control ID: a5776f8b38a43daca13b9722f075d102e820863e04a2f5b683bc6dfc4b479631