<?xml version="1.0" encoding="UTF-8"?>
<CHECKLIST>
  <ASSET>
    <ROLE>None</ROLE>
    <ASSET_TYPE>Computing</ASSET_TYPE>
    <HOST_NAME></HOST_NAME>
    <HOST_IP></HOST_IP>
  </ASSET>
  <STIGS>
    <iSTIG>
      <STIG_INFO>
        <SI_DATA>
          <SID_NAME>title</SID_NAME>
          <SID_DATA>Oracle MySQL 9.x Security Technical Implementation Guide</SID_DATA>
        </SI_DATA>
        <SI_DATA>
          <SID_NAME>version</SID_NAME>
          <SID_DATA>1</SID_DATA>
        </SI_DATA>
        <SI_DATA>
          <SID_NAME>releaseinfo</SID_NAME>
          <SID_DATA>Release: 1</SID_DATA>
        </SI_DATA>
      </STIG_INFO>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289262</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289262r1319154_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>high</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>MySQL Database Server 9.x must integrate with an organization-level authentication/access mechanism providing account management and automation for all users, groups, roles, and any other principals.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Enterprise environments make account management for applications and databases challenging and complex. A manual process for account management functions adds the risk of a potential oversight or other error. Managing accounts for the same person in multiple places is inefficient and prone to problems with consistency and synchronization.

A comprehensive application account management process that includes automation helps to ensure accounts designated as requiring attention are consistently and promptly addressed. 

Examples include, but are not limited to, using automation to take action on multiple accounts designated as inactive, suspended, or terminated, or by disabling accounts located in noncentralized account stores, such as multiple servers. Account management functions can also include: assignment of group or role membership; identifying account type; specifying user access authorizations (i.e., privileges); account removal, update, or termination; and administrative alerts. The use of automated mechanisms can include, for example: using email or text messaging to notify account managers when users are terminated or transferred; using the information system to monitor account usage; and using automated telephone notification to report atypical system account usage.

The database management system (DBMS) must be configured to automatically use organization-level account management functions, and these functions must immediately enforce the organization&apos;s current account policy. 

Automation may comprise differing technologies that, when placed together, contain an overall mechanism supporting an organization&apos;s automated account management requirements.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Determine if an organization-level authentication/access mechanism providing account management and automation for all users, groups, roles, and any other principals has been configured.

To determine if a MySQL Server has any external authentication plugins, connect as a MySQL administrator (root) and run the following query:
SELECT PLUGIN_NAME, PLUGIN_STATUS
       FROM INFORMATION_SCHEMA.PLUGINS
       WHERE PLUGIN_NAME LIKE &apos;%ldap%&apos; OR PLUGIN_NAME LIKE &apos;%pam%&apos; OR PLUGIN_NAME LIKE &apos;%authentication_windows %&apos;;

One or more of the following plugins must be installed and in the listed results:
authentication_ldap_simple
authentication_ldap_sasl
authentication_pam
authentication_windows

If at least one of the above plugins is not installed, then no organization-level authentication/access is in place, and this is a finding.

Depending on the plugin in use, review its configuration.

For a list of global variables, run the following query:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME LIKE &apos;auth%&apos; ;

If the LDAP plugin is installed, check the &quot;ldap_host&quot; and mapping. 

For the LDAP plugin, global variables showing the configuration for authentication to ldap hosts and binding to organizational users should look similar to the following:
authentication_ldap_simple_server_host=127.0.0.1
authentication_ldap_simple_bind_base_dn=&quot;dc=example,dc=com&quot;
authentication_ldap_sasl_server_host=127.0.0.1
authentication_ldap_sasl_bind_base_dn=&quot;dc=example,dc=com&quot;

If the &quot;ldap_host&quot; is not a valid authentication host or the mapping to the &quot;base_dn&quot; maps is not correct, this is a finding.

Determine the accounts (SQL logins) managed by PAM. Run the statement: 
SELECT `user`.`Host`,
    `user`.`user`,
    `user`.`plugin`,
    `user`.`authentication_string`
    from mysql.user where plugin like &apos;authentication_pam&apos;;

For PAM, the string consists of a PAM service name, optionally followed by a PAM group mapping list consisting of one or more keyword/value pairs each specifying a PAM group name and a MySQL user name. 

If not defined, this is a finding.

If the windows plugin is installed, the organization mapping details will be defined within the user &quot;authentication string&quot;. 

Determine the accounts (SQL logins) managed by Windows. Run the statement: 
Review the accounts
SELECT `user`.`Host`,
    `user`.`user`,
    `user`.`plugin`,
    `user`.`authentication_string`
    from mysql.user where plugin like &apos;authentication_windows&apos;;

Verify that the Windows user, group, and windows role in the authentication_string map to proper organizational users. If not, this is a finding.

To determine the accounts (MySQL accounts) actually managed by MySQL Server, run the statement: 
SELECT `user`.`Host`,
    `user`.`User`,
    `user`.`plugin`,
    `user`.`authentication_string`
    from mysql.user where plugin not like &apos;auth%&apos; and `user`.`User` not like &apos;mysql.%&apos;;

If any accounts listed by the query are not listed in the documentation and authorized, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Integrate MySQL Database Server 9.x security with an organization-level authentication/access mechanism using MySQL external authentication for Microsoft Active Directory/LDAP or Linux PAM, as appropriate, to provide centralized account management for users, groups, roles, and other principals.

Before installing a MySQL LDAP authentication plugin, review the applicable MySQL LDAP pluggable authentication prerequisites and install the required operating system dependencies. Do not assume a specific operating system package name; required packages depend on the platform and selected authentication method.

Refer to https://dev.mysql.com/doc/refman/9.7/en/ldap-pluggable-authentication.html#ldap-pluggable-authentication-prerequisites.

Install the appropriate approved external authentication plugin. For example:
INSTALL PLUGIN authentication_ldap_sasl SONAME &apos;authentication_ldap_sasl.so&apos;;
INSTALL PLUGIN authentication_ldap_simple SONAME &apos;authentication_ldap_simple.so&apos;;

Configure the selected external authentication service and the required MySQL user/group mappings in accordance with the organization&apos;s identity management design.

If native MySQL accounts are required, document the need and approval, keep their use to a minimum, protect their credentials, and maintain an inventory of the locally managed accounts.

For each MySQL-managed account that is not documented and approved, transfer the account to the approved external authentication mechanism or remove the account, as appropriate.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289263</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289263r1319408_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>MySQL Database Server 9.x must limit the number of concurrent sessions to an organization-defined number per user for all accounts and/or account types.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Database management includes the ability to control the number of users and user sessions utilizing a database management system (DBMS). Unlimited concurrent connections to the DBMS could allow a successful Denial of Service (DoS) attack by exhausting connection resources; and a system can also fail or be degraded by an overload of legitimate users. Limiting the number of concurrent sessions per user is helpful in reducing these risks.

This requirement addresses concurrent session control for a single account. It does not address concurrent sessions by a single user via multiple system accounts; and it does not deal with the total number of sessions across all accounts.

The capability to limit the number of concurrent sessions per user must be configured in or added to the DBMS (for example, by use of a logon trigger), when this is technically feasible. Note that it is not sufficient to limit sessions via a web server or application server alone, because legitimate users and adversaries could connect to the DBMS by other means.

The organization must define the maximum number of concurrent sessions by account type, by account, or a combination thereof. In deciding on the appropriate number, it is important to consider the work requirements of the various types of users. For example, two might be an acceptable limit for general users accessing the database via an application; but ten might be too few for a database administrator using a database management GUI tool, where each query tab and navigation pane may count as a separate session.

(Sessions may also be referred to as connections or logons, which, for the purposes of this requirement, are synonyms.)</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Determine whether the system documentation specifies limits on the number of concurrent MySQL Database Server 9.x sessions.

Review the concurrent sessions settings in the MySQL database server and/or the applications using it, and/or the system software supporting it. 

MySQL global variable &quot;max_user_connections&quot; limits the number of simultaneous connections that can be made by any given account.

To check global (default) concurrent sessions settings in the MySQL database server, run the following query:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME LIKE &apos;max_user_connections&apos; ;

If the value of &quot;max_user_connections&quot; is &quot;0&quot; (unlimited), or greater than the site-specific maximum number of sessions, this is a finding.
 
Retrieve the settings for concurrent sessions for each user with the query: 
SELECT user, host, max_user_connections 
FROM mysql.user 
WHERE user not like &apos;mysql.%&apos; and user not like &apos;root&apos;;

If the user account has a &quot;nonzero max_user_connections&quot; resource limit, the &quot;session max_user_connections&quot; value is set to that limit. Otherwise, the &quot;session max_user_connections&quot; value is set to the global value.

If the DBMS settings for concurrent sessions for each user is greater than the site-specific maximum number of sessions and nonzero, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x is capable of enforcing this restriction. If it is not configured, configure it to do so.

Connect to the MySQL Database as an administrator. To set the global default to &quot;50&quot;: 
SET PERSIST max_user_connections=50;

Additionally, &quot;max_user_connections&quot; can be set per user, as well as for a given period of time:
GRANT ALL ON customer.* TO &apos;francis&apos;@&apos;localhost&apos;
WITH MAX_CONNECTIONS_PER_HOUR 5;
MAX_USER_CONNECTIONS 2;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289269</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289269r1318728_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must include additional, more detailed, organizationally defined information in the audit records for audit events identified by type, location, or subject.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Information system auditing capability is critical for accurate forensic analysis. Reconstruction of harmful events or forensic analysis is not possible if audit records do not contain enough information. To support analysis, some types of events will need information to be logged that exceeds the basic requirements of event type, time stamps, location, source, outcome, and user identity. If additional information is not available, it could negatively impact forensic investigations into user actions or other malicious events.

The organization must determine what additional information is required for complete analysis of the audited events. The additional information required is dependent on the type of information (e.g., sensitivity of the data and the environment within which it resides). At a minimum, the organization must employ either full-text recording of privileged commands or the individual identities of group users, or both. The organization must maintain audit trails in sufficient detail to reconstruct events to determine the cause and impact of compromise. 

Examples of detailed information the organization may require in audit records are full-text recording of privileged commands or the individual identities of group account users.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If a MySQL Server Audit is not in use for audit purposes, this is a finding unless a third-party product is being used that can perform detailed auditing for MySQL Server. 

Review system documentation to determine whether MySQL Server is required to audit any events and any fields, in addition to those in the standard audit. 

If there are none specified, this is not a finding. 

If MySQL Server Audit is in use, compare the audit specification(s) with the documented requirements. 

If any such requirement is not satisfied by the audit specification(s) (or by supplemental, locally-deployed mechanisms), this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Design and deploy an audit configuration that captures all auditable events and data items. 

Create rule:
SELECT audit_log_filter_set_filter(&apos;log_all&apos;, &apos;{ &quot;filter&quot;: { &quot;log&quot;: true } }&apos;);
SELECT audit_log_filter_set_user(&apos;%&apos;, &apos;log_all&apos;);

If a third-party tool is used for auditing, it must contain all the required information including, but not limited to, event, type, location, subject, date and time, and by whom the change occurred. 

Implement additional custom audits to capture additional information as required by the organization.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289271</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289271r1319160_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The audit information produced by the MySQL Database Server 9.x must be protected from unauthorized read access.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If audit data were to become compromised, then competent forensic analysis and discovery of the true source of potentially malicious system activity is difficult, if not impossible, to achieve. In addition, access to audit records provides information an attacker could use to their advantage.

To ensure the veracity of audit data, the information system and/or the application must protect audit information from any and all unauthorized access. This includes read, write, copy, etc.

This requirement can be achieved through multiple methods, which will depend upon system architecture and design. Some commonly employed methods include ensuring log files enjoy the proper file system permissions utilizing file system protections and limiting log data location. 

Additionally, applications with user interfaces to audit records should not allow for the unfettered manipulation of or access to those records via the application. If the application provides access to the audit data, the application becomes accountable for ensuring that audit information is protected from unauthorized access.

Audit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity.

If the value of &quot;audit_log_file&quot; is a relative path name, the plugin interprets it relative to the data directory. If the value is a full path name, the plugin uses the value as-is. A full path name may be useful if it is desirable to locate audit files on a separate file system or directory. For security reasons, write the audit log file to a directory accessible only to the MySQL Server and to users with a legitimate reason to view the log.

Satisfies: SRG-APP-000118-DB-000059, SRG-APP-000119-DB-000060, SRG-APP-000120-DB-000061</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review locations of audit logs, both internal to the database and database audit logs located at the operating system level.

Verify there are appropriate controls and permissions to protect the audit information from unauthorized access.

Run this script in the database to find the path and file name:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME = &apos;audit_log.file&apos;;

If &quot;audit_log.file&quot; contains only a file name, the audit files are located in the &quot;datadir&quot;. Run this script to find the data directory:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME LIKE &apos;datadir&apos;;

From the OS command line, run: 
ls -l &lt;directory where audit log files are located&gt;
ls -l &lt;directory where audit log files are located&gt; | grep -i &lt;audit_file_name&gt;

For example, if the values returned by the configured &quot;audit_log.file&quot; and &quot;datadir&quot; values are &quot;/usr/local/mysql/data/&quot; and &quot;audit.log&quot;, run:
ls -l  /usr/local/mysql/data/

Below is an example:
Note: The &quot;.enc&quot; file extension means the files are encrypted.

ls -l  &lt;directory where audit log files are located&gt;/ | grep -i audit
-rw-r-----    1 _mysql  _mysql  10083871 Apr 16 15:38 audit.20190416T203832.log
-rw-r-----    1 _mysql  _mysql    398709 Apr 18 10:34 audit.20190418T153446.log
-rw-r-----    1 _mysql  _mysql     15237 Apr 18 10:44 audit.20190418T154402.log
-rw-r-----    1 _mysql  _mysql    876206 Apr 24 14:00 audit.20190424T190008.log
-rw-r-----    1 _mysql  _mysql     30208 Apr 24 14:10 audit.20190424T191044.log.enc

If the owner and group are not &quot;mysql&quot; or &quot;_mysql&quot;, this is a finding.

If the directory or file permissions are more permissive than owner having Read/Write (RW) and group having Read (R) access to the audit files, aka &quot;750&quot;, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Apply controls and modify permissions to protect MySQL Enterprise Audit component log data from unauthorized access, whether stored in the database itself or at the operating system level.

Configure the audit log component as required. For example:
[mysqld]
audit-log=FORCE_PLUS_PERMANENT
audit-log.encryption=AES

The audit log component writes audit files in JSON format.

After changing startup-only audit settings, restart MySQL.

If an organization-defined audit encryption password is required, set it using:
SELECT audit_log_encryption_password_set(&apos;&lt;password&gt;&apos;);

Set appropriate ownership and permissions on the directory and audit files. For example:
chown mysql:mysql &lt;audit_directory_path&gt;
chmod 750 &lt;audit_directory_path&gt;

Audit files should be owned by the MySQL service account and should be no more permissive than required by organizational policy.

Refer to https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-logging-configuration.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289272</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289272r1319161_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must protect against a user falsely repudiating having performed organization-defined actions.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Nonrepudiation of actions taken is required to maintain data integrity. Examples of particular actions taken by individuals include creating information, sending a message, approving information (e.g., indicating concurrence or signing a contract), and receiving a message. 

Nonrepudiation protects against later claims by a user of not having created, modified, or deleted a particular data item or collection of data in the database.

In designing a database, the organization must define the types of data and the user actions that must be protected from repudiation. The implementation must then include building audit features into the application data tables and configuring database management system (DBMS) audit tools to capture the necessary audit trail. Design and implementation also must ensure that applications pass individual user identification to the DBMS, even where the application connects to the DBMS with a standard, group account.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Obtain the list of authorized MySQL Server accounts in the system documentation.

Determine if any accounts are shared. A shared account is defined as a username, hostname, and password that are used by multiple individuals to log in to SQL Server. An example of a shared account is the MySQL Server root account – root@localhost.

If accounts are determined to be shared, determine if individuals are first individually authenticated.

If individuals are not individually authenticated before using the shared account (e.g., by the operating system or possibly by an application making calls to the database), this is a finding.

The key is individual accountability. If this can be traced, this is not a finding.

If accounts are determined to be shared, determine if they are directly accessible to end users. If so, this is a finding.

Review contents of audit logs, traces, and data tables to confirm the identity of the individual user performing the action is captured.

If shared identifiers are found, and not accompanied by individual identifiers, this is a finding.

Note: Privileged installation accounts like root@localhost may be required to be accessed by the database administrator (DBA) or other administrators for system maintenance. In these cases, each use of the account must be logged in some manner to assign accountability for any actions taken during the use of the account.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Remove user-accessible shared accounts and use individual user IDs.

Build/configure applications to ensure successful individual authentication prior to shared account access.

Ensure each user&apos;s identity is received and used in audit data in all relevant circumstances.

Design, develop, and implement a method to log use of any account to which more than one person has access. Restrict interactive access to shared accounts to the fewest people possible.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289273</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289273r1319164_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must be configured to provide audit record generation capability for DoW-defined auditable events within all database components.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. 

Audit records can be generated from various components within the database management system (DBMS) (e.g., process, module). Certain specific application functionalities may be audited as well. The list of audited events is the set of events for which audits are to be generated. This set of events is typically a subset of the list of all events for which the system is capable of generating audit records.

DoW has defined the list of events for which the DBMS will provide an audit record generation capability as the following: 

(i) Successful and unsuccessful attempts to access, modify, or delete privileges, security objects, security levels, or categories of information (e.g., classification levels);

(ii) Access actions, such as successful and unsuccessful logon attempts, privileged activities, or other system-level access, starting and ending time for user access to the system, concurrent logons from different workstations, successful and unsuccessful accesses to objects, all program initiations, and all direct access to the information system; and

(iii) All account creation, modification, disabling, and termination actions.

Organizations may define additional events requiring continuous or ad hoc auditing.

Satisfies: SRG-APP-000089-DB-000064, SRG-APP-000091-DB-000066, SRG-APP-000091-DB-000325, SRG-APP-000492-DB-000332, SRG-APP-000492-DB-000333, SRG-APP-000496-DB-000334, SRG-APP-000496-DB-000335, SRG-APP-000499-DB-000330, SRG-APP-000499-DB-000331, SRG-APP-000501-DB-000336, SRG-APP-000501-DB-000337</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Check MySQL Enterprise Audit to determine whether organization-defined auditable events are configured to be audited by the system.

Verify the MySQL Enterprise Audit component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

If no row is returned, this is a finding.

Verify audit logging has not been disabled:
SHOW GLOBAL VARIABLES LIKE &apos;audit_log.disable&apos;;

If &quot;audit_log.disable&quot; is &quot;ON&quot;, this is a finding.

Determine whether audit log encryption is configured as required:
SHOW GLOBAL VARIABLES LIKE &apos;audit_log.encryption&apos;;

If organizational policy requires encrypted audit logs and &quot;audit_log.encryption&quot; is not the Advanced Encryption Standard (AES), this is a finding.

Review the configured audit filters and assignments:
SELECT NAME, FILTER
FROM mysql.audit_log_filter;

SELECT USER, HOST, FILTERNAME
FROM mysql.audit_log_user;

If the configured filters do not provide audit record generation for the DoW-defined auditable events, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Deploy and configure MySQL Database Server 9.x with the MySQL Enterprise Audit component to generate audit records for at least the DoW minimum set of auditable events.

Install MySQL Enterprise Audit using the component installation script:
audit_log_component_filter_install.sql

Verify installation:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

To require the component to remain loaded and to fail startup if it cannot initialize, configure:
[mysqld]
audit-log=FORCE_PLUS_PERMANENT

If encrypted audit logs are required, configure the component after the required keyring is active:
[mysqld]
audit-log.encryption=AES

Configure audit filters for the required events. For example, to log all auditable events and use that filter as the default:
SELECT audit_log_filter_set_filter(&apos;log_all&apos;, &apos;{ &quot;filter&quot;: { &quot;log&quot;: true } }&apos;);
SELECT audit_log_filter_set_user(&apos;%&apos;, &apos;log_all&apos;);

Do not replace an existing organization-approved filter that captures additional required events; incorporate the required events into the existing audit policy as appropriate.

Refer to the following:
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-installation.html
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-filtering.html</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289274</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289274r1319165_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must allow only the information system security manager (ISSM) (or individuals or roles appointed by the ISSM) to select which auditable events are to be audited.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Without the capability to restrict which roles and individuals can select which events are audited, unauthorized personnel may be able to prevent or interfere with the auditing of critical events. 

Suppression of auditing could permit an adversary to evade detection.

Misconfigured audits can degrade the system&apos;s performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.

&quot;AUDIT_ADMIN&quot; enables audit log configuration. This privilege is provided for administration of the MySQL Enterprise Audit component.

&quot;SUPER&quot; is a powerful and far-reaching privilege and should not be granted lightly.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Check MySQL settings and documentation to determine whether designated personnel are able to select which auditable events are being audited.

To list out users who have rights to administrative access for auditing, run the following query:
SELECT * FROM INFORMATION_SCHEMA.USER_PRIVILEGES where PRIVILEGE_TYPE in (&apos;AUDIT_ADMIN&apos;, &apos;SUPER&apos;);

If any of the roles or users returned have permissions that are not documented, or the documented audit maintainers do not have permissions, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL Database Server 9.x settings to allow designated personnel to select which auditable events are audited.

Grant permissions to users who need rights to create auditing rules:
GRANT AUDIT_ADMIN
ON *.* TO &apos;&lt;auditusername&gt;&apos;@&apos;&lt;host_specification&gt;&apos;;

For example:
GRANT AUDIT_ADMIN
ON *.* TO &apos;auditusername&apos;@&apos;%&apos;;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289275</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289275r1319410_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must generate audit records when privileges/permissions are added.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Changes in the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized elevation or restriction of individual and group privileges could go undetected. Elevated privileges give users access to information and functionality that they must not have; restricted privileges wrongly deny access to authorized users.

In an SQL environment, adding permissions is typically done via the &quot;GRANT&quot; command, or, in the negative, the &quot;DENY&quot; command.

Satisfies: SRG-APP-000495-DB-000326, SRG-APP-000495-DB-000327, SRG-APP-000495-DB-000328, SRG-APP-000495-DB-000329</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Check that MySQL Server Audit is being used for the STIG compliance audit.

Verify that the MySQL Enterprise Audit component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

If no row is returned, this is a finding.

Verify that audit logging has not been disabled:
SHOW GLOBAL VARIABLES LIKE &apos;audit_log.disable&apos;;

If &quot;audit_log.disable&quot; is &quot;ON&quot;, this is a finding.

Review audit filters and associated users by running the following queries:
SELECT `audit_log_filter`.`NAME`,
   `audit_log_filter`.`FILTER`
FROM `mysql`.`audit_log_filter`;

SELECT `audit_log_user`.`USER`,
   `audit_log_user`.`HOST`,
   `audit_log_user`.`FILTERNAME`
FROM `mysql`.`audit_log_user`;

All currently defined audits for the MySQL server instance will be listed. If no audits are returned, this is a finding.

Determine if rules are in place to capture the following types of commands related to permissions by running the command:
SELECT * FROM mysql.audit_log_filter;

If the template SQL filter was used, it will have the name &quot;log_stig&quot;.

Review the filter value. Ensure filters for events based on the &quot;general_sql_command.str&quot; field capture the following SQL statement types:
grant
grant_roles
revoke
revoke_all
revoke_roles
drop_role
alter_user_default_role
create_role
set_role
create_user
alter_user
drop_user
rename_user
show_create_user</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL Database Server to audit when privileges/permissions are added.

Add the following events to the MySQL Server Audit being used for the STIG compliance audit: 
grant
grant_roles
revoke
revoke_all
revoke_roles
drop_role
alter_user_default_role
create_role
set_role
create_user
alter_user
drop_user
rename_user
show_create_user

Refer to the following link for more information: https://dev.mysql.com/doc/refman/9.7/en/audit-log-component.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289276</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289276r1319171_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must generate audit records when categories of information (e.g., classification levels/security levels) are modified.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Changes in categories of information must be tracked. Without an audit trail, unauthorized access to protected data could go undetected.

For detailed information on categorizing information, refer to FIPS Publication 199, Standards for Security Categorization of Federal Information and Information Systems, and FIPS Publication 200, Minimum Security Requirements for Federal Information and Information Systems.

Satisfies: SRG-APP-000494-DB-000344, SRG-APP-000494-DB-000345, SRG-APP-000498-DB-000346, SRG-APP-000498-DB-000347, SRG-APP-000502-DB-000348</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If classification levels/security levels labeling is not required, this is not applicable.

Review the system documentation to identify the database objects containing categories of information that are required to be audited when modified.

Verify that the MySQL Enterprise Audit component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

Review the configured audit filters:
SELECT NAME, FILTER
FROM mysql.audit_log_filter;

SELECT USER, HOST, FILTERNAME
FROM mysql.audit_log_user;

Verify the applicable audit filter records modification activity for the identified database objects.

For MySQL Enterprise Audit, modification of table data is represented by the &quot;table_access&quot; event class with the update event subclass.

A filter that records all events, all &quot;table_access&quot; events, or specifically &quot;table_access/update&quot; events satisfies this portion of the requirement, provided the filter applies to the required database users and objects.

Verify the applicable audit filter is assigned to the required users or is configured as the default audit filter.

If modification of the identified categories of information is not configured to generate an audit record, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL Enterprise Audit component to record modifications to database objects containing categories of information identified in the database management system (DBMS) product documentation as requiring audit coverage.

Modify the organization&apos;s existing audit filter to include &quot;table_access/update&quot; events, or create an appropriate audit filter if one does not already exist.

For example:
SET @f = &apos;{
  &quot;filter&quot;: {
    &quot;class&quot;: {
      &quot;name&quot;: &quot;table_access&quot;,
      &quot;event&quot;: {
        &quot;name&quot;: &quot;update&quot;,
        &quot;log&quot;: true
      }
    }
  }
}&apos;;

SELECT audit_log_filter_set_filter(
    &apos;log_category_modification&apos;,
    @f
);

Assign the filter to the applicable MySQL account:
SELECT audit_log_filter_set_user(
    &apos;&lt;user&gt;@&lt;host&gt;&apos;,
    &apos;log_category_modification&apos;
);

If the filter is intended to apply as the default to accounts without a specific filter assignment:
SELECT audit_log_filter_set_user(
    &apos;%&apos;,
    &apos;log_category_modification&apos;
);

Do not replace an existing audit filter that records additional events required by the organization. Incorporate the &quot;table_access/update&quot; requirement into the existing audit policy as appropriate.

Refer to the following:
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-filtering.html
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-filter-definitions.html</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289277</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289277r1319174_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must generate audit records when unsuccessful attempts to delete categories of information (e.g., classification levels/security levels) occur.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Changes in categories of information must be tracked. Without an audit trail, unauthorized access to protected data could go undetected.

To aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.

For detailed information on categorizing information, refer to FIPS Publication 199, Standards for Security Categorization of Federal Information and Information Systems, and FIPS Publication 200, Minimum Security Requirements for Federal Information and Information Systems.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If classification levels/security levels labeling is not required, this is not applicable.

Review the system documentation to determine whether MySQL Server is required to generate audit records for unsuccessful attempts to delete categories of information, such as classification levels or security levels.

Verify MySQL Enterprise Audit and the Audit Message component are installed:
SELECT *
FROM mysql.component
WHERE component_urn IN
      (&apos;file://component_audit_log&apos;,
       &apos;file://component_audit_api_message_emit&apos;);

Verify that the stored procedure used by the trigger exists:
SHOW PROCEDURE STATUS
WHERE Db = &apos;test_trigger&apos;
  AND Name = &apos;audit_api_message_emit_sp&apos;;

Review the trigger definition used to prevent unauthorized deletion of the applicable category of information:
SHOW TRIGGERS FROM &lt;database_name&gt;;

or:

SHOW CREATE TRIGGER &lt;trigger_name&gt;;

Verify the trigger:
1. Identifies an unauthorized &quot;DELETE&quot; of the applicable category of information.
2. Rejects the &quot;DELETE&quot; operation.
3. Invokes the configured &quot;audit-message&quot; mechanism so the unsuccessful attempt generates an audit record.

Review the applicable Enterprise Audit filter configuration:
SELECT NAME, FILTER
FROM mysql.audit_log_filter;

SELECT USER, HOST, FILTERNAME
FROM mysql.audit_log_user;

Verify that the audit message generated by the trigger is included in the configured audit policy.

If the configured controls do not reject and audit an unauthorized attempt to delete the applicable category of information, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If currently required, configure the MySQL Database Server with delete triggers which prevent unauthorized deletes and call &quot;audit_api_message_emit_udf()&quot; function to produce audit records when unsuccessful attempts to delete categories of information occur.

Add security level details in an additional column.

Add the component for adding information to the audit log:
INSTALL COMPONENT &quot;file://component_audit_api_message_emit&quot;;
create schema test_trigger;

Create a stored procedure to allow the &quot;audit_api_message_emit_udf&quot; to be called as well as provide the details for the audit event.

DELIMITER 

$$CREATE PROCEDURE audit_api_message_emit_sp(name CHAR(20))
BEGIN
DECLARE aud_msg VARCHAR(255);
select audit_api_message_emit_udf(&apos;sec_level_trigger&apos;,
                                         &apos;TRIGGER audit_delete_attempt&apos;,
                                         &apos;Attempt was made to delete H level sec data&apos;,
                                         &apos;FOR &apos;, name
                                         ) into aud_msg;
END
$$DELIMITER ;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289278</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289278r1319177_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must generate audit records when successful logons or connections occur.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>For completeness of forensic analysis, it is necessary to track who/what (a user or other principal) logs on to the database management system (DBMS).</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the DBMS product documentation to determine whether successful logons or connections must be audited.

Verify MySQL Enterprise Audit is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

Review the configured audit filters and associated users:
SELECT NAME, FILTER
FROM mysql.audit_log_filter;

SELECT USER, HOST, FILTERNAME
FROM mysql.audit_log_user;

Verify that the applicable audit filter records successful connection activity.

For MySQL Enterprise Audit, successful logon activity is represented by the connection event class and the connect event subclass.

Verify that the applicable filter includes connection/connect events and is assigned to the required users or configured as the default filter.

A filter that records all connection events also satisfies this requirement.

If successful logons or connections are required to be audited and the applicable audit policy does not include connection/connect events, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL Enterprise Audit to record successful logons and connection attempts.

Modify the existing audit filter to include the required connection events or create an audit filter for these events. Do not replace an existing audit filter that records additional events required by the organization.

For example:
SET @f = &apos;{ &quot;filter&quot;: { &quot;class&quot;: { &quot;name&quot;: &quot;connection&quot; } } }&apos;;

SELECT audit_log_filter_set_filter(
    &apos;log_connection_events&apos;,
    @f
);

Assign the filter to the applicable MySQL account:
SELECT audit_log_filter_set_user(
    &apos;&lt;user&gt;@&lt;host&gt;&apos;,
    &apos;log_connection_events&apos;
);

If the filter is intended to apply as the default to accounts without a specific filter assignment, use % as the account:
SELECT audit_log_filter_set_user(&apos;%&apos;, &apos;log_connection_events&apos;);

After configuring the audit policy, perform a controlled, successful connection and verify that the corresponding connection/connect audit record is generated with a status of &quot;0&quot;.

Refer to the MySQL Reference Manual for MySQL Enterprise Audit component filtering:
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-filtering.html</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289279</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289279r1319180_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must generate audit records when unsuccessful logons or connection attempts occur.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>For completeness of forensic analysis, it is necessary to track failed attempts to log on to the database management system (DBMS). While positive identification may not be possible in a case of failed authentication, as much information as possible about the incident must be captured.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the DBMS product documentation to determine whether MySQL Server is required to generate audit records when unsuccessful logons or connection attempts occur.

Verify MySQL Enterprise Audit is installed and configured.

Review the configured audit filters and associated users:
SELECT NAME, FILTER
FROM mysql.audit_log_filter;

SELECT USER, HOST, FILTERNAME
FROM mysql.audit_log_user;

Verify the applicable audit filter records connection class events, including the connect event, and that the filter is assigned to the applicable users or configured as the default filter.

Perform a controlled unsuccessful connection attempt using the MySQL command-line client. For example:
mysql -u notauser -p -h localhost

Supply an invalid password when prompted.

Verify the connection is rejected.

Review the MySQL audit log and verify that a corresponding audit record exists with:
- Class equal to connection.
- Event equal to connect.
- A nonzero status.

For an authentication failure resulting in access denied, the status will normally be &quot;1045&quot;.

If an unsuccessful logon or connection attempt does not generate the required audit record, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL Enterprise Audit to record unsuccessful logons and connection attempts.

Configure the applicable audit filter to record connection class events, including connect events, and assign the filter to the required user accounts or as the default filter, as appropriate.

After configuring the audit policy, perform a controlled unsuccessful connection attempt and verify that the corresponding connection/connect audit record is generated with a nonzero status.

Refer to the MySQL Reference Manual for MySQL Enterprise Audit component filtering:
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-filtering.html</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289280</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289280r1319183_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must generate audit records for all privileged activities or other system-level access.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Without tracking privileged activity, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. 

System documentation should include a definition of the functionality considered privileged.

A privileged function in this context is any operation that modifies the structure of the database, its built-in logic, or its security settings. This would include all Data Definition Language (DDL) statements and all security-related statements. In a SQL environment, it encompasses but is not necessarily limited to:
CREATE
ALTER
DROP
GRANT
REVOKE
DENY

There may also be Data Manipulation Language (DML) statements that, subject to context, should be regarded as privileged. Possible examples in SQL include:

TRUNCATE TABLE;
DELETE, or
DELETE affecting more than n rows, for some n, or
DELETE without a WHERE clause;

UPDATE or
UPDATE affecting more than n rows, for some n, or
UPDATE without a WHERE clause;

Any &quot;SELECT&quot;, &quot;INSERT&quot;, &quot;UPDATE&quot;, or &quot;DELETE&quot; to an application-defined security table executed by other than a security principal.

Depending on the capabilities of the database management system (DBMS) and the design of the database and associated applications, audit logging may be achieved by means of DBMS auditing features, database triggers, other mechanisms, or a combination of these.

Note that it is particularly important to audit, and tightly control, any action that weakens the implementation of this requirement itself, since the objective is to have a complete audit trail of all administrative activity.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation to determine if MySQL Server is required to audit for all privileged activities or other system-level access.

Verify the MySQL Enterprise Audit component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

If no row is returned, this is a finding.

Verify audit logging has not been disabled:
SHOW GLOBAL VARIABLES LIKE &apos;audit_log.disable&apos;;

If &quot;audit_log.disable&quot; is &quot;ON&quot;, this is a finding.

Review audit filters and associated users by running the following queries:
SELECT `audit_log_filter`.`NAME`,
   `audit_log_filter`.`FILTER`
FROM `mysql`.`audit_log_filter`;

SELECT `audit_log_user`.`USER`,
   `audit_log_user`.`HOST`,
   `audit_log_user`.`FILTERNAME`
FROM `mysql`.`audit_log_user`;

All currently defined audits for the MySQL server instance will be listed. If no audits are returned, this is a finding.

Determine if rules are in place to capture the following types of commands related to permissions by running:
SELECT * FROM mysql.audit_log_filter;

If the template SQL filter was used, it will have the name &quot;log_stig&quot;.

Review the filter values. Ensure filters for events based on the &quot;general_sql_command.str&quot; field capture the following SQL statement types:
grant
grant_roles
revoke
revoke_all
revoke_roles
drop_role
alter_user_default_role
create_role
set_role
create_user
alter_user
drop_user
rename_user
show_create_user</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL Database Server to audit all privileged activities or other system-level access.

Modify the existing audit filter to include the required privileged operations, or create an audit filter for these events.

For example, the following creates a filter named &quot;log_stig&quot; that records the privileged account and role management operations required by this check:
SET @filter = &apos;{
  &quot;filter&quot;: {
    &quot;class&quot;: {
      &quot;name&quot;: &quot;general&quot;,
      &quot;event&quot;: {
        &quot;name&quot;: &quot;status&quot;,
        &quot;log&quot;: {
          &quot;or&quot;: [
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;grant&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;grant_roles&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;revoke&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;revoke_all&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;revoke_roles&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;create_role&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;drop_role&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;set_role&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;create_user&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;alter_user&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;alter_user_default_role&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;drop_user&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;rename_user&quot; } },
            { &quot;field&quot;: { &quot;name&quot;: &quot;general_sql_command.str&quot;, &quot;value&quot;: &quot;show_create_user&quot; } }
          ]
        }
      }
    }
  }
}&apos;;

SELECT audit_log_filter_set_filter(&apos;log_stig&apos;, @filter);

Assign the filter to the applicable MySQL account:
SELECT audit_log_filter_set_user(
    &apos;&lt;user&gt;@&lt;host&gt;&apos;,
    &apos;log_stig&apos;
);

If the filter is intended to apply as the default to accounts without a specific filter assignment, use &quot;%&quot; as the account:
SELECT audit_log_filter_set_user(&apos;%&apos;, &apos;log_stig&apos;);

Do not replace an existing audit filter that records additional events required by the organization. Instead, incorporate these privileged operation rules into the existing audit policy as appropriate.

Refer to the MySQL Reference Manual, Audit Log Component Filtering, and Writing Audit Log Component Filter Definitions, for additional configuration information.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289281</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289281r1319412_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must generate audit records when unsuccessful attempts to execute privileged activities or other system-level access occur.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Without tracking privileged activity, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. 

System documentation should include a definition of the functionality considered privileged.

A privileged function in this context is any operation that modifies the structure of the database, its built-in logic, or its security settings. This would include all Data Definition Language (DDL) statements and all security-related statements. In an SQL environment, it encompasses, but is not necessarily limited to:
CREATE
ALTER
DROP
GRANT
REVOKE
DENY

Note that it is particularly important to audit, and tightly control, any action that weakens the implementation of this requirement itself, since the objective is to have a complete audit trail of all administrative activity.

To aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation to determine if MySQL Server is required to audit for unsuccessful attempts to execute privileged activities or other system-level access.

Verify the MySQL Enterprise Audit component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

If no row is returned, this is a finding.

Verify audit logging has not been disabled:
SHOW GLOBAL VARIABLES LIKE &apos;audit_log.disable&apos;;

If &quot;audit_log.disable&quot; is &quot;ON&quot;, this is a finding.

Review audit filters and associated users by running the following queries:
SELECT `audit_log_filter`.`NAME`,
   `audit_log_filter`.`FILTER`
FROM `mysql`.`audit_log_filter`;

SELECT `audit_log_user`.`USER`,
   `audit_log_user`.`HOST`,
   `audit_log_user`.`FILTERNAME`
FROM `mysql`.`audit_log_user`;

All currently defined audits for the MySQL server instance will be listed. If no audits are returned, this is a finding.

Determine if rules are in place to capture the following types of commands related to permissions by running:
SELECT * FROM mysql.audit_log_filter;

If the template SQL filter was used, it will have the name &quot;log_stig&quot;.

Review the filter values. Ensure filters for events based on the &quot;general_sql_command.str&quot; field capture the following SQL statement types:
grant
grant_roles
revoke
revoke_all
revoke_roles
drop_role
alter_user_default_role
create_role
set_role
create_user
alter_user
drop_user
rename_user
show_create_user</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL Database Server to audit for unsuccessful attempts to execute privileged activities or other system-level access.

Add the following events to the MySQL Server Audit: 
grant
grant_roles
revoke
revoke_all
revoke_roles
drop_role
alter_user_default_role
create_role
set_role
create_user
alter_user
drop_user
rename_user
show_create_user

Refer to the following link for more information: https://dev.mysql.com/doc/refman/9.7/en/audit-log-component.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289282</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289282r1319414_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must generate audit records showing starting and ending time for user access to the database(s).</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>For completeness of forensic analysis, it is necessary to know how long a user&apos;s (or other principal&apos;s) connection to the database management system (DBMS) lasts. This can be achieved by recording disconnections, in addition to logons/connections, in the audit logs.

Disconnection may be initiated by the user or forced by the system (as in a timeout) or result from a system or network failure. To the greatest extent possible, all disconnections must be logged.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Verify the MySQL Enterprise Audit component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

If no row is returned, this is a finding.

Verify audit logging has not been disabled:
SHOW GLOBAL VARIABLES LIKE &apos;audit_log.disable&apos;;

If &quot;audit_log.disable&quot; is &quot;ON&quot;, this is a finding.

Review audit filters and associated users by running the following queries:
SELECT `audit_log_filter`.`NAME`,
   `audit_log_filter`.`FILTER`
FROM `mysql`.`audit_log_filter`;

SELECT `audit_log_user`.`USER`,
   `audit_log_user`.`HOST`,
   `audit_log_user`.`FILTERNAME`
FROM `mysql`.`audit_log_user`;

All currently defined audits for the MySQL server instance will be listed. If no audits are returned, this is a finding.

To check if the audit filters that are in place are generating records when successful logons or connections occur, log in to MySQL and then log out. 

Below is an example using MySQL Shell:
% mysqlsh —sql
 MySQL  SQL &gt; \connect newuser@localhost
Creating a session to &apos;newuser@localhost&apos;
 MySQL  localhost:33060+ ssl  SQL &gt; \quit
Bye!

Review the audit log by running the Linux command:
sudo cat  &lt;directory where audit log files are located&gt;/audit.log | egrep  &quot;\&quot;event\&quot;: \&quot;connect\&quot;&quot;

Note:
- A &quot;status&quot; of &quot;0&quot; for each indicates successful.
- A &quot;connection_id&quot; of &quot;19&quot; is the same as the connections process ID and there will be a matching disconnect event with the same &quot;connection_id&quot; number. This can be used to differentiate multiple connections using the same login.
- Each connect and disconnect has a time stamp tag with the time in Coordinated Universal Time (UTC).

For example, if the values returned by the configured &quot;audit_log.file&quot; and &quot;datadir&quot; values are &quot;/usr/local/mysql/data/&quot; and &quot;audit.log&quot;, run:
sudo cat  /usr/local/mysql/data/audit.log |egrep &quot;\&quot;event\&quot;: \&quot;connect\&quot;&quot;

The audit data will look similar to the examples below:

Logging in - connecting:
{ &quot;timestamp&quot;: &quot;2020-08-21 17:47:09&quot;, &quot;id&quot;: 0, &quot;class&quot;: &quot;connection&quot;, &quot;event&quot;: &quot;connect&quot;, &quot;connection_id&quot;: 19, &quot;account&quot;: { &quot;user&quot;: &quot;newuser&quot;, &quot;host&quot;: &quot;localhost&quot; }, &quot;login&quot;: { &quot;user&quot;: &quot;newuser&quot;, &quot;os&quot;: &quot;&quot;, &quot;ip&quot;: &quot;::1&quot;, &quot;proxy&quot;: &quot;&quot; }, &quot;connection_data&quot;: { &quot;connection_type&quot;: &quot;plugin&quot;, &quot;status&quot;: 0, &quot;db&quot;: &quot;&quot; } },

Logging out - disconnecting:
sudo cat  &lt;directory where audit log files are located&gt;/audit.log | egrep  &quot;\&quot;event\&quot;: \&quot;disconnect\&quot;&quot;

{ &quot;timestamp&quot;: &quot;2020-08-21 17:47:11&quot;, &quot;id&quot;: 1, &quot;class&quot;: &quot;connection&quot;, &quot;event&quot;: &quot;disconnect&quot;, &quot;connection_id&quot;: 19, &quot;account&quot;: { &quot;user&quot;: &quot;newuser&quot;, &quot;host&quot;: &quot;localhost&quot; }, &quot;login&quot;: { &quot;user&quot;: &quot;newuser&quot;, &quot;os&quot;: &quot;&quot;, &quot;ip&quot;: &quot;::1&quot;, &quot;proxy&quot;: &quot;&quot; }, &quot;connection_data&quot;: { &quot;connection_type&quot;: &quot;plugin&quot; } },</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If currently required, configure the MySQL Database Server to produce audit records when successful logons or connections occur.

Refer to the following link for more information: https://dev.mysql.com/doc/refman/9.7/en/audit-log-component.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289283</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289283r1319417_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must generate audit records for concurrent logons/connections by the same user from different workstations.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>For completeness of forensic analysis, it is necessary to track who logs on to the database management system (DBMS).

Concurrent connections by the same user from multiple workstations may be valid use of the system; or such connections may be due to improper circumvention of the requirement to use the common access card (CAC) for authentication; or they may indicate unauthorized account sharing; or they may be because an account has been compromised.

(If the fact of multiple, concurrent logons by a given user can be reliably reconstructed from the log entries for other events [logons/connections; voluntary and involuntary disconnections], then it is not mandatory to create additional log entries specifically for this).</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation to determine if MySQL Server is required to audit the concurrent logons/connections by the same user from different workstations.

Verify the MySQL Enterprise Audit component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

If no row is returned, this is a finding.

Verify audit logging has not been disabled:
SHOW GLOBAL VARIABLES LIKE &apos;audit_log.disable&apos;;

If &quot;audit_log.disable&quot; is &quot;ON&quot;, this is a finding.

Review audit filters and associated users by running the following queries:
SELECT `audit_log_filter`.`NAME`,
   `audit_log_filter`.`FILTER`
FROM `mysql`.`audit_log_filter`;

SELECT `audit_log_user`.`USER`,
   `audit_log_user`.`HOST`,
   `audit_log_user`.`FILTERNAME`
FROM `mysql`.`audit_log_user`;

All currently defined audits for the MySQL Server instance will be listed. If no audits are returned, this is a finding.

To check if the audit filters that are in place are generating records when multiple connections occur, run multiple connections from the same user without logging out and from different IP addresses.

Review the audit log:
sudo cat  &lt;directory where audit log files are located&gt;/audit.log | egrep &lt;username&gt;

For example, if the values returned by the configured &quot;audit_log.file&quot; and &quot;datadir&quot; values are  &quot;/usr/local/mysql/data/&quot; and &quot;audit.log&quot;, and the user is &quot;fewconnects&quot;, run:
sudo cat  /usr/local/mysql/data/audit.log |egrep fewconnects

 { &quot;connection_type&quot;: &quot;ssl&quot;, &quot;status&quot;: 0, &quot;db&quot;: &quot;&quot;, &quot;connection_attributes&quot;: { &quot;_pid&quot;: &quot;9132&quot;, &quot;_os&quot;: &quot;macos10.14&quot;, &quot;_platform&quot;: &quot;x86_64&quot;, &quot;_client_version&quot;: &quot;8.0.20&quot;, &quot;_client_name&quot;: &quot;libmysql&quot;, &quot;program_name&quot;: &quot;mysqlsh&quot; } } },
{ &quot;timestamp&quot;: &quot;2020-08-31 18:03:41&quot;, &quot;id&quot;: 0, &quot;class&quot;: &quot;connection&quot;, &quot;event&quot;: &quot;connect&quot;, &quot;connection_id&quot;: 28, &quot;account&quot;: { &quot;user&quot;: &quot;fewconnects&quot;, &quot;host&quot;: &quot;localhost&quot; }, &quot;login&quot;: { &quot;user&quot;: &quot;fewconnects&quot;, &quot;os&quot;: &quot;&quot;, &quot;ip&quot;: &quot;&quot;, &quot;proxy&quot;: &quot;&quot; }, &quot;connection_data&quot;: { &quot;connection_type&quot;: &quot;ssl&quot;, &quot;status&quot;: 0, &quot;db&quot;: &quot;&quot;, &quot;connection_attributes&quot;: { &quot;_pid&quot;: &quot;9132&quot;, &quot;_os&quot;: &quot;macos10.14&quot;, &quot;_platform&quot;: &quot;x86_64&quot;, &quot;_client_version&quot;: &quot;8.0.20&quot;, &quot;_client_name&quot;: &quot;libmysql&quot;, &quot;program_name&quot;: &quot;mysqlsh&quot; } } }
{ &quot;timestamp&quot;: &quot;2020-08-31 18:11:05&quot;, &quot;id&quot;: 12, &quot;class&quot;: &quot;connection&quot;, &quot;event&quot;: &quot;connect&quot;, &quot;connection_id&quot;: 38, &quot;account&quot;: { &quot;user&quot;: &quot;fewconnects&quot;, &quot;host&quot;: &quot;localhost&quot; }, &quot;login&quot;: { &quot;user&quot;: &quot;fewconnects&quot;, &quot;os&quot;: &quot;&quot;, &quot;ip&quot;: &quot;93.122.141.147&quot;, &quot;proxy&quot;: &quot;&quot; }, &quot;connection_data&quot;: { &quot;connection_type&quot;: &quot;ssl&quot;, &quot;status&quot;: 0, &quot;db&quot;: &quot;&quot;, &quot;connection_attributes&quot;: { &quot;_pid&quot;: &quot;903&quot;, &quot;_os&quot;: &quot;macos10.15&quot;, &quot;_platform&quot;: &quot;x86_64&quot;, &quot;_client_version&quot;: &quot;8.0.20&quot;, &quot;_client_name&quot;: &quot;libmysql&quot;, &quot;program_name&quot;: &quot;MySQLWorkbench&quot; } } },

Note that each connection has a different connection_id indicating distinctly auditing multiple connections. Here there are connections from mysqlsh and MySQLWorkbench; the event type is &quot;event&quot;: &quot;connect&quot; and the &quot;user&quot;: &quot;fewconnects&quot;, &quot;os&quot;: &quot;&quot;, &quot;ip&quot;: &quot;127.0.0.1&quot; and &quot;login&quot;: { &quot;user&quot;: &quot;fewconnects&quot;, &quot;os&quot;: &quot;&quot;, &quot;ip&quot;: &quot;93.122.141.147&quot; - that is with different IPs from the different workstations.

If the audit events are not present, this is a finding.

If currently required, configure the MySQL Database Server to produce audit records when connections occur.

Refer to the following link for more information: https://dev.mysql.com/doc/refman/9.7/en/audit-log-component.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If currently required, configure the MySQL Database Server to produce audit records when connections occur.

Refer to the following link for more information: https://dev.mysql.com/doc/refman/9.7/en/audit-log-component.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289284</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289284r1319419_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must be able to generate audit records when successful accesses to objects occur.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Without tracking all or selected types of access to all or selected objects (tables, views, procedures, functions, etc.), it would be difficult to establish, correlate, and investigate the events relating to an incident, or identify those responsible for one. 

In an SQL environment, types of access include, but are not necessarily limited to:
SELECT
INSERT
UPDATE
DELETE
EXECUTE

Satisfies: SRG-APP-000507-DB-000356, SRG-APP-000507-DB-000357, SRG-APP-000508-DB-000358</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation to determine if MySQL Server is required to generate audit records when successful accesses to objects occur.

Verify the MySQL Enterprise Audit component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

If no row is returned, this is a finding.

Verify audit logging has not been disabled:
SHOW GLOBAL VARIABLES LIKE &apos;audit_log.disable&apos;;

If &quot;audit_log.disable&quot; is &quot;ON&quot;, this is a finding.

Review audit filters and associated users by running the following queries:
SELECT `audit_log_filter`.`NAME`,
   `audit_log_filter`.`FILTER`
FROM `mysql`.`audit_log_filter`;

SELECT `audit_log_user`.`USER`,
   `audit_log_user`.`HOST`,
   `audit_log_user`.`FILTERNAME`
FROM `mysql`.`audit_log_user`;

All currently defined audits for the MySQL Server instance will be listed. If no audits are returned, this is a finding.

To check if the audit filters in place are generating records to audit when certain objects are accessed, run a query and other access types on that object:
SELECT * FROM &lt;schemaname&gt;/&lt;tablename&gt;;

Review the audit log by running the Linux command:
sudo cat  &lt;directory where audit log files are located&gt;/audit.log|egrep &lt;tablename&gt;

For example, if the values returned by the configured &quot;audit_log.file&quot; and &quot;datadir&quot; values are &quot;/usr/local/mysql/data/&quot; and &quot;audit.log&quot;, run:
sudo cat  /usr/local/mysql/data/audit.log |egrep &lt;tablename&gt;

If the audit event is not present, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL Database Server to audit when successful accesses to objects occur. 

Refer to the following link for more information: https://dev.mysql.com/doc/refman/9.7/en/audit-log-component.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289285</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289285r1319198_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x, when utilizing Public Key Infrastructure (PKI)-based authentication, must validate certificates by performing RFC 5280-compliant certification path validation.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The DoW standard for authentication is DoW-approved PKI certificates.

A certificate&apos;s certification path is the path from the end entity certificate to a trusted root certification authority (CA). Certification path validation is necessary for a relying party to make an informed decision regarding acceptance of an end entity certificate. Certification path validation includes checks such as certificate issuer trust, time validity, and revocation status for each certificate in the certification path. Revocation status information for CA and subject certificates in a certification path is commonly provided via certificate revocation lists (CRLs) or online certificate status protocol (OCSP) responses.

Database management systems (DBMSs) that do not validate certificates by performing RFC 5280-compliant certification path validation are in danger of accepting certificates that are invalid and/or counterfeit. This could allow unauthorized access to the database.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The database supports PKI-based authentication by using digital certificates over Transport Layer Security (TLS) in addition to the native encryption and data integrity capabilities of these protocols.

Review MySQL Database Server 9.x configuration to verify DBMS user account certificates are valid by performing RFC 5280-compliant certification path validation.

Run the following command to determine the certificate in use, along with other details:
select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_crl, @@ssl_crlpath, @@ssl_fips_mode, @@ssl_key;

If &quot;ssl_crl&quot; is not set to a CRL file, this is a finding. 

If &quot;ssl_crlpath&quot; is empty, then use the default, which is the &quot;datadir&quot; path. To get that path, run:
select @@datadir

Verify the existence of the CRL file.

If the CRL file does not exist, this is a finding.

Verify &quot;require_secure_transport&quot; is &quot;ON&quot; by running:
select @@require_secure_transport;

If the value of &quot;require_secure_transport&quot; is not &quot;1&quot; for &quot;ON&quot;, this is a finding.

If the certificate is not a DoW-approved certificate, or if no certificate is listed, this is a finding.

Confirm Issuer and Subject map to the user name. Run the following script:
SELECT `user`.`Host`,
    `user`.`User`,
    `user`.`ssl_type`,
    CAST(`user`.`x509_issuer` as CHAR) as Issuer,
    CAST(`user`.`x509_subject` as CHAR) as Subject
FROM `mysql`.`user`;

If user accounts are not being mapped to authenticated identities, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the DBMS to validate certificates by constructing a certification path with status information to an accepted trust anchor.

Configure the database server to support TLS protocols:
mysql&gt; set persist require_secure_transport=ON;

Set system variables on the server side to specify DoW-approved certificate and key files the server uses when permitting clients to establish encrypted connections:

ssl_ca: The path name of the CA certificate file. (ssl_capath is similar but specifies the path name of a directory of CA certificate files.)

ssl_cert: The path name of the server public key certificate file. This certificate can be sent to the client and authenticated against the CA certificate that it has.

ssl_key: The path name of the server private key file.

For example, to enable the server for encrypted connections with certificates, start it with these lines in the &quot;my.cnf&quot; file, changing the file names as necessary:
[mysqld]
ssl_ca=ca.pem
ssl_cert=server-cert.pem
ssl_key=server-key.pem

Alter users to require X509 certificates.

Below is an example to add X509 as a requirement:
For a new user:
CREATE USER &apos;jeffrey&apos;@&apos;localhost&apos; REQUIRE X509;
AND SUBJECT &apos;/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Johan Smith&apos;
  AND ISSUER &apos;/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Some CA&apos;;

Or to add to an existing user:
ALTER USER &apos;johansmith&apos;@&apos;%&apos;
REQUIRE X509
  AND SUBJECT &apos;/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Johan Smith&apos;
  AND ISSUER &apos;/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Some CA&apos;;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289286</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289286r1319421_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>high</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must enforce authorized access to all Public Key Infrastructure (PKI) private keys stored/used by the MySQL Database Server 9.x.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The DoW standard for authentication is DoW-approved PKI certificates. PKI certificate-based authentication is performed by requiring the certificate holder to cryptographically prove possession of the corresponding private key.

If the private key is stolen, an attacker can use it to impersonate the certificate holder. In cases where the database management system (DBMS)-stored private keys are used to authenticate the DBMS to the system&apos;s clients, loss of the corresponding private keys would allow an attacker to successfully perform undetected man-in-the-middle attacks against the DBMS and its clients.

Both the holder of a digital certificate, and the issuing authority, must take careful measures to protect the corresponding private key. Private keys must always be generated and protected in FIPS 140-3 validated cryptographic modules.  

All access to the private key(s) of the DBMS must be restricted to authorized and authenticated users. If unauthorized users have access to one or more of the DBMS&apos;s private keys, an attacker could gain access to the key(s) and use them to impersonate the database on the network or otherwise perform unauthorized actions.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the DBMS configuration to determine whether appropriate access controls exist to protect the DBMS&apos;s private key. 

If strong access controls do not exist to enforce authorized access to the private key, this is a finding.

MySQL stores certificates in Privacy-Enhanced Mail (PEM)-formatted files.

Verify user ownership, group ownership, and permissions on the ssl_files:
select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_crl, @@ssl_crlpath, @@ssl_fips_mode, @@ssl_key;

If &quot;ssl_path&quot; or &quot;ssl_crlpath&quot; are not defined, the locations default to the &quot;datadir&quot;.  

To determine the datadir:
select @@datadir;

If the path is &quot;&lt;directory where audit log files are located&gt;/&quot;, run:
sudo sh -c &apos;ls -l  &lt;directory where data files are located&gt;/*.pem&apos;

For example, if the value returned by &quot;select @@datadir;&quot; is &quot;/usr/local/mysql/data/&quot;, the command would be:
sudo sh -c &apos;ls -l   /usr/local/mysql/data/*.pem&apos;

Password:
-rw-------  1 _mysql  _mysql  1676 Feb 25 11:09  &lt;directory where audit log files are located&gt;/ca-key.pem
-rw-r--r--  1 _mysql  _mysql  1112 Feb 25 11:09  &lt;directory where audit log files are located&gt;/ca.pem
-rw-r--r--  1 _mysql  _mysql  1112 Feb 25 11:09  &lt;directory where audit log files are located&gt;/client-cert.pem
-rw-------  1 _mysql  _mysql  1680 Feb 25 11:09  &lt;directory where audit log files are located&gt;/client-key.pem
-rw-------  1 _mysql  _mysql  1676 Feb 25 11:09  &lt;directory where audit log files are located&gt;/private_key.pem
-rw-r--r--  1 _mysql  _mysql   452 Feb 25 11:09  &lt;directory where audit log files are located&gt;/public_key.pem
-rw-r--r--  1 _mysql  _mysql  1112 Feb 25 11:09  &lt;directory where audit log files are located&gt;/server-cert.pem
-rw-------  1 _mysql  _mysql  1680 Feb 25 11:09  &lt;directory where audit log files are located&gt;/server-key.pem

If the user owner is not &quot;mysql&quot;, this is a finding. 

If the group owner is not &quot;mysql&quot;, this is a finding.

For public certs and keys, permissions should be &quot;rw&quot; for mysql and &quot;readonly&quot; for mysql group and world. These files, by default, are named &quot;ca.pem&quot;, &quot;client-cert.pem&quot;, &quot;public_key.pem&quot;, and &quot;server-cert.pem&quot;. If not, this is a finding.

For private certs and keys, permissions should be &quot;rw&quot; for mysql and &quot;no rights&quot; for mysql group or world. These files, by default, are named &quot;ca-key.pem&quot;, &quot;client-key.pem&quot;, &quot;private_key.pem&quot;, and &quot;server-key.pem&quot;. If not, this is a finding.

Review system configuration to determine whether FIPS 140-3 support has been enabled. 

select @@ssl_fips_mode;

- OFF: Disable FIPS mode.
- ON: Enable FIPS mode.
- STRICT: Enable &quot;strict&quot; FIPS mode.

If FIPS mode is not &quot;ON&quot; or &quot;STRICT&quot;, this is a finding.

If the &quot;server-key.pem&quot; has a password, verify when starting mysqld in a console there is prompt requiring the passphrase for the server key.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Implement strong access and authentication controls to protect the database&apos;s private key.

Configure the database to support Transport Layer Security (TLS) protocols and the put in place file system permissions on authentication and signing credentials, including private keys.

Put keys in place in the datadir, or define their locations using &quot;ssl_capath&quot; and &quot;ssl_crlpath&quot;.

Ensure proper permissions are set to protect the private keys and certificates.

Change directory &quot;ssl_capath&quot;, &quot;ssl_crlpath&quot;, or the default &quot;datadir&quot; path.

To determine the file paths:
select @@ssl_capath, @@ssl_crlpath, @@ssl_key, @@datadir;

Ensure OS account mysql owns all the pem and key files:
$ chown mysql *.pem
$ chgrp mysql *.key
$ chmod 600 *.key&quot;
$ chmod 600 *.pem

Optionally, allow access to public keys:
$ chmod 644 client-cert.pem client-key.pem
$chmod 644 public_key.pem server-cert.pem

If the &quot;server-key.pem&quot; has a password, provide this password when prompted during console startup. The server will not start without this password if the server key is password protected.

Edit the mysql configuration file:
[mysqld]
ssl-fips-mode=ON

If the OpenSSL FIPS object module is not available, setting &quot;ssl_fips_mode&quot; to &quot;ON&quot; or &quot;STRICT&quot; at startup causes the server to produce an error message and exit.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289287</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289287r1318782_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must map the Public Key Infrastructure (PKI)-authenticated identity to an associated user account.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The DoW standard for authentication is DoW-approved PKI certificates. Once a PKI certificate has been validated, it must be mapped to a database management system (DBMS) user account for the authenticated identity to be meaningful to the DBMS and useful for authorization decisions.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review MySQL Database Server 9.x configuration to verify DBMS user accounts are being mapped directly to unique identifying information within the validated PKI certificate.

Confirm &quot;Issuer&quot; and &quot;Subject&quot; map to the username. Run the following script:
SELECT `user`.`Host`,
    `user`.`User`,
    `user`.`ssl_type`,
    CAST(`user`.`x509_issuer` as CHAR) as Issuer,
    CAST(`user`.`x509_subject` as CHAR) as Subject
FROM `mysql`.`user`;

If user accounts are not being mapped to authenticated identities, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL Database Server 9.x to map the authenticated identity directly to the MySQL Database Server 9.x user account.

Alter users to require X509 certificates.

Below is an example to add X509 as a requirement.

For a new user:
CREATE USER &apos;jeffrey&apos;@&apos;localhost&apos; REQUIRE X509;
AND SUBJECT &apos;/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Johan Smith&apos;
  AND ISSUER &apos;/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Some CA&apos;;

Or, to add to an existing user:
ALTER USER &apos;johansmith&apos;@&apos;%&apos;
REQUIRE X509
  AND SUBJECT &apos;/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Johan Smith&apos;
  AND ISSUER &apos;/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Some CA&apos;;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289288</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289288r1319203_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>high</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If MySQL authentication using passwords is employed, the database management system (DBMS) must enforce the DoW standards for password complexity and lifetime.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>OS/enterprise authentication and identification must be used (SRG-APP-000023-DB-000001). Native DBMS authentication may be used only when circumstances make it unavoidable; and must be documented and authorizing official (AO)-approved.

The DoW standard for authentication is DoW-approved PKI certificates. Authentication based on user ID and password may be used only when it is not possible to employ a Public Key Infrastructure (PKI) certificate, and requires AO approval.

In such cases, the DoW standards for password complexity and lifetime must be implemented. DBMS products that can inherit the rules for these from the operating system or access control program (e.g., Microsoft Active Directory) must be configured to do so. For other DBMSs, the rules must be enforced using available configuration parameters or custom code.

Satisfies: SRG-APP-000164-DB-000401, SRG-APP-000860-DB-000250</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If DBMS authentication using passwords is not employed, this is not applicable.

If the DBMS is configured to inherit password complexity and lifetime rules from the OS or access control program, this is not a finding.

Review the MySQL Database Server 9.x settings relating to password complexity. Determine whether the following rules are enforced:
a. Minimum of 15 characters, including at least one of each of the following character sets:
- Uppercase.
- Lowercase.
- Numeric.
- Special characters (e.g., ~ ! @ # $ % ^ &amp; * ( ) _ + = - &apos; [ ] / ? &gt; &lt;).
b. Minimum number of characters changed from previous password: 50 percent of the minimum password length; that is, eight.

Review the DBMS settings relating to password lifetime. Determine whether the following rules are enforced. If any are not, this is a finding.
a. Password lifetime limits for interactive accounts: Minimum 24 hours, maximum 60 days.
b. Password lifetime limits for noninteractive accounts: Minimum 24 hours, maximum 365 days.
c. Number of password changes before an old one may be reused: Minimum of five.

Connect as an admin and run the following command:
SELECT component_urn FROM mysql.component
where component_urn=&apos;file://component_validate_password&apos; group by component_urn;

If the &quot;validate password&quot; component is installed, the result will be &quot;file://component_validate_password&quot;.

If &quot;validate password&quot; component is not installed, this is a finding.

If the &quot;component_validate_password&quot; is installed, review the password policies to ensure required password complexity is met. 

Run the following to review the password policy:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables where VARIABLE_NAME like &apos;valid%password%&apos; or VARIABLE_NAME like &apos;password_%&apos;  ;

For example, the results may look like the following:
&apos;validate_password.check_user_name&apos;,&apos;ON&apos;
&apos;validate_password.dictionary_file&apos;,&apos;&apos;
&apos;validate_password.length&apos;,&apos;15&apos;
&apos;validate_password.mixed_case_count&apos;,&apos;1&apos;
&apos;validate_password.number_count&apos;,&apos;1&apos;
&apos;validate_password.policy&apos;,&apos;STRONG&apos;
&apos;validate_password.special_char_count&apos;,&apos;1&apos;
&apos;password_reuse_interval&apos;,&apos;0&apos;
&apos;password_require_current&apos;,&apos;OFF&apos;
&apos;password_history&apos;,&apos;0&apos;

If these results do not meet password complexity requirements listed above, this is a finding.

Additionally, if MySQL 9.x uses runtime-configurable password transformation rounds or iteration controls, review the configured value and verify it meets the organization-defined minimum. Verify only authorized administrators can modify runtime password-transformation parameters and that procedures exist to detect unauthorized weakening of the setting. If the configured rounds/iteration value is below the approved minimum, or if unauthorized principals can change it, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If the use of passwords is not needed, configure the MySQL Database Server 9.x to prevent their use if it is capable of this; if it is not so capable, institute policies and procedures to prohibit their use.

If the MySQL Database Server 9.x can inherit password complexity rules from the operating system or access control program, configure it to do so.

Otherwise, use MySQL Database Server 9.x configuration parameters and/or custom code to enforce the following rules for passwords:
a. Minimum of 15 characters, including at least one of each of the following character sets:
- Uppercase.
- Lowercase.
- Numeric.
- Special characters (e.g., ~ ! @ # $ % ^ &amp; * ( ) _ + = - &apos; [ ] / ? &gt; &lt;).
b. Minimum number of characters changed from previous password: 50 percent of the minimum password length; that is, eight.
c. Password lifetime limits for interactive accounts: Minimum 24 hours, maximum 60 days.
d. Password lifetime limits for noninteractive accounts: Minimum 24 hours, maximum 365 days.
e. Number of password changes before an old one may be reused: Minimum of five.

As the database admin:
INSTALL COMPONENT &apos;file://component_validate_password&apos;;

Set Password Policies. For example:
set persist validate_password.check_user_name=&apos;ON&apos;;
set persist validate_password.dictionary_file=&apos;&lt;FILENAME OF DICTIONARY FILE&apos;;
set persist validate_password.length=15;
set persist validate_password.mixed_case_count=1;
set persist validate_password.special_char_count=1;
set persist validate_password.number_count=1;
set persist validate_password.policy=&apos;STRONG&apos;;
set persist password_history = 5;
set persist password_reuse_interval = 365;
SET GLOBAL default_password_lifetime = 180;

Optional:
set persist password_require_current=YES

This can also be set at the account level:
ALTER USER &apos;jeffrey&apos;@&apos;localhost&apos;
  PASSWORD HISTORY 5
  PASSWORD REUSE INTERVAL 365 DAY;
ALTER USER &apos;jeffrey&apos;@&apos;localhost&apos; PASSWORD EXPIRE INTERVAL 90 DAY;

Configure MySQL 9.x password transformation rounds or iteration controls to meet the organization-defined minimum and restrict the ability to change those settings to authorized administrators only. Implement monitoring and review procedures to detect unauthorized runtime weakening of the password transformation setting.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289289</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289289r1319205_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If passwords are used for authentication, the MySQL Database Server 9.x must store only hashed, salted representations of passwords.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If passwords are used for authentication, storing weak or insufficiently hardened password representations increases the risk of offline credential compromise. Password verifiers must be salted and transformed using approved, policy-compliant mechanisms that resist brute-force and dictionary attacks.

MySQL Database Server 9.x adds stronger password transformation options. Where available and required by policy, locally managed passwords should be stored using the stronger PBKDF2 with SHA-512 format rather than relying only on the legacy CRYPT5 with SHA-256 behavior. The server&apos;s serialized representation identifies the transformation used, allowing auditors to verify whether stronger password storage is in use.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation to determine which accounts use passwords managed internally by MySQL.

Review locally managed MySQL accounts and their authentication plugins:
SELECT User, Host, plugin, authentication_string
FROM mysql.user
WHERE plugin IN (&apos;caching_sha2_password&apos;, &apos;sha256_password&apos;);

MySQL stores internally managed credentials in the mysql.user table. For &quot;caching_sha2_password&quot;, the password is transformed before it is stored in the &quot;authentication_string&quot; column.

Verify the configured password storage settings:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME IN
(
  &apos;caching_sha2_password_storage_format&apos;,
  &apos;caching_sha2_password_enforce_storage_format&apos;,
  &apos;caching_sha2_password_digest_rounds&apos;
);

For MySQL 9.7, &quot;caching_sha2_password&quot; supports the following password storage formats:
- CRYPT5 using SHA-256.
- PBKDF2_SHA512 using PBKDF2 with SHA-512.

If the organization requires PBKDF2 with SHA-512, verify &quot;caching_sha2_password_storage_format&quot; is set to &quot;PBKDF2_SHA512&quot;.

If organizational policy requires the configured storage format to be enforced for all &quot;caching_sha2_password&quot; accounts, verify &quot;caching_sha2_password_enforce_storage_format&quot; is enabled. When enforcement is enabled, an account using a different storage format is forced to change its password so it can be stored using the configured format.

Verify that locally managed password accounts do not contain clear-text passwords or passwords stored using an authentication mechanism that does not provide the required one-way salted transformation.

If locally managed passwords are stored in clear text, reversibly encrypted form, or without the required salted one-way password transformation, this is a finding.

If organizational policy requires PBKDF2_SHA512 and the server is not configured to use and, where required, enforce that storage format, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL 9.x to store locally managed passwords only as approved salted one-way transformations. Where available and required by policy, configure the server to use the PBKDF2 with SHA-512 password storage format rather than the legacy CRYPT5 with SHA-256 format.

Configure the password rounds or iteration control to meet the organization-defined minimum and restrict the ability to change that setting to authorized administrators only.

Reset or rotate passwords for accounts still stored using the legacy representation so the credentials are regenerated using the approved format. Remove or disable any mechanisms that store passwords in clear text, reversibly encrypted form, or other nonapproved formats.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289290</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289290r1319208_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>high</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If passwords are used for authentication, the MySQL Database Server 9.x must transmit only encrypted representations of passwords.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The DoW standard for authentication is DoW-approved Public Key Infrastructure (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, passwords must be protected at all times, and encryption is the standard method for protecting passwords during transmission.

Database management system (DBMS) passwords sent in clear text format across the network are vulnerable to discovery by unauthorized users. Disclosure of passwords may easily lead to unauthorized access to the database.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review configuration settings for encrypting passwords in transit across the network. If passwords are not encrypted, this is a finding. 

If it is determined that passwords are passed unencrypted at any point along the transmission path between the source and destination, this is a finding.

To check, run the following SQL:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME IN (&apos;require_secure_transport&apos;) ;

If the &quot;require_secure_transport VARIABLE_VALUE&quot; is not &quot;ON&quot; (1), this is a finding.

If &quot;ON&quot; (1), then only SSL connections are permitted; next examine the certificate used.

Run the following command to determine the certificate in use, along with other details:
select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_crl, @@ssl_crlpath, @@ssl_fips_mode, @@ssl_key;

If the certificate is not a DoW certificate, or if no certificate is listed, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure encryption for transmission of passwords across the network. If the database does not provide encryption for logon events natively, employ encryption at the operating system or network level.

Ensure passwords remain encrypted from source to destination.

Connect to MySQL as admin (root):
mysql&gt; set persist require_secure_transport=ON;

Set system variables on the server side to specify DoW-approved certificate and key files the server uses when permitting clients to establish encrypted connections:
- ssl_ca: The path name of the Certificate Authority (CA) certificate file. (ssl_capath is similar, but specifies the path name of a directory of CA certificate files.)
- ssl_cert: The path name of the server public key certificate file. This certificate can be sent to the client and authenticated against the CA certificate that it has.
- ssl_key: The path name of the server private key file.

For example, to enable the server for encrypted connections with certificates, start it with these lines in the &quot;my.cnf&quot; file, changing the file names as necessary:
[mysqld]
ssl_ca=ca.pem
ssl_cert=server-cert.pem
ssl_key=server-key.pem</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289291</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289291r1319211_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>high</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must obscure feedback of authentication information during the authentication process to protect the information from possible exploitation/use by unauthorized individuals.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The DoW standard for authentication is DoW-approved Public Key Infrastructure (PKI) certificates.

Normally, with PKI authentication, the interaction with the user for authentication will be handled by a software component separate from the database management system (DBMS), such as ActivIdentity ActivClient. However, in cases where the DBMS controls the interaction, this requirement applies.

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

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

Displaying asterisks when a user types in a password or a smart card PIN is an example of obscuring feedback of authentication secrets.

For MySQL tools, which can accept a plain-text password, and any other essential tool with the same limitation:
1. Document the need for it, who uses it, and any relevant mitigations, and obtain authorizing official (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 by using the &quot;-p&quot; without the password option. The user will then be prompted and the password obfuscated.
3. Make use of operating system pluggable password manager integration to protect passwords using keyrings.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If all interaction with the user for purposes of authentication is handled by a software component separate from the MySQL Database Server 9.x, this is not a finding.

If any application, tool, or feature associated with the MySQL Database Server 9.x/database displays any authentication secrets (to include PINs and passwords) during or after the authentication process, this is a finding.

MySQL command line option &quot;--password&quot; (or &quot;-p&quot;) obscures feedback on the typed in password. 

Ensure users are trained to use alternatives to command line password parameters, if they are not, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Modify and configure each noncompliant application, tool, or feature associated with the MySQL Database Server 9.x/database so that it does not display authentication secrets.

Use &quot;-p&quot; (&quot;--password&quot;) without providing a password for the MySQL command line tool.

Configure or modify applications to prohibit display of passwords in clear text.

Use operating system pluggable password manager integration to protect passwords using keyrings. 

Following is an example:
$ /usr/local/mysql/bin/mysql -uroot -p
Enter password:

$ mysqlsh --user=user --password
Please provide the password for &apos;user@localhost&apos;:</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289292</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289292r1319213_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>high</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must enforce approved authorizations for logical access to information and system resources in accordance with applicable access control policies.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Authentication with a DoW-approved Public Key Infrastructure (PKI) certificate does not necessarily imply authorization to access the database management system (DBMS). To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DoW-approved PKIs, all DoW systems, including databases, must be properly configured to implement access control policies. 

Successful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement. 

Access control policies include identity-based policies, role-based policies, and attribute-based policies. Access enforcement mechanisms include access control lists, access control matrices, and cryptography. These policies and mechanisms must be employed by the application to control access between users (or processes acting on behalf of users) and objects (e.g., devices, files, records, processes, programs, and domains) in the information system. 

This requirement is applicable to access control enforcement applications, a category that includes DBMSs. If the DBMS does not follow applicable policy when approving access, it may be in conflict with networks or other applications in the information system. This may result in users either gaining or being denied access inappropriately and in conflict with applicable policy.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Check MySQL settings to determine whether users are restricted from accessing objects and data they are not authorized to access.

Review the system documentation to determine the required levels of protection for DBMS server securables by type of login. Review the permissions actually in place on the server. 

If the actual permissions do not match the documented requirements, this is a finding. 

The following tables contain access control data. Run these scripts:

For information about database-level privileges (the server uses the user and db tables in the mysql database at both the first and second stages of access control):
SELECT * FROM mysql.db;
SELECT * FROM mysql.user;

During the second stage of access control, the server performs request verification to ensure each client has sufficient privileges for each request it issues. 

These provide finer privilege control at the table and column levels:
SELECT * FROM mysql.tables_priv;
SELECT * FROM mysql.columns_priv;

For verification of requests that involve stored routines:
SELECT * FROM mysql.procs_priv;

For information about proxy accounts:
SELECT * from mysql.proxies_priv;

Lists current assignments of dynamic global privileges to user accounts:
SELECT * from mysql.global_grants;

Lists default user roles:
SELECT * FROM mysql.default_roles;

Lists edges for role subgraphs, showing roles assigned to other roles hierarchy:
SELECT * FROM mysql.role_edges;

To inspect permissions on specific table(s):
WITH
  tableprivs AS (SELECT user, host, &apos;mysql.tables_priv&apos; as PRIV_SOURCE , DB as _db, Table_Name as _obj , &apos; &apos; as _col FROM mysql.tables_priv where Table_name like &apos;%&apos; ),
  colprivs AS (SELECT User, Host, &apos;mysql.columns_priv&apos; as PRIV_SOURCE , DB as _db, table_name as _obj , column_name as _col FROM mysql.columns_priv WHERE Table_name like &apos;%&apos; )
SELECT user,host, PRIV_SOURCE , _db as _db, _obj, _col FROM
(
SELECT user,host, PRIV_SOURCE, _db, _obj, _col FROM colprivs UNION
SELECT user,host, PRIV_SOURCE, _db, _obj, _col FROM tableprivs) as tt group by user, host, PRIV_SOURCE, _db, _obj, _col;

To inspect privileges for a specific user, role, or user using role, run one of the following commands:

User or role:
SHOW GRANTS FOR &apos;app_developer&apos;@&apos;%&apos;;

User with role:
SHOW GRANTS FOR &apos;u1&apos;@&apos;localhost&apos; USING &apos;r1&apos;;

If appropriate access controls are not implemented to restrict access to authorized users and to restrict the access of those users to objects and data they are authorized to see, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL Database Server 9.x settings and access controls to permit user access only to objects and data that the user is authorized to view or interact with, and to prevent access to all other objects and data.

Use &quot;GRANT&quot;, &quot;REVOKE&quot;, and &quot;ALTER&quot; statements to add and remove permissions on server-level securables, bringing them into line with the documented requirements.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289294</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289294r1318803_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Default demonstration and sample databases, database objects, and applications must be removed.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Information systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions).

It is detrimental for software products to provide, or install by default, functionality exceeding requirements or mission objectives. Examples include, but are not limited to, installing advertising software, demonstrations, or browser plugins not related to requirements or providing a wide array of functionality, not required for every mission, that cannot be disabled.

Database management systems (DBMSs) must adhere to the principles of least functionality by providing only essential capabilities.

Demonstration and sample database objects and applications present publicly known attack points for malicious users. These demonstration and sample objects are meant to provide simple examples of coding specific functions and are not developed to prevent vulnerabilities from being introduced to the DBMS and host system.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review vendor documentation and vendor websites to identify vendor-provided demonstration or sample databases, database applications, objects, and files. Note: MySQL does not include any in MySQL Database Server 9.x.

Review the MySQL Database Server 9.x to determine if any of the demonstration and sample databases, database applications, or files are installed in the database or are included with the MySQL Database Server 9.x application. If any are present in the database or are included with the MySQL Database Server 9.x application, this is a finding.

Check database/schema content of MySQL with the following command:
SELECT * FROM information_schema.SCHEMATA where SCHEMA_NAME not in (&apos;mysql&apos;,&apos;information_schema&apos;, &apos;sys&apos;, &apos;performance_schema&apos;);

If this system is identified as production, gather a listing of databases from the server and look for any matching the following general demonstration database names: 
sakila
world
world_x
menagerie

If any of these databases exist, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>MySQL 9.x contains no demonstration databases by default.

If demonstration or sample schemas have been added and are not required, remove them.

Connect to MySQL using an account authorized to remove the schema.

Then execute:
DROP DATABASE `schema_name`;

Replace `schema_name` with the name of the demonstration or sample database to be removed.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289295</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289295r1319215_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Unused database components, MySQL Database Server 9.x software, and database objects must be removed.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Information systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions).

It is detrimental for software products to provide, or install by default, functionality exceeding requirements or mission objectives. 

Database management systems (DBMSs) must adhere to the principles of least functionality by providing only essential capabilities.

Satisfies: SRG-APP-000141-DB-000091, SRG-APP-000141-DB-000092</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the list of components and features installed with the MySQL Database Server 9.x.

List optional MySQL plugins and components:
SELECT * FROM information_schema.PLUGINS where plugin_library is NOT NULL;

Compare the feature listing against the required plugins listing. 

If any plugins are installed, but are not required, this is a finding.

SELECT * FROM mysql.component;

Compare the feature listing against the required components listing. 

If any components are installed, but are not required, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Uninstall unused components or features that are installed and can be uninstalled. Remove any database objects and applications that are installed to support them.

After review of installed plugin components, uninstall unused plugins. To do this while the server is running using the &quot;UNINSTALL PLUGIN;&quot; command: 

Remove any plugin that is loaded at startup from the my.cnf file.

For example, if &quot;ddl_rewriter&quot; is discovered but not being used, follow these removal instructions:
Remove this line from &quot;my.cnf&quot;:
plugin-load-add=ddl_rewriter.so

Remove any plugin that is not loaded at startup using the &quot;--plugin-load&quot; parameter from the &quot;my.cnf&quot; or on the command line:
UNINSTALL PLUGIN &lt;plugin_name&gt;;
UNINSTALL PLUGIN ddl_rewriter;

Remove any component not in use:
UNINSTALL COMPONENT component_name [, component_name ] ...;

For example, if the audit message emit function is not being called, the component is not needed:
UNINSTALL COMPONENT &quot;file://component_audit_api_message_emit&quot;;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289297</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289297r1318812_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must uniquely identify and authenticate organizational users (or processes acting on behalf of organizational users).</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>To ensure accountability and prevent unauthenticated access, organizational users must be identified and authenticated to prevent potential misuse and compromise of the system. 

Organizational users include organizational employees or individuals the organization deems to have equivalent status of employees (e.g., contractors). Organizational users (and any processes acting on behalf of users) must be uniquely identified and authenticated for all accesses, except the following:

(i) Accesses explicitly identified and documented by the organization. Organizations document specific user actions that can be performed on the information system without identification or authentication; and 
(ii) Accesses that occur through authorized use of group authenticators without individual authentication. Organizations may require unique identification of individuals in group accounts (e.g., shared privilege accounts) or for detailed accountability of individual activity.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review MySQL Database Server 9.x settings to determine whether organizational users are uniquely identified and authenticated when logging on/connecting to the system. 

Using SQL, search for external authentication plugins:
SELECT PLUGIN_NAME, PLUGIN_STATUS
       FROM INFORMATION_SCHEMA.PLUGINS
       WHERE PLUGIN_NAME LIKE &apos;%ldap%&apos; OR PLUGIN_NAME LIKE &apos;%ldap%&apos; OR PLUGIN_NAME LIKE &apos;%pam%&apos;;

This listing will show what is enabled. 

In addition to MySQL password-based internal accounts, there is also support for external accounts:
- Linux PAM (Pluggable Authentication Modules).
- Windows Active Directory (only for Windows MySQL servers).
- Native LDAP.
- auth_socket.

Review the configuration of the plugin; for link of accounts and permissions to organizational level, run this SQL:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME LIKE &apos;auth%&apos; ;

This will show external configuration setup for authentication using an organizational authentication source.

Review users using organizational authentication. Review the &quot;authentication_string&quot; for proper mapping:
SELECT `user`.`Host`,
    `user`.`user`,
    `user`.`plugin`,
    `user`.`authentication_string`
    from mysql.user where plugin like &apos;auth%&apos;;

If organizational users are not uniquely identified and authenticated, this is a finding.

If accounts are determined to be shared, determine if they are directly accessible to end users. If so, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL Database Server 9.x settings to uniquely identify and authenticate all organizational users who log on/connect to the system.

Remove user-accessible shared accounts and use individual usernames. 

Configure applications to ensure successful individual authentication prior to shared account access. 

Ensure each user&apos;s identity is received and used in audit data in all relevant circumstances.

Install appropriate auth plugin. For example, LDAP:
INSTALL PLUGIN authentication_ldap_sasl
  SONAME &apos;authentication_ldap_sasl.so&apos;;
INSTALL PLUGIN authentication_ldap_simple
  SONAME &apos;authentication_ldap_simple.so&apos;;

Configure:
SET PERSIST authentication_ldap_sasl_server_host=&apos;127.0.0.1&apos;;
SET PERSIST authentication_ldap_sasl_bind_base_dn=&apos;dc=example,dc=com&apos;;
SET PERSIST authentication_ldap_simple_server_host=&apos;127.0.0.1&apos;;
SET PERSIST authentication_ldap_simple_bind_base_dn=&apos;dc=example,dc=com&apos;;

Create users with proper organizational mapping. For example:
CREATE USER &apos;betsy&apos;@&apos;localhost&apos;
  IDENTIFIED WITH authentication_ldap_simple
  BY &apos;uid=betsy_ldap,ou=People,dc=example,dc=com&apos;;

Assign appropriate roles and grants.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289298</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289298r1319217_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>high</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must use National Institute of Standards and Technology (NIST) FIPS 140-3-validated cryptographic modules for cryptographic operations.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Use of weak or not validated cryptographic algorithms undermines the purposes of utilizing encryption and digital signatures to protect data. Weak algorithms can be easily broken and not validated cryptographic modules may not implement algorithms correctly. Unapproved cryptographic modules or algorithms should not be relied on for authentication, confidentiality, or integrity. Weak cryptography could allow an attacker to gain access to and modify data stored in the database as well as the administration settings of the database management system (DBMS).

Applications, including DBMSs, utilizing cryptography are required to use approved NIST FIPS 140-3-validated cryptographic modules that meet the requirements of applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance.

The security functions validated as part of FIPS 140-3 for cryptographic modules are described in FIPS 140-3 Annex A.

National Security Agency (NSA) Type-X (where X=1, 2, 3, 4) products are NSA-certified, hardware-based encryption modules.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the DBMS configuration to verify it is using NIST FIPS 140-3-validated cryptographic modules for cryptographic operations.

To check for FIPS validated cryptographic modules for all operations, run this script in the database: 
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables where variable_name = &apos;ssl_fips_mode&apos;;

The result will be either &quot;ON&quot; or &quot;STRICT&quot;. If not, then NIST FIPS 140-3-validated modules are not being used, and this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Use NIST FIPS 140-3-validated cryptographic modules for all cryptographic operations.

Use MySQL Server OpenSSL FIPS mode. Refer to https://dev.mysql.com/doc/refman/9.7/en/fips-mode.html for more information.

Turn on MySQL FIPS mode and restart &quot;mysqld&quot;:
Edit my.cnf
[mysqld]
ssl_fips_mode=ON

or:
[mysqld]
ssl_fips_mode=STRICT

ON: Enable FIPS mode.
STRICT: Enable &quot;strict&quot; FIPS mode.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289299</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289299r1319114_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must uniquely identify and authenticate nonorganizational users (or processes acting on behalf of nonorganizational users).</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Nonorganizational users include all information system users other than organizational users, which include organizational employees or individuals the organization deems to have equivalent status of employees (e.g., contractors, guest researchers, individuals from allied nations). 

Nonorganizational users will be uniquely identified and authenticated for all accesses other than those accesses explicitly identified and documented by the organization when related to the use of anonymous access, such as accessing a web server.

Accordingly, a risk assessment is used in determining the authentication needs of the organization. 

Scalability, practicality, and security are simultaneously considered in balancing the need to ensure ease of use for access to federal information and information systems with the need to protect and adequately mitigate risk to organizational operations, organizational assets, individuals, other organizations, and the Nation.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review MySQL Database Server 9.x settings to determine if users uniquely identify and authenticate all nonorganizational users who log on to the system:
select host, user FROM mysql.user WHERE user not in (&apos;mysql.infoschema&apos;, &apos;mysql.session&apos;, &apos;mysql.sys&apos;);

If accounts are determined to be shared, determine if individuals are first individually authenticated. 

If the documentation indicates that this is a public-facing, read-only (from the point of view of public users) database that does not require individual authentication, this is not a finding. 

If nonorganizational users are not uniquely identified and authenticated, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL Database Server 9.x settings to uniquely identify and authenticate all nonorganizational users who log on to the system.

Ensure all logins are uniquely identifiable and authenticate all nonorganizational users who log on to the system. This would likely be done by ensuring mapping of MySQL accounts to individual accounts. Verify server documentation to ensure accounts are documented and unique.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289300</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289300r1318821_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must separate user functionality (including user interface services) from database management functionality.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Information system management functionality includes functions necessary to administer databases, network components, workstations, or servers, and typically requires privileged user access. 

The separation of user functionality from information system management functionality is either physical or logical and is accomplished by using different computers, different central processing units, different instances of the operating system, different network addresses, combinations of these methods, or other methods, as appropriate. 

An example of this type of separation is observed in web administrative interfaces that use separate authentication methods for users of any other information system resources. 

This may include isolating the administrative interface on a different domain and with additional access controls.

If administrative functionality or information regarding DBMS management is presented on an interface available for users, information on DBMS settings may be inadvertently made available to the user.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Check MySQL settings and documentation to verify that administrative functionality is separate from user functionality.

As the Database Administrator (DBA) (&quot;root&quot;), list all roles and permissions for the database:
&gt; mysql -u root -p

SELECT user,host, &apos;Global Priv&apos;, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv,
    Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv,
    Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv,
    Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv,
    Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv,
    Create_routine_priv, Alter_routine_priv, Create_user_priv,
    Event_priv, Trigger_priv, Create_tablespace_priv, Create_role_priv,
    Drop_role_priv 
  FROM mysql.user WHERE &apos;Y&apos; IN
    (Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv,
    Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv,
    Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv,
    Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv,
    Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv,
    Create_routine_priv, Alter_routine_priv, Create_user_priv,
    Event_priv, Trigger_priv, Create_tablespace_priv, Create_role_priv,
    Drop_role_priv)
AND user not in (&apos;mysql.infoschema&apos;, &apos;mysql.session&apos;);

If any nonadministrative role has permissions other than mysql.infoschema and mysql.session, this is a finding.

If administrator and general user functionality are not separated, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL Database Server 9.x to separate database administration and general user functionality.

Revoke or remove users with admin and user mixed permissions.

Review MySQL documentation related to access controls for users and admins:
https://dev.mysql.com/doc/refman/9.7/en/access-control.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289301</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289301r1319140_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must isolate security functions from nonsecurity functions.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>An isolation boundary provides access control and protects the integrity of the hardware, software, and firmware that perform security functions. 

Security functions are the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based.

Developers and implementers can increase the assurance in security functions by employing well-defined security policy models; structured, disciplined, and rigorous hardware and software development techniques; and sound system/security engineering principles. 

Database management systems (DBMSs) typically separate security functionality from nonsecurity functionality via separate databases or schemas. Database objects or code implementing security functionality must not be commingled with objects or code implementing application logic. When security and nonsecurity functionality are commingled, users who have access to nonsecurity functionality may be able to access security functionality.

The mysql database is the system database, which contains tables that store information required by the MySQL server as it runs.

The INFORMATION_SCHEMA provides access to database metadata, information about the MySQL server such as the name of a database or table, the data type of a column, or access privileges. Other terms sometimes used for this information are data dictionary and system catalog.

The MySQL Performance Schema is a feature for monitoring MySQL Server execution at a low level that provides a way to inspect internal execution of the server at runtime. It is implemented using the PERFORMANCE_SCHEMA storage engine and the performance_schema database. The PERFORMANCE_SCHEMA storage engine collects event data using &quot;instrumentation points&quot; in server source code. Tables in the Performance Schema are in-memory tables that use no persistent on-disk storage.

MySQL 9.x includes the sys schema, a set of objects that helps database administrators (DBAs) and developers interpret data collected by the Performance Schema. The sys schema objects can be used for typical tuning and diagnosis use cases.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Determine elements of security functionality (lists of permissions, additional authentication information, stored procedures, application-specific auditing, etc.) housed inside the MySQL server.

For any elements found, check MySQL to determine if these objects or code implementing security functionality are located in a separate security domain, such as a separate database, schema, or table created specifically for security functionality.

In more generic data terms, MySQL is a single database per instance with multiple schemas. MySQL uses the term database and schema interchangeably. 

Run the following query to list all the user-defined schemas:
SELECT 
    `SCHEMATA`.`SCHEMA_NAME`
FROM `information_schema`.`SCHEMATA` 
where `SCHEMA_NAME` not in (&apos;mysql&apos;, &apos;information_schema&apos;, &apos;performance_schema&apos;,&apos;sys&apos;);

Review the database structure to determine where security-related functionality is stored. 

If security-related database objects or code are not kept separate, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Check the server documentation to locate security-related database objects and code in a separate database, schema, table, or other separate security domain from database objects and code implementing application logic. 

Schemas, also referred to as databases, are analogous to separate namespaces or containers used to store database objects. Security permissions apply to schemas, making them an important tool for separating and protecting database objects based on access rights. Schemas reduce the work required and improve the flexibility for security-related administration of a database. A MySQL schema is a named container for database objects, which allows objects to be grouped into separate namespaces.

Where possible, locate security-related database objects and code in a separate database, schema, or other separate security domain from database objects and code implementing application logic. In all cases, use GRANT, REVOKE, … , DROP ROLE statements to add and remove permissions on administrative/server-level and schema/database-level, or database object security-related objects to provide effective isolation.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289302</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289302r1319219_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Database contents must be protected from unauthorized and unintended information transfer by enforcement of a data-transfer policy.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Database content can be exposed through direct queries, alternate tools, or application paths even when applications attempt to suppress or transform sensitive data. Where policy requires masking of protected data elements in query results, relying only on application-side masking is insufficient because alternate query paths may still reveal the original values.

MySQL Database Server 9.x can enforce masking within the server by applying masking policies to protected columns. A masking policy can evaluate organization-authorized users and/or organization-authorized active roles and return either the original value or a transformed value. Server-enforced masking provides consistent behavior across applications and query paths and reduces the risk of unauthorized disclosure of protected data such as Social Security Numbers (SSNs), Personally Identifiable Information (PII), Protected Health Information (PHI), and other sensitive elements designated by policy.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation to identify tables and columns containing sensitive data elements that are required by policy to be masked in query results.

Review the MySQL 9.x configuration and metadata for protected columns. Verify that each sensitive column requiring masking has an approved masking policy applied at the server level.

Review masking policy definitions to verify that masking is based on organization-authorized users and/or organization-authorized active roles. Verify that unauthorized sessions receive masked values and only organization-authorized users or sessions with organization-authorized active roles are able to receive unmasked values.

Review the applied policy logic for each protected column. Examples of acceptable gatekeeper logic include CURRENT_USER_IN(&quot;organization-authorized user&quot;) and CURRENT_ROLE_IN(&quot;organization-authorized role&quot;). Examples of acceptable masking functions include &quot;mask_ssn()&quot; or other approved transformations appropriate to the data type.

Example verification workflow:
1. Review the masking policy definition for the protected column.
2. Review the &quot;ALTER TABLE...ALTER COLUMN...SET MASKING POLICY&quot; statement or equivalent metadata.
3. Query the protected data as an unauthorized user or a session without the required active role and verify the returned value is masked.
4. Query the protected data as an organization-authorized user or a session with the required active role and verify the returned value is unmasked only when policy permits.

If a sensitive column requiring masking has no server-enforced masking policy, this is a finding.

If unauthorized sessions receive unmasked values, this is a finding.

If masking is implemented only in application code and not enforced by MySQL for data designated by policy to require masking, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>For each sensitive column designated by policy for masking, define and apply a MySQL 9.x masking policy that returns the original value only for organization-authorized users and/or organization-authorized active roles and returns a transformed value for all other sessions.

Example user-based masking policy:
CREATE MASKING POLICY mask_ssn_policy(ssn_col)
  CASE WHEN CURRENT_USER_IN(&apos;organization-authorized user&apos;)
       THEN ssn_col
       ELSE mask_ssn(ssn_col)
  END;

Apply the policy to the protected column:
ALTER TABLE protected.user_profiles
  ALTER COLUMN ssn
  SET MASKING POLICY mask_ssn_policy;

Example role-based masking policy:
CREATE MASKING POLICY mask_ssn_policy(ssn_col)
  CASE WHEN CURRENT_ROLE_IN(&apos;organization-authorized role&apos;)
       THEN ssn_col
       ELSE mask_ssn(ssn_col)
  END;

Grant access to the organization-authorized role only to approved users and activate the role in accordance with site policy. Retest by querying the protected column as both authorized and unauthorized sessions and verify that unauthorized sessions receive masked output and authorized sessions receive unmasked output only as permitted.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289304</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289304r1319075_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Access to database files must be limited to relevant processes and to authorized, administrative users.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Applications, including database management systems (DBMSs), must prevent unauthorized and unintended information transfer via shared system resources. Permitting only DBMS processes and authorized, administrative users to have access to the files where the database resides helps ensure that those files are not shared inappropriately and are not open to backdoor access and manipulation.

As a general rule, distributed files and resources should follow the principle of least privilege, which requires that users, processes, programs, and other system components only have access to information and resources required for their legitimate purpose.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation and identify the operating system locations used by MySQL for database files, logs, audit logs, keys, and backup files.

Review the permissions and ownership of these directories and files using operating system commands such as:
ls -ld &lt;directory&gt;
ls -l &lt;directory&gt;

or:
stat &lt;file-or-directory&gt;

Verify that access is limited to the MySQL service account, authorized system administrators, authorized database administrators, and any specifically authorized backup or monitoring service accounts with a documented need for access.

For MySQL-managed files and directories on Linux/Unix systems, verify the following or more restrictive permissions, as applicable:
- MySQL data directories: Owned by mysql:mysql, permissions &quot;0750&quot; or more restrictive.
- MySQL database and log files: Owned by mysql:mysql, permissions &quot;0640&quot; or more restrictive.
- secure_file_priv/mysql-files directory: Owned by mysql:mysql, permissions &quot;0750&quot; or more restrictive.
- Private key files: Accessible only to the MySQL service account and authorized administrators; MySQL-generated private keys use permissions &quot;0600&quot;.
- Audit log directories must be accessible only to the MySQL server and users with a legitimate requirement to view the audit logs.

If a MySQL database file, log file, audit file, key file, or backup file is accessible by an unauthorized operating system user or group, this is a finding.

If a MySQL-managed directory or file has permissions more permissive than required for its documented function without an approved justification, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure operating system ownership and permissions so that MySQL database files and related resources are accessible only to the MySQL service account and authorized administrative or service accounts with a documented need for access.

For a standard Linux/Unix MySQL installation, set MySQL-managed data directories to ownership &quot;mysql:mysql&quot; and permissions to &quot;0750&quot; or more restrictive:
chown mysql:mysql &lt;mysql_directory&gt;
chmod 750 &lt;mysql_directory&gt;

Set MySQL-managed database and log files to ownership &quot;mysql:mysql&quot; and permissions to &quot;0640&quot; or more restrictive:
chown mysql:mysql &lt;mysql_file&gt;
chmod 640 &lt;mysql_file&gt;

For MySQL private key files, restrict access to the MySQL service account:
chown mysql:mysql &lt;private_key_file&gt;
chmod 600 &lt;private_key_file&gt;

Where backup, audit, or other files are owned by a separate authorized service account, configure ownership according to the documented service account and restrict permissions to that account, MySQL where required, and authorized administrators.

Remove permissions granted to unauthorized users or groups.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289306</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289306r1319222_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must maintain the authenticity of communications sessions by guarding against man-in-the-middle attacks that guess at Session ID values.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>One class of man-in-the-middle, or session hijacking, attack involves the adversary guessing at valid session identifiers based on patterns in identifiers already known.

The preferred technique for thwarting guesses at Session IDs is the generation of unique session identifiers using a FIPS 140-3-approved random number generator.

However, it is recognized that available database management system (DBMS) products do not all implement the preferred technique, yet may have other protections against session hijacking. Therefore, other techniques are acceptable, provided they are demonstrated to be effective.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Determine if MySQL is configured to require SSL:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME like &apos;require_secure_transport&apos;;

If &quot;require_secure_transport&quot; is not &quot;ON&quot;, this is a finding.

Determine if MySQL is configured to require the use of FIPS-compliant algorithms:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME = &apos;ssl_fips_mode&apos;;

If &quot;ssl_fips_mode&quot; is not &quot;ON&quot;, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Connect as a mysql administrator:
mysql&gt; set persist require_secure_transport=ON;

Turn on MySQL FIPS mode (&quot;ON&quot; or &quot;STRICT&quot;) and restart mysqld:
Edit my.cnf
[mysqld]
ssl_fips_mode=ON
or
ssl_fips_mode=STRICT</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289308</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289308r1319296_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>high</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must protect the confidentiality and integrity of all information at rest.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>This control is intended to address the confidentiality and integrity of information at rest in nonmobile devices and covers user information and system information. Information at rest refers to the state of information when it is located on a secondary storage device (e.g., disk drive, tape drive) within an organizational information system. Applications and application users generate information throughout the course of their application use. 

User data generated, as well as application-specific configuration data, needs to be protected. Organizations may choose to employ different mechanisms to achieve confidentiality and integrity protections, as appropriate. 

If the confidentiality and integrity of application data is not protected, the data will be open to compromise and unauthorized modification.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Apply appropriate controls to protect the confidentiality and integrity of data at rest in the database.

Review the system documentation and verify the encryption settings applicable to the MySQL installation.

Run:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME IN (
    &apos;audit_log.encryption&apos;,
    &apos;binlog_encryption&apos;,
    &apos;innodb_redo_log_encrypt&apos;,
    &apos;innodb_undo_log_encrypt&apos;,
    &apos;general_log&apos;,
    &apos;table_encryption_privilege_check&apos;
);

Verify the following:
- audit_log.encryption is set to &quot;AES&quot;.
- binlog_encryption is set to &quot;ON&quot;.
- innodb_redo_log_encrypt is set to &quot;ON&quot;.
- innodb_undo_log_encrypt is set to &quot;ON&quot;.
- general_log is set to &quot;OFF&quot;, unless use of the general query log and protection of the resulting log data are specifically documented and approved.
- table_encryption_privilege_check is set to &quot;ON&quot;.

For this MySQL 9.x STIG, use the MySQL Enterprise Audit component variable &quot;audit_log.encryption&quot;.

Review the encryption status of InnoDB tablespaces:
SELECT NAME, ENCRYPTION
FROM information_schema.INNODB_TABLESPACES;

For each tablespace identified by the organization as requiring encryption, verify that &quot;ENCRYPTION&quot; is &quot;Y&quot;.

If any required data-at-rest encryption setting is not configured as required, or a tablespace requiring encryption is not encrypted, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Reorder or reinstall the components so the keyring loads first.

When audit log encryption is enabled, the audit log component requires an active MySQL keyring during component initialization. Configure the organization-approved keyring component for early startup before the audit log component initializes.

For &quot;component_keyring_file&quot;, create a JSON manifest named &quot;mysqld.my&quot; in the same directory where mysqld is installed:
{
  &quot;components&quot;: &quot;file://component_keyring_file&quot;
}

Create &quot;component_keyring_file.cnf&quot; in the MySQL plugin directory and configure the approved keyring data file location. The keyring data file must not be located in the MySQL data directory. Example:
{
  &quot;path&quot;: &quot;/usr/local/mysql/keyring/component_keyring_file.keys&quot;,
  &quot;read_only&quot;: false
}

Set the manifest and configuration file permissions so they are readable only as required by the MySQL service account. Restart MySQL and verify that the keyring initialized successfully before continuing:
SELECT STATUS_KEY, STATUS_VALUE
FROM performance_schema.keyring_component_status;

The &quot;Component_status&quot; value must be &quot;Active&quot;. If it is not &quot;Active&quot;, correct the JSON manifest, keyring configuration, file permissions, or error log condition before enabling audit encryption.

If MySQL Enterprise Audit was installed before the keyring was configured for early loading, reorder the startup configuration or reinstall MySQL Enterprise Audit after the keyring is &quot;Active&quot;. Use the supported component uninstall and installation scripts from the MySQL share directory so the audit component and its related objects are installed together:
mysql -u root -p -D mysql &lt; audit_log_component_filter_uninstall.sql
mysql -u root -p -D mysql &lt; audit_log_component_filter_install.sql

Configure the audit component to initialize at server startup with encryption enabled:
[mysqld]
audit-log=FORCE_PLUS_PERMANENT
audit-log.encryption=AES

Restart MySQL. Verify that the keyring is &quot;Active&quot;, &quot;file://component_audit_log&quot; is present in &quot;mysql.component&quot;, &quot;audit_log.encryption&quot; is &quot;AES&quot;, and the server error log contains no keyring service or audit component initialization errors.

Enable binary log encryption only after the keyring is &quot;Active&quot;:
SET PERSIST binlog_encryption = ON;

Enable redo- and undo-log encryption:
SET PERSIST innodb_redo_log_encrypt = ON;
SET PERSIST innodb_undo_log_encrypt = ON;

Enable encryption for a new file-per-table tablespace:
CREATE TABLE t1 (c1 INT) ENCRYPTION=&apos;Y&apos;;

Enable encryption for an existing file-per-table tablespace:
ALTER TABLE t1 ENCRYPTION=&apos;Y&apos;;

Set table-encryption privilege enforcement when required:
SET PERSIST table_encryption_privilege_check = ON;

Disable the general query log unless its use and protection are explicitly approved:
SET PERSIST general_log = OFF;

If MySQL fails to start, restore the previous configuration and review the server error log before retrying.

References:
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-logging-configuration.html
https://dev.mysql.com/doc/refman/9.7/en/keyring-file-component.html
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-installation.html
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-logging-configuration.html</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289309</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289309r1318848_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must check the validity of all data inputs except those specifically identified by the organization.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Invalid user input occurs when a user inserts data or characters into an application&apos;s data entry fields and the application is unprepared to process that data. This results in unanticipated application behavior, potentially leading to an application or information system compromise. Invalid user input is one of the primary methods employed when attempting to compromise an application.

With respect to database management systems, one class of threat is known as SQL Injection, or more generally, code injection. It takes advantage of the dynamic execution capabilities of various programming languages, including dialects of SQL. Potentially, the attacker can gain unauthorized access to data, including security settings, and severely corrupt or destroy the database.

Even when no such hijacking takes place, invalid input that gets recorded in the database, whether accidental or malicious, reduces the reliability and usability of the system. Available protections include data types, referential constraints, uniqueness constraints, range checking, and application-specific logic. Application-specific logic can be implemented within the database in stored procedures and triggers, where appropriate.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review MySQL Database Server 9.x code (stored procedures, functions, triggers), application code, settings, column and field definitions, triggers, and constraints to determine whether the database is protected against invalid input. If code exists that allows invalid data to be acted upon or input into the database, this is a finding.

If column/field definitions do not exist in the database, this is a finding.

If columns/fields do not contain constraints and validity checking where required, this is a finding.

Where a column/field is noted in the system documentation as necessarily free-form, even though its name and context suggest that it should be strongly typed and constrained, the absence of these protections is not a finding.

Where a column/field is clearly identified by name, caption or context as Notes, Comments, Description, Text, etc., the absence of these protections is not a finding.

MySQL Workbench Schema and Table Inspectors are effective tools for performing the review process, as are the MySQL Information Schema, and MySQL Schema tables.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Use parameterized queries, constraints, foreign keys, etc., to validate data input.

Modify MySQL to properly use the correct column data types as required in the database.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289310</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289310r1318851_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x and associated applications must reserve the use of dynamic code execution for situations that require it.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>With respect to database management systems, one class of threat is known as SQL Injection, or more generally, code injection. It takes advantage of the dynamic execution capabilities of various programming languages, including dialects of SQL. In such cases, the attacker deduces the manner in which SQL statements are being processed, either from inside knowledge or by observing system behavior in response to invalid inputs. When the attacker identifies scenarios where SQL queries are being assembled by application code (which may be within the database or separate from it) and executed dynamically, the attacker is then able to craft input strings that subvert the intent of the query. Potentially, the attacker can gain unauthorized access to data, including security settings, and severely corrupt or destroy the database.

The principal protection against code injection is not to use dynamic execution except where it provides necessary functionality that cannot be used otherwise. Use strongly typed data items rather than general-purpose strings as input parameters to task-specific, pre-compiled stored procedures and functions (and triggers).</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review MySQL source code (trigger procedures, functions) and application source code, to identify cases of dynamic code execution. Any user input should be handled through prepared statements or calls that bind parameters versus generating SQL.

If dynamic code execution is employed in circumstances where the objective could practically be satisfied by static execution with strongly typed parameters, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Where dynamic code execution is employed in circumstances where the objective could practically be satisfied by static execution with strongly typed parameters, modify the code to do so.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289311</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289311r1319079_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x and associated applications, when making use of dynamic code execution, must scan input data for invalid values that may indicate a code injection attack.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>With respect to database management systems, one class of threat is known as SQL Injection, or more generally, code injection. It takes advantage of the dynamic execution capabilities of various programming languages, including dialects of SQL. In such cases, the attacker deduces the manner in which SQL statements are being processed, either from inside knowledge or by observing system behavior in response to invalid inputs. When the attacker identifies scenarios where SQL queries are being assembled by application code (which may be within the database or separate from it) and executed dynamically, the attacker is then able to craft input strings that subvert the intent of the query. Potentially, the attacker can gain unauthorized access to data, including security settings, and severely corrupt or destroy the database.

The principal protection against code injection is not to use dynamic execution except where it provides necessary functionality that cannot be used otherwise. Use strongly typed data items rather than general-purpose strings as input parameters to task-specific, pre-compiled stored procedures and functions (and triggers).

When dynamic execution is necessary, ways to mitigate the risk include the following, which should be implemented both in the on-screen application and at the database level, in the stored procedures:
- Allow strings as input only when necessary. 
- Rely on data typing to validate numbers, dates, etc. Do not accept invalid values. If substituting other values for them, think carefully about whether this could be subverted.
- Limit the size of input strings to what is truly necessary.
- If single quotes/apostrophes, double quotes, semicolons, equal signs, angle brackets, or square brackets will never be valid as input, reject them.
- If comment markers will never be valid as input, reject them. In SQL, these are -- or /*  */ .
- If HTML and XML tags, entities, comments, etc., will never be valid, reject them.
- If wildcards are present, reject them unless truly necessary. In SQL these are the underscore and the percentage sign. The word &quot;ESCAPE&quot; is also a clue that wildcards are in use.
- If SQL keywords, such as SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, ESCAPE, UNION, GRANT, REVOKE, DENY, and MODIFY will never be valid, reject them. Use case-insensitive comparisons when searching for these. Bear in mind that some of these words, particularly Grant (as a person&apos;s name), could also be valid input. 
- If there are range limits on the values that may be entered, enforce those limits.
- Institute procedures for inspection of programs for correct use of dynamic coding, by a party other than the developer.
- Conduct rigorous testing of program modules that use dynamic coding, searching for ways to subvert the intended use.
- Record the inspection and testing in the system documentation.
- Bear in mind that all this applies not only to screen input, but also to the values in an incoming message to a web service or to a stored procedure called by a software component that has not itself been hardened in these ways. Not only can the caller be subject to such vulnerabilities; it may itself be the attacker.

The MySQL Firewall runs within the MySQL server and enables database administrators to permit or deny SQL statement execution based on matching against allowlists of accepted statement patterns. This hardens MySQL Server against attacks such as SQL injection or attempts to exploit applications by using them outside of their legitimate query workload characteristics.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review MySQL Database Server 9.x source code (stored procedures, functions, and triggers) and application source code to identify cases of dynamic code execution.

Determine if the MySQL Enterprise Firewall is installed and trained to recognize normal behavior and block or alert abnormal requests. Run the following command:
SHOW GLOBAL VARIABLES LIKE &apos;mysql_firewall_mode&apos;;

Review firewall users and mode:
SELECT * FROM INFORMATION_SCHEMA.MYSQL_FIREWALL_USERS;

If no rows are returned and no firewall allow lists are active, this is a finding.

If LEARNING is returned, the firewall is building an allowlist for the userhost user.

If PROTECTING is returned, the firewall will only permit SQL on the allowlist for the userhost user to execute.

If DETECTING is returned, the firewall will write to the firewall log SQL, not on the allowlist for the userhost user to execute.
 
If dynamic code execution is employed without protective measures against code injection, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Where dynamic code execution is used, modify the code to implement protections against code injection. 

Enable the MySQL Enterprise Firewall by running this script, which is located in the mysql home share sub directory:
mysql -u root -p mysql &lt; linux_install_firewall.sql

Train the firewall for users where dynamic code injection is possible; for example, applications that allow user input:
CALL mysql.sp_set_firewall_mode(&apos;fwuser@localhost&apos;, &apos;RECORDING&apos;);

Once the allowlist for the user/host has been captured, the firewall can be placed in PROTECTING (active blocking) or DETECTING(logging) mode:
CALL mysql.sp_set_firewall_mode(&apos;fwuser@localhost&apos;, &apos;PROTECTING&apos;);
CALL mysql.sp_set_firewall_mode(&apos;fwuser@localhost&apos;, &apos;DETECTING&apos;);</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289314</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289314r1319225_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must initiate session auditing upon startup.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Session auditing is for use when a user&apos;s activities are under investigation. To be sure of capturing all activity during those periods when session auditing is in use, it needs to be in operation for the whole time the database management system (DBMS) is running.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Determine whether MySQL Enterprise Audit is configured to load automatically and is enabled.

Verify that the MySQL Enterprise Audit component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

If no row is returned, this is a finding.

Components registered in mysql.component are loaded by MySQL at server startup.

Verify that audit logging has not been disabled:
SHOW GLOBAL VARIABLES LIKE &apos;audit_log.disable&apos;;

If audit_log.disable is ON, this is a finding.

Review the configured audit filters and associated users:
SELECT NAME, FILTER
FROM mysql.audit_log_filter;

SELECT USER, HOST, FILTERNAME
FROM mysql.audit_log_user;

If no organization-required audit filters are configured or assigned, this is a finding.

If organizational policy requires MySQL startup to fail when the Audit Log component cannot initialize, verify the following startup setting is configured:
[mysqld]
audit-log=FORCE_PLUS_PERMANENT

Refer to https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-installation.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL Enterprise Audit using the Audit Log component so it is loaded automatically when MySQL starts.

Install the component using the supported installation script in the MySQL share directory:
audit_log_component_filter_install.sql

For example:
mysql -u root -p -D mysql &lt; /usr/share/mysql-9.7/audit_log_component_filter_install.sql

Verify installation:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

Components registered in mysql.component are loaded automatically during MySQL startup.

To prevent runtime removal and require MySQL startup to fail if the Audit Log component cannot initialize, configure:
[mysqld]
audit-log=FORCE_PLUS_PERMANENT

Configure the organization-required audit filters and assignments. For example, to create a default filter that logs all events:
SELECT audit_log_filter_set_filter(&apos;log_all&apos;, &apos;{ &quot;filter&quot;: { &quot;log&quot;: true } }&apos;);
SELECT audit_log_filter_set_user(&apos;%&apos;, &apos;log_all&apos;);

Refer to: 
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-installation.html
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-filtering.html</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289316</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289316r1319227_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must protect its audit features from unauthorized access.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Protecting audit data also includes identifying and protecting the tools used to view and manipulate log data. 

Depending upon the log format and application, system and application log tools may provide the only means to manipulate and manage application and system log data. Therefore, it is imperative that access to audit tools be controlled and protected from unauthorized access. 

Applications providing tools to interface with audit data will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys to make access decisions regarding the access to audit tools.

Audit tools include, but are not limited to, operating system-provided audit tools, vendor-provided audit tools, and open source audit tools needed to successfully view and manipulate audit information system activity and records. 

If an attacker were to gain access to audit tools, they could analyze audit logs for system weaknesses or weaknesses in the auditing itself. An attacker could also manipulate logs to hide evidence of malicious activity.

Satisfies: SRG-APP-000121-DB-000202, SRG-APP-000123-DB-000204</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Check users with permissions to administer MySQL Auditing:
select * from information_schema.user_privileges where privilege_type = &apos;AUDIT_ADMIN&apos;;

If unauthorized accounts have the &quot;AUDIT_ADMIN&quot; privilege, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Remove audit-related permissions from individuals and roles not authorized to have them:
REVOKE AUDIT_ADMIN on *.* FROM &lt;user&gt;;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289317</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289317r1319230_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must protect its audit configuration from unauthorized modification.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Protecting audit data also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit data.

Applications providing tools to interface with audit data will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys to make access decisions regarding the modification of audit tools.

Audit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Check users with permissions to administer MySQL auditing:
SELECT *
FROM information_schema.user_privileges
WHERE privilege_type = &apos;AUDIT_ADMIN&apos;;

If unauthorized accounts have the &quot;AUDIT_ADMIN&quot; privilege, this is a finding.

Verify an approved keyring component is installed and active:
SELECT STATUS_KEY, STATUS_VALUE
FROM performance_schema.keyring_component_status;

Verify the results include:
Component_status    Active

If the table is empty or the keyring component status is not &quot;Active&quot;, this is a finding.

MySQL 9.x keyring components are preferred over the deprecated keyring plugins. The &quot;keyring_component_status&quot; table reports status information for the keyring component currently in use.

Check whether MySQL Enterprise Audit log files are encrypted:
SHOW GLOBAL VARIABLES LIKE &apos;audit_log.encryption&apos;;

The value must be &quot;AES&quot;.

If &quot;audit_log.encryption&quot; is not set to &quot;AES&quot;, this is a finding.

For this MySQL 9.x STIG, use the MySQL Enterprise Audit component variable &quot;audit_log.encryption&quot;.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Remove audit-related permissions from individuals and roles not authorized to administer MySQL auditing:
REVOKE AUDIT_ADMIN ON *.* FROM &lt;user&gt;;

Protect the audit and keyring startup configuration from unauthorized modification.

1. Configure the organization-approved keyring component for early loading with the active global or local mysqld.my JSON manifest. The manifest loads the keyring component; do not add &quot;component_audit_log&quot; to the keyring manifest.

Example for functional testing with &quot;component_keyring_file&quot;:
{
  &quot;components&quot;: &quot;file://component_keyring_file&quot;
}

2. Create and protect the selected keyring component configuration file. Example &quot;component_keyring_file.cnf&quot;:
{
  &quot;path&quot;: &quot;/usr/local/mysql/keyring/component_keyring_file.keys&quot;,
  &quot;read_only&quot;: false
}

3. Set ownership and permissions so only authorized operating system administrators can modify &quot;mysqld.my&quot;, the keyring component configuration, the keyring data, MySQL option files, and the audit component installation files. Grant the MySQL service account only the access required to read the configuration and use the keyring.

4. Restart MySQL and verify the keyring service is active before configuring encrypted audit logging:
SELECT STATUS_KEY, STATUS_VALUE
FROM performance_schema.keyring_component_status;

The &quot;Component_status&quot; value must be &quot;Active&quot;.

5. Install or reinstall the MySQL Enterprise Audit component through the supported audit component installation procedure after the keyring service is available. Verify &quot;file://component_audit_log&quot; is registered in &quot;mysql.component&quot; and that the audit variables and functions are available.

6. When audit log encryption is required, configure the component setting only after the keyring is active:
[mysqld]
audit-log.encryption=AES

Restart MySQL and verify the encryption setting and audit operation. If startup fails, remove the new encryption setting, restore service, correct the manifest or keyring configuration, and retry.

Production deployments must use an organization-approved key-management solution. File-based keyring components may be used for functional testing only when permitted.

References:
https://dev.mysql.com/doc/refman/9.7/en/keyring-component-installation.html
https://dev.mysql.com/doc/refman/9.7/en/keyring-file-component.html
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-installation.html
https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-logging-configuration.html</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289318</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289318r1319233_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must limit privileges to change software modules, to include stored procedures, functions and triggers, and links to software external to the MySQL Database Server 9.x.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If the system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process.

Accordingly, only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.

Unmanaged changes that occur to the database software libraries or configuration can lead to unauthorized or compromised installations.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation to identify the authorized users and groups permitted to modify MySQL software modules, binary files, plugin libraries, and component libraries.

Review the operating system ownership and permissions for the MySQL binary and shared software library locations.

If unauthorized users or groups have modify access to these files or directories, this is a finding.

Review table-specific privileges that permit installation or removal of MySQL plugins or components:
SELECT GRANTEE, TABLE_SCHEMA, TABLE_NAME, PRIVILEGE_TYPE
FROM information_schema.TABLE_PRIVILEGES
WHERE TABLE_SCHEMA = &apos;mysql&apos;
  AND TABLE_NAME IN (&apos;plugin&apos;, &apos;component&apos;)
  AND PRIVILEGE_TYPE IN (&apos;INSERT&apos;, &apos;DELETE&apos;);

&quot;INSERT&quot; on &quot;mysql.plugin&quot; permits installation of plugins, and &quot;DELETE&quot; permits their removal. 

&quot;INSERT&quot; and &quot;DELETE&quot; on &quot;mysql.component&quot;, similarly, permit installation and removal of components.

Also review global &quot;INSERT&quot; and &quot;DELETE&quot; privileges:
SELECT GRANTEE, PRIVILEGE_TYPE
FROM information_schema.USER_PRIVILEGES
WHERE PRIVILEGE_TYPE IN (&apos;INSERT&apos;, &apos;DELETE&apos;);

If an unauthorized account has privileges that permit modification of the &quot;mysql.plugin&quot; or &quot;mysql.component&quot; tables, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Remove permissions from users who should not have insert or update access to the &quot;mysql.plugin&quot; or &quot;mysql.component&quot; table.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289319</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289319r1318878_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x software installation account must be restricted to authorized users.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>When dealing with change control issues, it must be noted that any changes to the hardware, software, and/or firmware components of the information system and/or application can have significant effects on the overall security of the system. 

If the system were to allow any user to make changes to software libraries, those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process.

Accordingly, only qualified and authorized individuals must be allowed access to information system components for purposes of initiating changes, including upgrades and modifications.

Database Administrator (DBA) and other privileged administrative or application owner accounts are granted privileges that allow actions which can have a great impact on database security and operation. It is especially important to grant privileged access to only those persons who are qualified and authorized to use them.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review procedures for controlling and granting access to use of the database management system (DBMS) software installation account.

If access or use of this account is not restricted to the minimum number of personnel required, or if unauthorized access to the account has been granted, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Develop, document, and implement procedures to restrict and track use of the MySQL Database Server 9.x software installation account.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289320</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289320r1319298_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Database software, including MySQL Database Server 9.x configuration files, must be stored in dedicated directories, or Direct Access Storage Device (DASD) pools (remove), separate from the host operating system and other applications.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>When dealing with change control issues, it should be noted that any changes to the hardware, software, and/or firmware components of the information system and/or application can have significant effects on the overall security of the system. 

Multiple applications can provide a cumulative negative effect. A vulnerability and subsequent exploit to one application can lead to an exploit of other applications sharing the same security context. For example, an exploit to a web server process that leads to unauthorized administrative access to host system directories can most likely lead to a compromise of all applications hosted by the same system. Database software not installed using dedicated directories both threatens and is threatened by other hosted applications. Access controls defined for one application may, by default, provide access to the other application&apos;s database objects or directories. Any method that provides any level of separation of security context assists in the protection between applications.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the MySQL Database Server 9.x software library directory and note other root directories located on the same disk directory or any subdirectories.

To list directory variables, run:
show variables where variable_name like &apos;%dir%&apos;;

If any non-MySQL Database Server 9.x software directories exist on the &quot;datadir&quot;, &quot;basedir&quot;, or other non-&quot;tmpdir&quot; directories, examine or investigate their use. 

If any of the directories are used by other applications, including third-party applications that use the MySQL Database Server 9.x, this is a finding.

Only applications that are required for the functioning and administration, not use, of the MySQL Database Server 9.x should be located in the same disk directory as the DBMS software libraries. 

If other applications are located in the same directory as the database management system (DBMS), this is a finding.

To determine where the mysql configuration file(s) are being stored and which configuration file(s) was used for which variables, run the following command:
SELECT t1.*, VARIABLE_VALUE 
       FROM performance_schema.variables_info t1 
       JOIN performance_schema.global_variables t2 
         ON t2.VARIABLE_NAME=t1.VARIABLE_NAME where length(t1.variable_path) &gt; 0;

If the result of &quot;VARIABLE_PATH&quot; shows that configuration values are not stored in files dedicated to directories separate from the host operating system or other applications, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Install all applications on directories separate from the DBMS software library directory. Relocate any directories or reinstall other application software that currently shares the DBMS software library directory.

If it is determined that configuration (options files) are inappropriately located, take the steps to move and protect these files and reconfigure mysqld startup commands to point to new the file location by setting the &quot;--defaults-file&quot; to point to the new location and file name for the mysql configuration file.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289322</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289322r1319238_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The role(s)/group(s) used to modify database structure (including but not necessarily limited to tables, indexes, storage, etc.) and logic modules (stored procedures, functions, triggers, links to software external to the MySQL Database Server 9.x, etc.) must be restricted to authorized users.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If the database management system (DBMS) were to allow any user to make changes to database structure or logic, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process.

Accordingly, only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.

Unmanaged changes that occur to the database software libraries or configuration can lead to unauthorized or compromised installations.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>MySQL database objects do not have an owner. MySQL is a single instance and single database with multiple schemas (aliased to be called either schema or database). Permissions are based on schemas and schema objects and privileges include grants to objects or grants to allow users to further grant access to objects. To reiterate, there is not an object owner; just rights assigned to schemas and the objects within them.

To determine rights to objects via schema, table, or user privileges, run the following:
SELECT * FROM `information_schema`.`SCHEMA_PRIVILEGES`;
SELECT * FROM `information_schema`.`TABLE_PRIVILEGES`;
SELECT * FROM `information_schema`.`COLUMN_PRIVILEGES`;
SELECT * FROM `information_schema`.`USER_PRIVILEGES`;
SELECT * FROM `information_schema`.`ROLE_COLUMN_GRANTS`;
SELECT * FROM `information_schema`.`ROLE_TABLE_GRANTS`;

On a per-user basis, for example:
show grants for &apos;test&apos;@&apos;%&apos;; 

If any database objects are found to have access by users not authorized to the database objects, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Assign ownership of authorized objects to authorized object owner accounts.

Review user accounts with the &quot;GRANT OPTION&quot;. 

Use &quot;REVOKE GRANT OPTION&quot; to limit users with grant privileges.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289325</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289325r1319240_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must disable network functions, ports, protocols, and services deemed by the organization to be nonsecure, in accordance with the Ports, Protocols, and Services Management (PPSM) guidance.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Use of nonsecure network functions, ports, protocols, and services exposes the system to avoidable threats.

Satisfies: SRG-APP-000383-DB-000364, SRG-APP-000142-DB-000094</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The server must only use approved network communication libraries, ports, and protocols. 

Obtain a list of all approved network libraries, communication ports, and protocols from the server documentation. 

Verify that the protocols are enabled for the instance. 

Run the following SQL to list ports:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME in (&apos;port&apos;, &apos;mysqlx_port&apos;, &apos;admin_port&apos;);

The default ports for MySQL for organizational connects are Classic MySQL Protocol - 3306, MySQL X Protocol 33060, and MySQL Admin Port (disabled by default).

If these are in conflict with guidance, and not explained and approved in the system documentation, this is a finding.

Run the following to determine if a local socket/pipe are in use:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables where 
VARIABLE_NAME like &apos;%pipe%&apos; or  VARIABLE_NAME = &apos;socket&apos; or  VARIABLE_NAME = &apos;mysqlx_socket&apos;;

Values are for classic and xprotocol will be returned.

For example on Linux:
&apos;socket&apos;,&apos;/tmp/mysql.sock&apos;
&apos;mysqlx_socket&apos;,&apos;/tmp/mysqlx.sock&apos;
 Windows
&apos;named_pipe&apos;, &apos;ON&apos;;

If these are in conflict with guidance and not explained and approved in the system documentation, this is a finding.

Run the following statement to inspect port settings:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME LIKE &apos;%port%&apos; or VARIABLE_NAME LIKE &apos;%port&apos; order by  VARIABLE_NAME;

Linux local socket:
select @@socket;

Windows local pipe:
select @@named_pipe;

If any ports or protocols are used that are not specifically approved in the server documentation, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Disable each prohibited network function, port, protocol, or service prohibited by the PPSM guidance.

Change mysql options related to network, ports, and protocols for the server and additionally consider refining further at user account level.

To set ports properly, edit the mysql configuration file and change ports or protocol settings:
vi my.cnf
[mysqld]
port=&lt;port value&gt;
admin_port=&lt;port value&gt;
mysqlx_port=&lt;port value&gt;
socket=/path/to/socket

To turn off TCP/IP:
skip_networking=ON

If &quot;admin_address&quot; is not defined, then access via the admin port is disabled. 

Additionally, the X plugin can be disabled at startup/restart by either setting &quot;mysqlx=0&quot; in the MySQL configuration file, or by passing in either &quot;--mysqlx=0&quot; or &quot;--skip-mysqlx&quot; when starting the MySQL server.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289326</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289326r1319243_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must prohibit user installation of logic modules (stored procedures, functions, triggers, views, etc.) without explicit privileged status.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Allowing regular users to install software without explicit privileges creates the risk that untested or potentially malicious software will be installed on the system. Explicit privileges (escalated or administrative privileges) provide the regular user with explicit capabilities and controls that exceed the rights of a regular user.

Database management system (DBMS) functionality and the nature and requirements of databases will vary; so, while users are not permitted to install unapproved software, there may be instances where the organization allows the user to install approved software packages, such as from an approved software repository. The requirements for production servers will be more restrictive than those used for development and research.

The DBMS must enforce software installation by users based upon what types of software installations are permitted (e.g., updates and security patches to existing software) and what types of installations are prohibited (e.g., software whose pedigree with regard to being potentially malicious is unknown or suspect) by the organization. 

In the case of a DBMS, this requirement covers stored procedures, functions, triggers, views, etc.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>MySQL requires users (other than root) to be explicitly granted the &quot;CREATE ROUTINE&quot; privilege to install logical modules.

To obtain a listing of users and roles who are authorized to create, alter, or replace stored procedures and functions from the server documentation, execute the following query for server level permissions:
SELECT `user`.`Host`,
    `user`.`User`
FROM `mysql`.`user`
 where     `Create_routine_priv`=&apos;Y&apos; OR
    `Alter_routine_priv` = &apos;Y&apos;;

If any users or role permissions returned are not authorized to modify the specified object or type, this is a finding. 

If any user or role membership is not authorized, this is a finding.

For database schema level permission (db is the schema name):
SELECT `db`.`Host`,
    `db`.`User`,
    `db`.`Db`
FROM `mysql`.`db` where     `db`.`Create_routine_priv`=&apos;Y&apos; OR
    `db`.`Alter_routine_priv` = &apos;Y&apos;;

If any users or role permissions returned are not authorized to modify the specified object or type, this is a finding. 

If any user or role membership is not authorized, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>MySQL requires users (other than root) to be explicitly granted the &quot;CREATE ROUTINE&quot; privilege to install logical modules. 

Check user grants using the &quot;SHOW GRANTS&quot; and look for appropriate assignment of &quot;CREATE ROUTINE&quot;. 

For example:
REVOKE CREATE ROUTINE ON mydb.* TO &apos;someuser&apos;@&apos;somehost&apos;;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289327</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289327r1319300_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must enforce access restrictions associated with changes to the configuration of the MySQL Database Server 9.x or database(s).</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Failure to provide logical access restrictions associated with changes to configuration may have significant effects on the overall security of the system. 

When dealing with access restrictions pertaining to change control, it should be noted that any changes to the hardware, software, and/or firmware components of the information system can have significant effects on the overall security of the system. 

Accordingly, only qualified and authorized individuals should be allowed to obtain access to system components for the purpose of initiating changes, including upgrades and modifications.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the security configuration of the MySQL Database Server 9.x and database(s). If it does not enforce access restrictions associated with changes to the configuration of the MySQL Database Server 9.x or database(s), this is a finding.

MySQL configuration can be set two ways:
1. Via the mysql configuration file. This file must be owned and permissions to read or write to it limited to the mysql operating system user only. 
2. Via a &quot;SET&quot; command within the server itself. These commands may be limited by limiting &quot;server administration&quot; privileges. User privileges can be shown using the &quot;SHOW GRANTS [FOR user]&quot;. This data is written to &quot;mysqld-auto.cnf&quot; file.

Refer to the mysql secure configuration guide for more information.

Run the following command to check the mysql permissions on &quot;my.cnf&quot;: 
ls -l /etc/my.cnf

The permissions must be:
File or Resource                Location        Owner   Directory Permissions   File Permissions
MySQL configuration file        /etc/my.cnf     root    drwxr-xr-x              -rw-r--r--

If the permissions are more permissive than the above, this is a finding.

As of MySQL 9.x, configuration variables can also be set and changed using persist system variable settings that save to a file named &quot;mysqld-auto.cnf&quot;.

This file is in the mysql data directory. Refer to the example below.

 sudo ls -l /var/lib/mysql/mysqld-auto.cnf
-rw-r-----. 1 mysql mysql 933 Aug  3 12:51 /var/lib/mysql/mysqld-auto.cnf

If the permissions of the &quot;mysqld-auto.cnf&quot; are more permissive, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL Database Server 9.x to enforce access restrictions associated with changes to the configuration of the MySQL Database Server 9.x or database(s).

Check and change file permissions on the MySQL configuration file so the mysql operating system user owns the file and is the only user with read-write permissions. Use the &quot;SHOW GRANTS&quot; statements to audit who has &quot;SUPER&quot; permissions and remove any users with excess privileges.

For &quot;my.cnf&quot;, change ownership and permissions to:
File or Resource                Location        Owner   Directory Permissions   File Permissions
MySQL configuration file        /etc/my.cnf     root    drwxr-xr-x              -rw-r--r--

The &quot;mysqld-auto.cnf&quot; is created and managed by the mysql instance, as such permissions should be correct. If not correct, change &quot;owner&quot; to &quot;mysql&quot; and &quot;rw r&quot; to &quot;640&quot;.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289328</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289328r1319423_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must produce audit records of its enforcement of access restrictions associated with changes to the configuration of the MySQL Database Server 9.x or database(s).</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Without auditing the enforcement of access restrictions against changes to configuration, it would be difficult to identify attempted attacks and an audit trail would not be available for forensic investigation for after-the-fact actions. 

Enforcement actions are the methods or mechanisms used to prevent unauthorized changes to configuration settings. Enforcement action methods may be as simple as denying access to a file based on the application of file permissions (access restriction). Audit items may consist of lists of actions blocked by access restrictions or changes identified after the fact.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Determine if an audit is configured to capture denied actions.

Verify that the MySQL Enterprise Audit component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

If no row is returned, this is a finding.

Verify that audit logging has not been disabled:
SHOW GLOBAL VARIABLES LIKE &apos;audit_log.disable&apos;;

If &quot;audit_log.disable&quot; is &quot;ON&quot;, this is a finding.

Review audit filters and associated users by running the following queries:
SELECT `audit_log_filter`.`NAME`,
   `audit_log_filter`.`FILTER`
FROM `mysql`.`audit_log_filter`;

SELECT `audit_log_user`.`USER`,
   `audit_log_user`.`HOST`,
   `audit_log_user`.`FILTERNAME`
FROM `mysql`.`audit_log_user`;

All currently defined audits for the MySQL server instance will be listed. If no audits are returned, this is a finding.

Connect and run commands as a low-privilege user. For example, attempt to change system variables, user name, or another user&apos;s password, all of which should fail:
set persist wait_timeout=28000; 
rename user passme to cantchange;
SET PASSWORD FOR passme = &apos;sfsdfsdf&apos;;

Review the audit log and inspect event data containing identity and user subject details by running the Linux command:
sudo cat  &lt;directory where audit log files are located&gt;/audit.log

For example, if the values returned by the configured &quot;audit_log.file&quot; and &quot;datadir&quot; values are  &quot;/usr/local/mysql/data/&quot; and &quot;audit.log&quot;, run:
sudo cat  /usr/local/mysql/data/audit.log

{ &quot;timestamp&quot;: &quot;2020-08-31 20:10:21&quot;, &quot;id&quot;: 1, &quot;class&quot;: &quot;general&quot;, &quot;event&quot;: &quot;status&quot;, &quot;connection_id&quot;: 38, &quot;account&quot;: { &quot;user&quot;: &quot;fewconnects&quot;, &quot;host&quot;: &quot;localhost&quot; }, &quot;login&quot;: { &quot;user&quot;: &quot;fewconnects&quot;, &quot;os&quot;: &quot;&quot;, &quot;ip&quot;: &quot;127.0.0.1&quot;, &quot;proxy&quot;: &quot;&quot; }, &quot;general_data&quot;: { &quot;command&quot;: &quot;Query&quot;, &quot;sql_command&quot;: &quot;set_option&quot;, &quot;query&quot;: &quot;set persist wait_timeout=28000&quot;, &quot;status&quot;: 1227 } },
{ &quot;timestamp&quot;: &quot;2020-08-31 20:10:48&quot;, &quot;id&quot;: 1, &quot;class&quot;: &quot;general&quot;, &quot;event&quot;: &quot;status&quot;, &quot;connection_id&quot;: 38, &quot;account&quot;: { &quot;user&quot;: &quot;fewconnects&quot;, &quot;host&quot;: &quot;localhost&quot; }, &quot;login&quot;: { &quot;user&quot;: &quot;fewconnects&quot;, &quot;os&quot;: &quot;&quot;, &quot;ip&quot;: &quot;127.0.0.1&quot;, &quot;proxy&quot;: &quot;&quot; }, &quot;general_data&quot;: { &quot;command&quot;: &quot;Query&quot;, &quot;sql_command&quot;: &quot;rename_user&quot;, &quot;query&quot;: &quot;rename user passme to cantchange&quot;, &quot;status&quot;: 1227 } },
, &quot;host&quot;: &quot;localhost&quot; }, &quot;login&quot;: { &quot;user&quot;: &quot;fewconnects&quot;, &quot;os&quot;: &quot;&quot;, &quot;ip&quot;: &quot;127.0.0.1&quot;, &quot;proxy&quot;: &quot;&quot; }, &quot;general_data&quot;: { &quot;command&quot;: &quot;Query&quot;, &quot;sql_command&quot;: &quot;set_password&quot;, &quot;query&quot;: &quot;SET PASSWORD FOR `passme`@`%`=&lt;secret&gt;&quot;, &quot;status&quot;: 1044 } },

Note, each has a nonzero status, &quot;1227&quot;, &quot;1227&quot;, and &quot;1044&quot;, respectively.

If the audit log does not contain records of its enforcement of access restrictions associated with changes to the configuration of the database management system (DBMS) or database(s), this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If currently required, configure the MySQL Database Server to produce audit records when enforcement of access restrictions is associated with changes to the configuration of the DBMS or database(s).

Refer to the following link for more information: https://dev.mysql.com/doc/refman/9.7/en/audit-log-component.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289329</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289329r1319252_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must allocate audit record storage capacity in accordance with organization-defined audit record storage requirements.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>To ensure sufficient storage capacity for the audit logs, the database management system (DBMS) must be able to allocate audit record storage capacity. Although another requirement (SRG-APP-000515-DB-000318) mandates that audit data be off-loaded to a centralized log management system, it remains necessary to provide space on the database server to serve as a buffer against outages and capacity limits of the off-loading mechanism.

The task of allocating audit record storage capacity is usually performed during initial installation of the DBMS and is closely associated with the database administrator (DBA) and system administrator roles. The DBA or system administrator will usually coordinate the allocation of physical drive space with the application owner/installer and the application will prompt the installer to provide the capacity information, the physical location of the disk, or both.

In determining the capacity requirements, consider such factors as: total number of users; expected number of concurrent users during busy periods; number and type of events being monitored; types and amounts of data being captured; the frequency/speed with which audit records are off-loaded to the central log management system; and any limitations that exist on the DBMS&apos;s ability to reuse the space formerly occupied by off-loaded records.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Check the system documentation for the organization-defined audit record storage requirements.

Verify that the MySQL Enterprise Audit component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_audit_log&apos;;

If no row is returned, this is a finding.

Review the Audit Log component file location, rotation, and pruning settings:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME IN (
    &apos;audit_log.file&apos;,
    &apos;audit_log.rotate_on_size&apos;,
    &apos;audit_log.max_size&apos;,
    &apos;audit_log.prune_seconds&apos;,
    &apos;datadir&apos;
);

If &quot;audit_log.file&quot; contains an absolute path, use that file system location when assessing storage capacity. If &quot;audit_log.file&quot; contains only a file name, the audit log is located under &quot;datadir&quot;.

Determine whether the configured filesystem has sufficient capacity for the organization-defined audit retention and off-loading requirements.

If size-based pruning is used, review &quot;audit_log.rotate_on_size&quot; and &quot;audit_log.max_size&quot;. If age-based pruning is used, review &quot;audit_log.prune_seconds&quot; together with the rotation configuration.

If the configured storage capacity and Audit Log component rotation/pruning settings cannot support the organization-defined retention and off-loading requirements, this is a finding.

Refer to https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-logging-configuration.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Allocate sufficient storage for MySQL Enterprise Audit component log files in accordance with organization-defined audit record storage requirements.

Configure the Audit Log component file location at server startup as appropriate. For example:
[mysqld]
audit-log.file=/var/log/mysql/audit.log
audit-log.compression=GZIP

The Audit Log component writes audit files in JSON format.

Configure automatic rotation and pruning when required. For example, set organization-approved values for:
- audit_log.rotate_on_size
- audit_log.max_size
- audit_log.prune_seconds

Ensure the selected filesystem has sufficient capacity to buffer audit records during centralized logging outages and to satisfy the required local retention period.

Refer to https://dev.mysql.com/doc/refman/9.7/en/audit-log-component-logging-configuration.html.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289330</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289330r1319255_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must off-load audit data to a separate log management facility; this must be continuous and in near real time for systems with a network connection to the storage facility and weekly or more often for stand-alone systems.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Information stored in one location is vulnerable to accidental or incidental deletion or alteration.

Off-loading is a common process in information systems with limited audit storage capacity. 

The database management system (DBMS) may write audit records to database tables, to files in the file system, to other kinds of local repository, or directly to a centralized log management system. Whatever the method used, it must be compatible with off-loading the records to the centralized system.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation for a description of how MySQL Enterprise Audit records are off-loaded to a separate centralized log management facility.

Verify that an approved operating-system log shipper, Security Information and Event Management (SIEM) agent, supported audit-log integration, or other software is configured to transfer MySQL Enterprise Audit records to the centralized audit log repository.

For systems connected to the centralized repository, verify that audit records are transferred continuously and in near real time.

For stand-alone systems, verify that audit records are transferred at least weekly or more frequently as required by the organization.

Verify that the account or service performing the transfer has only the permissions required to read and transfer the audit records.

MySQL Enterprise Audit provides &quot;audit_log_read()&quot; for reading audit log records, which may be used by an approved integration or collector where appropriate.

Generate a known auditable event and verify that the corresponding audit record is transferred to and appears in the centralized repository within the organization-defined interval.

The MySQL &quot;log_sink_syseventlog&quot; component may be used to send the MySQL error log to the operating system syslog or system log. It does not transfer MySQL Enterprise Audit records and must not be used alone as evidence that this requirement is satisfied.

If the required audit records are not transferred to the centralized log management facility within the required interval, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Deploy and configure an approved operating-system log shipper, SIEM agent, supported audit log read integration, or other software to transfer MySQL Enterprise Audit records to a separate log management facility.

For connected systems, configure continuous near-real-time forwarding. For standalone systems, configure transfer at least weekly.

Do not use &quot;log_sink_syseventlog&quot; alone as evidence that the audit records are off-loaded; that component forwards the MySQL server error log, not the MySQL Enterprise Audit file.

Grant only the minimum file system and MySQL privileges needed by the collector. Configure audit log rotation and retention so peak activity does not exhaust local storage, and monitor collector health, delivery delay, and backlog.

Test the complete path by generating a known auditable event and confirming that it appears in the centralized repository within the organization-defined interval.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289331</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289331r1319257_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must provide a warning to appropriate support staff when allocated audit record storage volume reaches 75 percent of maximum audit record storage capacity.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Organizations are required to use a central log management system, so, under normal conditions, the audit space allocated to the database management system (DBMS) on its own server will not be an issue. However, space will still be required on the DBMS&apos;s server for audit records in transit, which could fill up under abnormal conditions. Since a requirement exists to halt processing upon audit failure, a service outage would result.

If support personnel are not notified immediately upon storage volume utilization reaching 75 percent, they are unable to plan for storage capacity expansion. 

The appropriate support staff include, at a minimum, the Information System Security Officer (ISSO) and the database administrator (DBA)/system administrator (SA).</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review operating system or third-party logging application settings to determine whether a warning will be provided when 75 percent of DBMS audit log storage capacity is reached.

If no warning will be provided, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Modify the operating system or third-party logging/monitoring application settings to alert appropriate support personnel when the storage volume containing the MySQL audit logs reaches 75 percent utilization.

The appropriate support personnel must include, at a minimum, the ISSO and DBA/SA, as required by the organization.

For example, on a Linux/Unix system, the following script checks the filesystem containing the MySQL audit log directory and generates a warning when utilization reaches or exceeds 75 percent:
#!/bin/sh

AUDIT_DIR=&quot;/path/to/mysql/audit&quot;

USAGE=$(df -P &quot;$AUDIT_DIR&quot; | awk &apos;NR==2 {gsub(/%/,&quot;&quot;,$5); print $5}&apos;)

if [ &quot;$USAGE&quot; -ge 75 ]; then
    logger -p user.warning -t mysql-audit-capacity \
        &quot;MySQL audit log storage has reached ${USAGE}% utilization.&quot;
    exit 1
fi

exit 0

Replace &quot;/path/to/mysql/audit&quot; with the directory containing the MySQL audit logs.

Schedule the script using the organization-approved scheduling mechanism and configure the operating system, centralized log management system, Security Information and Event Management (SIEM), or monitoring application to notify the appropriate support personnel when the &quot;mysql-audit-capacity&quot; warning is generated.

The example script may be replaced with an equivalent organization-approved monitoring solution that provides a warning at 75 percent utilization or lower.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289336</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289336r1319089_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must require users to reauthenticate when organization-defined circumstances or situations require reauthentication.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The DoW standard for authentication of an interactive user is the presentation of a common access card (CAC) or other physical token bearing a valid, current, DoW-issued Public Key Infrastructure (PKI) certificate, coupled with a Personal Identification Number (PIN) to be entered by the user at the beginning of each session and whenever reauthentication is required.

Without reauthentication, users may access resources or perform tasks for which they do not have authorization. 

When applications provide the capability to change security roles or escalate the functional capability of the application, it is critical the user reauthenticate.

In addition to the reauthentication requirements associated with session locks, organizations may require reauthentication of individuals and/or devices in other situations, including (but not limited to) the following circumstances:

(i) When authenticators change; 
(ii) When roles change; 
(iii) When security categories of information systems change; 
(iv) When the execution of privileged functions occurs; 
(v) After a fixed period of time; or
(vi) Periodically.

Within the DoW, the minimum circumstances requiring reauthentication are privilege escalation and role changes.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Determine all situations where a user must reauthenticate. Check if the mechanisms that handle such situations use the following SQL:

To make a single user reauthenticate, an existing connection must be present.

To search for a specific user:
SELECT * FROM information_schema.PROCESSLIST where user =&apos;&lt;name&gt; and host like &apos;%&apos;;

To review all connections:
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;

Note the ID(s) (processlist_id) of the connection(s) for the user that must reauthenticate.

To make a user reauthenticate, run the following for each ID returned above (as they can have multiple connections):
KILL CONNECTION processlist_id;

If the provided SQL does not force reauthentication, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Modify and/or configure MySQL and related applications and tools so that users are always required to reauthenticate when changing role or escalating privileges.

To make a single user reauthenticate, the following must be present:
KILL CONNECTION processlist_id;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289337</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289337r1319260_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must enforce discretionary access control policies, as defined by the data owner, over defined subjects and objects.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Discretionary Access Control (DAC) is based on the notion that individual users are &quot;owners&quot; of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled table permissions.

When DAC policies are implemented, subjects are not constrained with regard to what actions they can take with information for which they have already been granted access. Thus, subjects that have been granted access to information are not prevented from passing (i.e., the subjects have the discretion to pass) the information to other subjects or objects. 

A subject that is constrained in its operation by Mandatory Access Control (MAC) policies is still able to operate under the less rigorous constraints of this requirement. Thus, while MAC imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. 

The policy is bounded by the information system boundary. Once the information is passed outside of the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of DAC require identity-based access control, that limitation is not required for this use of DAC.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Use the following query to discover database object access rights:

Users with data definition language (DDL) rights on database objects (at instance level):
SELECT *
FROM `mysql`.`user`
WHERE  (`mysql`.`user`.`user` not like &apos;mysql.%&apos;)  AND (
    `user`.`Create_priv` = &apos;Y&apos; OR
    `user`.`Drop_priv` = &apos;Y&apos; OR
    `user`.`Grant_priv` = &apos;Y&apos; OR
    `user`.`References_priv` = &apos;Y&apos; OR
    `user`.`Index_priv` = &apos;Y&apos; OR
    `user`.`Alter_priv` = &apos;Y&apos; OR
    `user`.`Super_priv` = &apos;Y&apos; OR
    `user`.`Execute_priv` = &apos;Y&apos; OR
    `user`.`Create_view_priv` = &apos;Y&apos; OR
    `user`.`Create_routine_priv` = &apos;Y&apos; OR
    `user`.`Alter_routine_priv` = &apos;Y&apos; OR
    `user`.`Create_user_priv` = &apos;Y&apos; OR
    `user`.`Event_priv` = &apos;Y&apos; OR
    `user`.`Trigger_priv` = &apos;Y&apos; OR
    `user`.`Create_role_priv` = &apos;Y&apos; OR
    `user`.`Drop_role_priv` = &apos;Y&apos;) ;

Users with DDL rights on database objects (at DB/schema level):
SELECT * FROM mysql.db where
    (`db`.`Grant_priv` = &apos;Y&apos; OR
    `db`.`References_priv`= &apos;Y&apos; OR
    `db`.`Index_priv`= &apos;Y&apos; OR
    `db`.`Alter_priv`= &apos;Y&apos; OR
    `db`.`Create_tmp_table_priv`= &apos;Y&apos; OR
    `db`.`Lock_tables_priv`= &apos;Y&apos; OR
    `db`.`Create_view_priv`= &apos;Y&apos; OR
    `db`.`Show_view_priv`= &apos;Y&apos; OR
    `db`.`Create_routine_priv`= &apos;Y&apos; OR
    `db`.`Alter_routine_priv`= &apos;Y&apos; OR
    `db`.`Execute_priv`= &apos;Y&apos; OR
    `db`.`Event_priv`= &apos;Y&apos; OR
    `db`.`Trigger_priv`) and user not like &apos;mysql.%&apos;;

Ensure only administrative users are returned in the result set.

Use the following query to discover database users who have been delegated the right to grant permissions to other users.

Execute the following SQL statements to audit this setting:
SELECT `USER_PRIVILEGES`.`GRANTEE`,
    `USER_PRIVILEGES`.`TABLE_CATALOG`,
    `USER_PRIVILEGES`.`PRIVILEGE_TYPE`,
    `USER_PRIVILEGES`.`IS_GRANTABLE`
FROM `information_schema`.`USER_PRIVILEGES`
where `USER_PRIVILEGES`.`IS_GRANTABLE`=&apos;YES&apos;;

Ensure only administrative users are returned in the result set.

If any of these rights are not documented and authorized, this is a finding.

For MySQL 9.x role-based authorization, review login time role activation behavior. If &quot;activate_all_roles_on_login&quot; is enabled, verify automatic activation of all granted roles is explicitly authorized by policy. If &quot;activate_all_roles_on_login&quot; is disabled and &quot;activate_mandatory_roles&quot; is enabled, verify that only mandatory roles plus organization-approved default roles are activated at login.

Review mandatory role assignments and verify they do not violate least privilege. Verify that active roles at session establishment match organizational policy by using approved methods such as &quot;CURRENT_ROLE()&quot;, &quot;SHOW GRANTS&quot;, and applicable role metadata views. If login-time role activation grants roles beyond those approved by policy, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>To correct object ownership and revoke any unauthorized permissions:
REVOKE
    priv_type [(column_list)]
      [, priv_type [(column_list)]] ...
    ON [object_type] priv_level
    FROM user_or_role [, user_or_role] ...

REVOKE ALL [PRIVILEGES], GRANT OPTION
    FROM user_or_role [, user_or_role] ...

REVOKE PROXY ON user_or_role
    FROM user_or_role [, user_or_role] ...

REVOKE role [, role ] ...
    FROM user_or_role [, user_or_role ] ...

Configure MySQL 9.x so that only organization-approved roles are active at session establishment. Disable automatic activation of all granted roles unless explicitly required and approved. Where supported and approved, enable &quot;activate_mandatory_roles&quot; so that mandatory roles are activated in addition to approved default roles without activating all granted roles. Remove or revise any mandatory role assignments that exceed least-privilege requirements.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289338</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289338r1319262_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Execution of software modules (to include stored procedures, functions, and triggers) with elevated privileges must be restricted to necessary cases only.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>In certain situations, to provide required functionality, a database management system (DBMS) needs to execute internal logic (stored procedures, functions, triggers, etc.) and/or external code modules with elevated privileges. However, if the privileges required for execution are at a higher level than the privileges assigned to organizational users invoking the functionality applications/programs, those users are indirectly provided with greater privileges than assigned by organizations.

Privilege elevation must be used only where necessary and protected from misuse.

Satisfies: SRG-APP-000342-DB-000302, SRG-APP-000340-DB-000304</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the server documentation to obtain a listing of accounts used for executing external processes. Execute the following query to obtain a listing of accounts currently configured for use by external processes:
SHOW PROCEDURE STATUS where security_type &lt;&gt; &apos;INVOKER&apos;;
SHOW FUNCTION STATUS where security_type &lt;&gt; &apos;INVOKER&apos;;

If &quot;DEFINER&quot; accounts are returned that are not documented and authorized, this is a finding.

If elevation of MySQL privileges using &quot;DEFINER&quot; is documented but not implemented as described in the documentation, this is a finding.

If the privilege elevation logic can be invoked in ways other than intended, in contexts other than intended, or by subjects/principals other than intended, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Remove any procedures that are not authorized.

Drop the procedure or function using:
DROP PROCEDURE &lt;proc_name&gt;;
DROP FUNCTION &lt;function_name&gt;;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289339</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289339r1318938_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must associate organization-defined types of security labels having organization-defined security label values with information in storage.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Without the association of security labels to information, there is no basis for the database management system (DBMS) to make security-related access control decisions.

Security labels are abstractions representing the basic properties or characteristics of an entity (e.g., subjects and objects) with respect to safeguarding information. 

These labels are typically associated with internal data structures (e.g., tables, rows) within the database and are used to enable the implementation of access control and flow control policies, reflect special dissemination, handling or distribution instructions, or support other aspects of the information security policy. 

One example includes marking data as classified or CUI. These security labels may be assigned manually or during data processing, but, either way, it is imperative these assignments are maintained while the data is in storage. If the security labels are lost when the data is stored, there is the risk of a data compromise.

The mechanism used to support security labeling may be a feature of the DBMS product, a third-party product, or custom application code.

For MySQL, a view or stored procedures can limit access to only selected columns of the base table. A view can provide value-based security for the information in a table. Using a view requires appropriate privileges only for the view itself. The user need not be given privileges on base objects underlying the view.

Satisfies: SRG-APP-000311-DB-000308, SRG-APP-000313-DB-000309, SRG-APP-000314-DB-000310</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If security labeling is not required, this is not a finding.

For data that have been labeled with a column indicating classification, read-only views can be created and secured via access privileges so a user can view only the data with a specific tag or tags (e.g., user [x] can only view records that are labeled as classified). 

If security labeling requirements have been specified, but either a third-party solution or a MySQL views and stored procedures is not implemented to reliably maintain row-level security labels on information in storage, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Deploy MySQL views and stored procedures or a third-party software, or add custom data structures, data elements, and application code, to provide reliable security labeling of information in storage.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289340</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289340r1319302_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must automatically terminate a user session after organization-defined conditions or trigger events requiring session disconnect.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>This addresses the termination of user-initiated logical sessions in contrast to the termination of network connections associated with communications sessions (i.e., network disconnect). A logical session (for local, network, and remote access) is initiated whenever a user (or process acting on behalf of a user) accesses an organizational information system. Such user sessions can be terminated (and thus terminate user access) without terminating network sessions. 

Session termination ends all processes associated with a user&apos;s logical session except those batch processes/jobs that are specifically created by the user (i.e., session owner) to continue after the session is terminated. 

Conditions or trigger events requiring automatic session termination can include, for example, organization-defined periods of user inactivity, targeted responses to certain types of incidents, and time-of-day restrictions on information system use.

This capability is typically reserved for specific cases where the system owner, data owner, or organization requires additional assurance.

Each connection to mysqld runs in a separate thread. Kill a connection by killing the connections thread with the KILL processlist_id statement.

Thread processlist identifiers can be determined from the ID column of the INFORMATION_SCHEMA PROCESSLIST table, the ID column of SHOW PROCESSLIST output, and the PROCESSLIST_ID column of the Performance Schema threads table.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation to obtain the organization&apos;s definition of circumstances requiring automatic session termination, including the maximum permitted period of user inactivity.

If the organization explicitly documents that automatic termination based on inactivity is not required, this portion of the check is not a finding.

For MySQL Classic Protocol connections, review the configured idle session timeout values:
SHOW GLOBAL VARIABLES
WHERE Variable_name IN (&apos;wait_timeout&apos;, &apos;interactive_timeout&apos;);

Verify &quot;wait_timeout&quot; and &quot;interactive_timeout&quot; do not exceed the organization-defined maximum idle session period.

MySQL terminates a noninteractive connection after it has been inactive for &quot;wait_timeout&quot; seconds. For interactive clients, the session timeout is initialized from &quot;interactive_timeout&quot;.

If X Protocol is authorized for user connections, also review the applicable X Protocol timeout configuration, including &quot;mysqlx_wait_timeout&quot; and &quot;mysqlx_interactive_timeout&quot;.

If the organization defines other trigger events requiring session termination, such as an incident response action, verify that an approved mechanism is configured to terminate the applicable MySQL connections.

If an idle user session can remain connected beyond the organization-defined maximum period, or another organization-defined termination condition is not enforced, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL to automatically terminate idle user sessions within the organization-defined period.

For MySQL Classic Protocol connections, set &quot;wait_timeout&quot; and &quot;interactive_timeout&quot; to the organization-defined maximum number of seconds.

For example, if the organization requires idle sessions to terminate after &lt;organization-defined timeout&gt; seconds:
SET PERSIST wait_timeout = &lt;organization-defined timeout&gt;;
SET PERSIST interactive_timeout = &lt;organization-defined timeout&gt;;

The new global values apply when new sessions are established. MySQL uses these timeout values to close connections that remain inactive beyond the configured period.

If X Protocol is authorized for user connections, configure its idle session timeout values to meet the same organization-defined requirement.

For other organization-defined trigger events requiring session termination, configure the approved administrative or automated mechanism to terminate the affected MySQL connections.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289342</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289342r1319267_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must maintain the confidentiality and integrity of information during preparation for transmission.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Information can be either unintentionally or maliciously disclosed or modified during preparation for transmission, including, for example, during aggregation, at protocol transformation points, and during packing/unpacking. These unauthorized disclosures or modifications compromise the confidentiality or integrity of the information.

Use of this requirement will be limited to situations where the data owner has a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process. 

When transmitting data, the database management system (DBMS), associated applications, and infrastructure must leverage transmission protection mechanisms.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If the data owner does not have a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process, this is not a finding.

Run the following:
select @@require_secure_transport;

If the value is &quot;0&quot; (OFF), this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Turn on &quot;require_secure_transport&quot;. In this mode, the server permits only transmission control protocol/internet protocol (TCP/IP) connections encrypted using transport layer security/secure sockets layer (TLS/SSL), or connections that use a socket file (on Unix) or shared memory (on Windows). 

The server rejects nonsecure connection attempts, which fail with an &quot;ER_SECURE_TRANSPORT_REQUIRED&quot; error.

set persist require_secure_transport=ON;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289344</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289344r1319270_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>high</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must use National Security Agency (NSA)-approved cryptography to protect classified information in accordance with the data owner&apos;s requirements.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. The application must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated.

It is the responsibility of the data owner to assess the cryptography requirements in light of applicable federal laws, Executive Orders, directives, policies, regulations, and standards.

NSA-approved cryptography for classified networks is hardware based. This requirement addresses the compatibility of a database management system (DBMS) with the encryption devices.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation and data owner requirements to determine whether classified information is processed, stored, or transmitted by MySQL.

If classified information is not processed, stored, or transmitted by MySQL, this is not a finding.

For classified information, verify that the cryptographic protection used by the system is an NSA-approved cryptographic solution meeting the data owner&apos;s requirements. MySQL FIPS mode alone is not evidence that an NSA-approved cryptographic solution for classified information is provided.

Where FIPS-validated cryptography is additionally required, identify the cryptographic module actually used by MySQL at runtime.

Verify that the cryptographic module is covered by an applicable National Institute of Standards and Technology (NIST) Cryptographic Module Validation Program (CMVP) validation to FIPS 140-3 and is installed and operated in the approved configuration described by the module&apos;s Security Policy.

For operating system package installations using an operating-system-provided OpenSSL/FIPS provider, verify that the specific provider, version, and operating environment used by MySQL are within the scope of the applicable FIPS 140-3 CMVP validation.

For generic binary, tar, source, Windows, or macOS installations using a separately supplied OpenSSL/FIPS provider, verify that the specific OpenSSL cryptographic module used by MySQL is FIPS 140-3 validated and that the deployment conforms to the provider&apos;s validated operational environment and Security Policy.

Do not consider the ability to enable FIPS mode, by itself, evidence that the cryptographic module is CMVP validated.

Determine whether MySQL is configured to operate in FIPS mode:
SELECT @@ssl_fips_mode;

If FIPS-validated cryptography is required and &quot;ssl_fips_mode&quot; is not &quot;ON&quot; or &quot;STRICT&quot;, this is a finding.

If &quot;ssl_fips_mode&quot; is &quot;ON&quot; or &quot;STRICT&quot; but the cryptographic module actually used by MySQL cannot be shown to be covered by an applicable FIPS 140-3 CMVP validation, this is a finding.

Review the permitted transport layer security (TLS) versions:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME = &apos;tls_version&apos;;

If the configured TLS versions do not comply with the organization-approved cryptographic policy, this is a finding.

Review the configured TLS cipher suites:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME IN (&apos;ssl_cipher&apos;, &apos;tls_ciphersuites&apos;);

Verify that only cipher suites permitted by the organization-approved cryptographic policy are configured.

Review the server certificate and associated cryptographic configuration and verify that the certificate, public key algorithm, key length, signature algorithm, and issuing authority comply with the data owner&apos;s requirements.

If required cryptographic protections are not provided using the organization-approved and, where applicable, FIPS 140-3-validated or NSA-approved cryptographic mechanisms, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure cryptographic functions to use NSA-approved cryptography-compliant algorithms.

Turn on MySQL FIPS mode:
Edit my.cnf
[mysqld]
ssl_fips_mode=ON

or:
[mysqld]
ssl_fips_mode=STRICT

To restrict TLS versions:
[mysqld]
tls_version=&apos;TLSv1.2,TLSv1.3&apos;

Example to define ciphers for TLSv1.2:
[mysqld]
ssl_ciphers=&apos;ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-RSA-AES256-GCM-SHA384,DHE-RSA-AES128-GCM-SHA256,DHE-DSS-AES128-GCM-SHA256,DHE-DSS-AES256-GCM-SHA384,DHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305&apos;

If TLSv1.3 is enabled, the &quot;tls_ciphersuites&quot; setting must contain all, or a subset of the following ciphers based on certificates being used by the server and client. Enabling FIPS mode will limit the OpenSSL library to operate within the FIPS object module.

Example to define TLS ciphers for TLSv1.3:
[mysqld]
tls_ciphersuites=&apos;TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,TLS_AES_128_CCM_SHA256,TLS_AES_128_CCM_8_SHA256&apos;

After adding any entries to the &quot;my.cnf&quot; file, restart mysqld.

Create and use DoW-approved certificates for asymmetric keys used by the database.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289345</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289345r1319272_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>high</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must implement National Institute of Standards and Technology (NIST) FIPS 140-3-validated cryptographic modules to provision digital signatures.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. The application must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated.

For detailed information, refer to NIST FIPS Publication 140-3, Security Requirements For Cryptographic Modules. Note that the product&apos;s cryptographic modules must be validated and certified by NIST as FIPS compliant.

Satisfies: SRG-APP-000514-DB-000381, SRG-APP-000514-DB-000382, SRG-APP-000514-DB-000383</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>All cryptography is provided via OpenSSL and can be verified in FIPS mode. 

Run this command:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables where variable_name = &apos;ssl_fips_mode&apos;;

If the &quot;VARIABLE_VALUE&quot; does not return &quot;ON&quot; or &quot;STRICT&quot;, this is a finding.

In general, &quot;STRICT&quot; imposes more restrictions than &quot;ON&quot;, but MySQL itself has no FIPS-specific code other than to specify to OpenSSL the FIPS mode value. The exact behavior of FIPS mode for &quot;ON&quot; or &quot;STRICT&quot; depends on the OpenSSL version.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Implement NIST FIPS 140-3-validated cryptographic modules to provision digital signatures.

Turn on MySQL FIPS mode and restart mysqld:
Edit my.cnf
[mysqld]
ssl_fips_mode=ON

or:
[mysqld]
ssl_fips_mode=STRICT

In general, &quot;STRICT&quot; imposes more restrictions than &quot;ON&quot;, but MySQL itself has no FIPS-specific code other than to specify to OpenSSL the FIPS mode value. The exact behavior of FIPS mode for &quot;ON&quot; or &quot;STRICT&quot; depends on the OpenSSL version.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289346</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289346r1318959_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must accept only end-entity certificates issued by DoW Public Key Infrastructure (PKI) or DoW-approved PKI certification authorities (CAs) for the establishment of all encrypted sessions.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Only DoW-approved external PKIs have been evaluated to ensure they have security controls and identity vetting procedures in place that are sufficient for DoW systems to rely on the identity asserted in the certificate. PKIs lacking sufficient security controls and identity vetting procedures risk being compromised and issuing certificates that enable adversaries to impersonate legitimate users. 

The authoritative list of DoW-approved PKIs is published at https://cyber.mil/pki-pke/interoperability.

This requirement focuses on communications protection for the database management system (DBMS) session rather than for the network packet.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>To run MySQL in secure socket layer (SSL) mode, obtain a valid certificate signed by a single certificate authority. 

Before starting the MySQL database in SSL mode, verify the certificate used is issued by a valid DoW certificate authority.

Run this command:
openssl x509 -in &lt;path_to_certificate_pem_file&gt; -text | grep -i &quot;issuer&quot;

If there is any issuer present in the certificate that is not a DoW-approved certificate authority, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Remove any certificate that was not issued by a valid DoW certificate authority.

Contact the organization&apos;s certificate issuer and request a new certificate that is issued by a valid DoW certificate authorities.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289347</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289347r1319274_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The MySQL Database Server 9.x must implement cryptographic mechanisms to prevent unauthorized modification of organization-defined information at rest (to include, at a minimum, Personally Identifiable Information [PII] and classified information) on organization-defined information system components.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Database management systems (DBMSs) handling data requiring data-at-rest protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest. These cryptographic mechanisms may be native to the DBMS or implemented via additional software or operating system/file system settings, as appropriate to the situation.

Selection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields).

The decision whether and what to encrypt rests with the data owner and is also influenced by the physical measures taken to secure the equipment and media on which the information resides.

Satisfies: SRG-APP-000428-DB-000386, SRG-APP-000429-DB-000387</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation to determine whether the organization has defined the information at rest that is to be protected from modification, which must include, at a minimum, PII and classified information.

If no information is identified as requiring such protection, this is not a finding.

Review the configuration of the MySQL 9.x Database Server, operating system/file system, and additional software as relevant.

If any of the information defined as requiring cryptographic protection from modification is not encrypted in a manner that provides the required level of protection, this is a finding.

To check for data encryption at rest settings in MySQL:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables where variable_name = &apos;audit_log.encryption&apos;;

If the value for audit_log.encryption is not &quot;AES&quot;, this is a finding.

SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables where variable_name = &apos;binlog_encryption&apos;; 

If the value for binlog_encryption is not &quot;ON&quot;, this is a finding.

SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables where variable_name = &apos;innodb_redo_log_encrypt&apos;;

If the value for binlog_innodb_redo_log_encrypt is not &quot;ON&quot;, this is a finding.

SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables where variable_name = &apos;innodb_undo_log_encrypt&apos;;

If the value for innodb_undo_log_encrypt is not &quot;ON&quot;, this is a finding.

SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables where variable_name = &apos;table_encryption_privilege_check&apos;;

If the value for table_encryption_privilege_check is not &quot;ON&quot;, this is a finding.

SELECT
    `INNODB_TABLESPACES`.`NAME`,
    `INNODB_TABLESPACES`.`ENCRYPTION`
FROM `information_schema`.`INNODB_TABLESPACES`;

If tables or tablespaces are not encrypted and the value is not &quot;Y&quot;, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL Database Server 9.x, operating system/file system, and additional software as required to provide the organization-defined level of cryptographic protection for information at rest.

Configure an approved MySQL keyring component and ensure that it is loaded early in the MySQL startup sequence before encryption consumers, such as InnoDB, initialize.

For systems requiring centralized or compliance-grade key management, use an organization-approved external key management system. Supported MySQL Enterprise keyring components include, as applicable:
- component_keyring_kmip for KMIP 1.1-compatible key-management systems such as Oracle Key Vault.
- component_keyring_oci for Oracle Cloud Infrastructure Vault.
- component_keyring_aws for AWS Key Management Service.
- The supported HashiCorp Vault keyring component.

Use of &quot;component_keyring_file&quot; or &quot;component_keyring_encrypted_file&quot; alone must not be considered a regulatory compliance key management solution where the applicable security policy requires keys to be protected in a key vault or hardware security module.

Encrypt existing InnoDB file-per-table tables and general tablespaces containing information identified by the organization as requiring protection:
ALTER TABLE &lt;table_name&gt; ENCRYPTION = &apos;Y&apos;;

ALTER TABLESPACE &lt;tablespace_name&gt; ENCRYPTION = &apos;Y&apos;;

Where encryption is required by default for newly created schemas and tablespaces, configure:
SET PERSIST default_table_encryption = ON;
SET PERSIST table_encryption_privilege_check = ON;

Existing schemas may also be configured with an encrypted default as required:
ALTER DATABASE &lt;database_name&gt; DEFAULT ENCRYPTION = &apos;Y&apos;;

Require binary log encryption:
SET PERSIST binlog_encryption = ON;

Require redo and undo log encryption:
SET PERSIST innodb_redo_log_encrypt = ON;
SET PERSIST innodb_undo_log_encrypt = ON;

For the MySQL Enterprise Audit component, configure audit log encryption using:
[mysqld]
audit-log.encryption=AES

The audit log component requires an enabled keyring when audit log encryption is used.

Disable the general query log unless its use is specifically required and its output is protected:
SET PERSIST general_log = OFF;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289349</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289349r1319098_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Security-relevant software updates to the MySQL Database Server 9.x must be installed within the time period directed by an authoritative source (e.g., Information Assurance Vulnerability Management [IAVM], Communication Tasking Orders [CTOs], Device Type Managers [DTMs], and Security Technical Implementation Guides [STIGs]).</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Security flaws with software applications, including database management systems, are discovered daily. Vendors are constantly updating and patching their products to address newly discovered security vulnerabilities. Organizations (including any contractor to the organization) are required to promptly install security-relevant software updates (e.g., patches, service packs, and hot fixes). Flaws discovered during security assessments, continuous monitoring, incident response activities, or information system error handling must also be addressed expeditiously. 

Organization-defined time periods for updating security-relevant software may vary based on a variety of factors including, for example, the security category of the information system or the criticality of the update (i.e., severity of the vulnerability related to the discovered flaw). 

This requirement will apply to software patch management solutions that are used to install patches across the enclave and also to applications themselves that are not part of that patch management solution. For example, many browsers today provide the capability to install their own patch software. Patch criticality, as well as system criticality, will vary. Therefore, the tactical situations regarding the patch management process will also vary. This means that the time period used must be a configurable parameter. Time frames for application of security-relevant software updates may be dependent upon the IAVM process.

The application will be configured to check for and install security-relevant software updates within an identified time period from the availability of the update. The specific time period will be defined by an authoritative source (e.g., IAVM, CTOs, DTMs, and STIGs).</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>To check the version of the installed MySQL, run the following SQL statement:
select @@version;

The result will show the version. For example:
9.x.x-commercial

Obtain evidence that software monthly rapid updates (MRU) are consistently applied to MySQL Server within the time frame defined for each update. To be considered supported, Oracle must report that the version is supported by security patches to known vulnerabilities.

Review the MySQL Support dates at the following link:
https://www.oracle.com/support/lifetime-support/resources.html

Review the MySQL Release notes page:
https://dev.mysql.com/doc/relnotes/mysql/9.7/en/
 
If MySQL Enterprise Edition is not at the latest version, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Institute and adhere to policies and procedures to ensure that patches are consistently applied to MySQL within the time allowed.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289351</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289351r1319276_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>When invalid inputs are received, the MySQL Database Server 9.x must behave in a predictable and documented manner that reflects organizational and system objectives.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>A common vulnerability is unplanned behavior when invalid inputs are received. This requirement guards against adverse or unintended system behavior caused by invalid inputs, where information system responses to the invalid input may be disruptive or cause the system to fail into an unsafe state.

The behavior will be derived from the organizational and system requirements and includes, but is not limited to, notification of the appropriate personnel, creating an audit record, and rejecting invalid input.

This calls for inspection of application source code, which will require collaboration with the application developers. It is recognized that in many cases, the database administrator (DBA) is organizationally separate from the application developers, and may have limited, if any, access to source code. Nevertheless, protections of this type are so important to the secure operation of databases that they must not be ignored. At a minimum, the DBA must attempt to obtain assurances from the development organization that this issue has been addressed and must document what has been discovered.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the MySQL Server to ensure it behaves in a predictable and documented manner that reflects organizational and system objectives when invalid inputs are received.

To determine if table check constraints have been put in place:
SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS;

If input validation is required beyond those enforced by the datatype and no constraints exist for data input, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL Server to behave in a predictable and documented manner that reflects organizational and system objectives when invalid inputs are received.

To validate data at the database table level, modify tables by adding constraints. A &quot;CHECK&quot; constraint is a type of integrity constraint in SQL within the create or alter table statement:
[CONSTRAINT [symbol]] CHECK (expr) [[NOT] ENFORCED]

For example:
CREATE TABLE checker (i tinyint, CONSTRAINT i_must_be_between_7_and_12 CHECK (i BETWEEN 7 AND 12 ) ); 

To add a constraint to an existing table: 
ALTER TABLE &lt;table_name&gt; 
           ADD [CONSTRAINT [symbol]] CHECK (condition) [[NOT] ENFORCED]</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289354</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289354r1319279_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The database management system (DBMS) must, for password-based authentication, maintain a list of commonly used, expected, or compromised passwords on an organization-defined frequency.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Use of commonly used, expected, dictionary-based, repetitive, sequential, or previously compromised passwords increases the risk of password guessing and credential-stuffing attacks. MySQL 9.x environments that rely on password-based authentication must enforce password quality controls that prevent use of weak or predictable passwords. This includes maintaining a password dictionary or comparable prohibited-password list containing commonly used, expected, or compromised passwords, and ensuring that list is available to password validation mechanisms used by the DBMS.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation and organizational policy to determine the required frequency for maintaining the list of commonly used, expected, or compromised passwords.

Verify the MySQL password validation component is installed:
SELECT *
FROM mysql.component
WHERE component_urn = &apos;file://component_validate_password&apos;;

If &quot;component_validate_password&quot; is not installed for a system using locally managed MySQL passwords, this is a finding.

Review the password dictionary configuration:
SHOW GLOBAL VARIABLES LIKE &apos;validate_password.%&apos;;

Verify:
- &quot;validate_password.dictionary_file&quot; identifies the organization-approved prohibited password dictionary file.
- &quot;validate_password.policy&quot; is set to &quot;STRONG&quot;.

MySQL performs dictionary checks only when a dictionary file is configured and the password policy is &quot;STRONG&quot;.

Verify the dictionary has been successfully loaded:
SHOW GLOBAL STATUS LIKE &apos;validate_password.%&apos;;

Review:
- validate_password.dictionary_file_last_parsed
- validate_password.dictionary_file_words_count

Verify &quot;validate_password.dictionary_file_words_count&quot; is greater than zero.

Compare &quot;validate_password.dictionary_file_last_parsed&quot; with the organization-defined dictionary maintenance frequency. If the dictionary has not been parsed within the required interval, this is a finding.

MySQL rereads the specified dictionary when &quot;validate_password.dictionary_file&quot; is assigned, and the component reports the last parse time and number of dictionary words loaded.

Verify documented procedures exist to update the prohibited password list on the organization-defined frequency.

If the approved dictionary is not configured, is empty, is not being used with the &quot;STRONG&quot; policy, or has not been maintained within the organization-defined frequency, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL 9.x to use the password validation component with an approved dictionary or prohibited password file containing commonly used, expected, or compromised passwords.

Set and maintain the dictionary file in accordance with organizational policy, and establish procedures to refresh or replace the file on the organization-defined frequency.

Example:
INSTALL COMPONENT &apos;file://component_validate_password&apos;;
SET PERSIST validate_password.dictionary_file = &apos;/path/to/approved/prohibited_passwords.txt&apos;;
SET PERSIST validate_password.policy = &apos;STRONG&apos;;

Ensure the prohibited password file is protected from unauthorized modification and is maintained according to organizational procedures.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289358</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289358r1319282_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The database management system (DBMS) must, for password-based authentication, require immediate selection of a new password upon account recovery.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Recovered or reset credentials may be known to administrators, help desk personnel, or others involved in the recovery process. If a user is allowed to continue operating with a recovered or temporary password, the confidentiality of the authenticator cannot be assured. MySQL 9.x must require the user to select a new password immediately following account recovery or administrative password reset.

In MySQL, this can be enforced by expiring the password at reset time. When an account password is expired, the user can authenticate but is placed in a restricted mode and must change the password before executing normal queries.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review MySQL 9.x account recovery and administrative password reset procedures.

Verify the DBMS is configured to require immediate selection of a new password upon account recovery.

Determine whether administrative password reset and account recovery workflows use password expiration so the user must change the password at first login after recovery.

Review:
- Password reset procedures.
- Account recovery scripts or automation.
- Sample &quot;ALTER USER&quot; statements used during password reset.
- Test results showing a recovered user can connect only in restricted mode until a new password is selected.

Example evidence of a compliant reset workflow:
ALTER USER &apos;username&apos;@&apos;localhost&apos; IDENTIFIED BY &apos;temporary_password&apos; PASSWORD EXPIRE;

If account recovery or password reset procedures do not require password expiration and immediate password change at first login, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL 9.x password reset and account recovery procedures so recovered or administratively reset accounts require immediate password change at first login.

Use &quot;PASSWORD EXPIRE&quot; when assigning a temporary or reset password.

Example:
ALTER USER &apos;username&apos;@&apos;localhost&apos; IDENTIFIED BY &apos;temporary_password&apos; PASSWORD EXPIRE;

For newly created accounts that must set their own password at initial use, configure the account so the password is expired upon creation or immediately afterward in accordance with organizational procedures.

Verify the user is restricted from normal query execution until a new password is selected.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289359</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289359r1319285_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The database management system (DBMS) must, for password-based authentication, employ automated tools to assist the user in selecting strong password authenticators.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>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.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>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 = &apos;file://component_validate_password&apos;;

Review the configured password-strength policy:
SHOW VARIABLES LIKE &apos;validate_password.%&apos;;

Verify that the settings comply with the organization-defined password policy.

MySQL automatically evaluates clear-text passwords supplied through &quot;CREATE USER&quot;, &quot;ALTER USER&quot;, and &quot;SET PASSWORD&quot; 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(&apos;&lt;candidate_password&gt;&apos;);

The function returns a value from &quot;0&quot; for a weak password through &quot;100&quot; 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.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>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 &quot;STRONG&quot; policy.

Example:
INSTALL COMPONENT &apos;file://component_validate_password&apos;;
SET PERSIST validate_password.length = 14;
SET PERSIST validate_password.check_user_name = ON;
SET PERSIST validate_password.dictionary_file = &apos;/path/to/approved/prohibited_passwords.txt&apos;;
SET PERSIST validate_password.policy = &apos;STRONG&apos;;

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 &apos;username&apos;@&apos;localhost&apos; IDENTIFIED BY RANDOM PASSWORD PASSWORD EXPIRE;</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289362</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289362r1319100_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The database management system (DBMS) must include only approved trust anchors in trust stores or certificate stores managed by the organization.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Trust anchors determine which certificate authorities are accepted as authoritative for validating certificates. If unapproved trust anchors are present, the DBMS may trust unauthorized or malicious certificates, which can undermine certificate validation and encrypted communications. MySQL 9.x environments that use transport layer security (TLS) certificate validation must be configured so only organization-approved trust anchors are present in the certification authority (CA) file or CA path used by the DBMS.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the MySQL 9.x TLS trust anchor configuration:

1. Identify the CA file or CA directory used by MySQL for certificate validation:
SHOW VARIABLES LIKE &apos;ssl_ca&apos;;
SHOW VARIABLES LIKE &apos;ssl_capath&apos;;
2. Verify the configured ssl_ca file and/or ssl_capath directory contains only organization-approved trust anchors.
3. Review the contents of the configured CA file or CA directory at the operating system level and compare them against the organization-approved trust anchor list.
4. Verify the CA file or directory is protected from unauthorized modification.

If MySQL is configured to use a CA file or CA path containing trust anchors that are not organization-approved, this is a finding.

If the CA file or CA path cannot be identified or controlled, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL 9.x to use only organization-approved trust anchors in the CA file or CA directory used for TLS certificate validation.

Set the DBMS to reference an approved CA bundle or approved CA directory.

Example:
SET PERSIST ssl_ca = &apos;/path/to/approved/ca-bundle.pem&apos;;

or:
SET PERSIST ssl_capath = &apos;/path/to/approved/ca-directory&apos;;

Remove any unapproved trust anchors from the configured CA file or CA directory, and protect the trust store from unauthorized modification.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289363</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289363r1319288_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The database management system (DBMS) must provide protected storage for cryptographic keys with organization-defined safeguards and/or hardware protected key store.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>If cryptographic keys are stored without adequate protection, an attacker who gains file system, backup, or administrative access may be able to recover the keys and defeat encryption controls. MySQL 9.x supports multiple keyring implementations, but they do not provide equivalent protection. Vault-backed or enterprise key management implementations are the preferred approach for protected key storage, including:
- component_keyring_kmip.
- component_keyring_hashicorp.
- component_keyring_oci.

File-based keyring modes require special caution. &quot;component_keyring_file&quot; stores keyring data in a local file, and both &quot;component_keyring_file&quot; and &quot;component_keyring_encrypted_file&quot; are not intended as a regulatory compliance solution for encryption key management.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the MySQL 9.x encryption and key-management configuration to determine whether the DBMS uses cryptographic keys for tablespace encryption, binary log encryption, audit log encryption, persisted sensitive system variables, or other encrypted DBMS functions.

1. Identify the configured keyring implementation:
SELECT * FROM mysql.component WHERE component_urn LIKE &apos;%keyring%&apos;;
SHOW PLUGINS;
2. Determine whether the deployment uses one of the preferred vault-backed or enterprise key management options:
- component_keyring_kmip.
- component_keyring_hashicorp.
- component_keyring_oci.
3. If &quot;component_keyring_kmip&quot; is used, verify it is configured to communicate with an organization-approved Key Management Interoperability Protocol (KMIP) back end, such as Oracle Key Vault or another approved KMIP-compatible service.
4. If &quot;component_keyring_hashicorp&quot; is used, verify it is configured for an organization-approved HashiCorp Vault deployment and that associated transport layer security (TLS) and configuration files are protected from unauthorized access.
5. If &quot;component_keyring_oci&quot; is used, verify it is configured to an organization-approved Oracle Cloud Infrastructure (OCI) Vault deployment and protected in accordance with organizational policy.
6. If the deployment uses &quot;component_keyring_file&quot; or &quot;component_keyring_encrypted_file&quot;, verify the organization has explicitly approved that implementation and documented compensating safeguards. Because these file-based modes are not intended as a regulatory compliance solution, they must not be treated as the preferred implementation for this requirement.
7. If the deployment uses deprecated plugins such as &quot;keyring_okv&quot;, &quot;keyring_aws&quot;, or &quot;keyring_hashicorp&quot;, verify there is an approved migration plan to the corresponding components.

If the DBMS does not use an approved protected key-storage implementation or approved compensating safeguards for the selected keyring mode, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL 9.x to use an organization-approved protected key management implementation for cryptographic keys.

Preferred implementations are:
- component_keyring_kmip for approved KMIP back ends such as Oracle Key Vault.
- component_keyring_hashicorp for approved HashiCorp Vault deployments.
- component_keyring_oci for approved OCI Vault deployments.

Where file-based keyring modes such as &quot;component_keyring_file&quot; or &quot;component_keyring_encrypted_file&quot; are currently in use, do not treat them as the preferred long-term compliance solution. Migrate to an approved vault-backed or enterprise key management implementation unless the organization has explicitly documented and approved compensating safeguards for the file-based mode.

Also migrate off deprecated keyring plugins to their component replacements where applicable.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289366</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289366r1319425_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>high</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The database management system (DBMS) must be a version supported by the vendor.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Unsupported DBMS versions do not receive vendor security fixes, bug fixes, or support assistance, which increases the risk that known vulnerabilities will remain uncorrected. MySQL&apos;s current release model has two supported tracks, Long-Term Support (LTS) and Innovation.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the MySQL server version and compare it to Oracle&apos;s currently supported release model.

1. Determine the installed MySQL version:
SELECT VERSION();
SHOW VARIABLES LIKE &apos;version%&apos;;
2. Determine whether the installed version is on a currently supported Oracle release track:
- An LTS release still within Oracle support; or
- An Innovation release that has not been superseded by the next minor release.
3. For MySQL 9.x deployments, verify the server is running a version currently supported by Oracle.
4. Review vendor support documentation and site lifecycle procedures to confirm the installed version is still within Oracle&apos;s supported window.

If the DBMS is not a version supported by the vendor, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Upgrade or install a MySQL version supported by Oracle.

For long-term deployments, migrate to the current supported LTS release. If an Innovation release is used, establish and follow a process to upgrade promptly to the next supported release so the DBMS does not fall out of support.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289367</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289367r1319427_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>The database management system (DBMS) must disable accounts when the accounts have expired.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Accounts that remain usable after their approved validity period has ended increase the risk of unauthorized access, especially for temporary, contractor, training, emergency, or otherwise time-bounded access. MySQL 9.x supports account password expiration and account locking controls that can be used to ensure expired accounts are not available for normal use.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review account management procedures and MySQL account status for expiration handling.

1. Identify accounts that are temporary, time limited, or otherwise subject to expiration under organizational policy.
2. Review MySQL account metadata and administrative procedures to determine how expired accounts are handled.
3. Verify expired accounts are disabled through account locking, deprovisioning, or equivalent administrative action.
4. Review account status and authentication attributes for sample accounts:
SELECT user, host, account_locked, password_expired FROM mysql.user ORDER BY user, host;
5. For accounts subject to expiration, verify that once the expiration condition is reached, the account is no longer usable for normal access.

If expired accounts remain enabled for normal use, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL 9.x account management procedures so accounts are disabled when they expire.

Use approved administrative processes to:
- Lock expired accounts;
- Remove expired accounts; or
- Otherwise prevent expired accounts from authenticating.

Example:
ALTER USER &apos;username&apos;@&apos;host&apos; ACCOUNT LOCK;

Where password expiration is used as part of account lifecycle management, do not rely on password expiration alone if policy requires the account itself to be disabled. Ensure expiration events trigger account lock or deprovisioning in accordance with organizational policy.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289368</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289368r1319294_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>MySQL must disable accounts when the accounts are no longer associated to a user.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Inactive accounts that remain enabled increase the risk of unauthorized use, especially when credentials are forgotten, abandoned, or not actively monitored. MySQL 9.x can lock accounts and track authentication-related account state, but automatic disabling of inactive accounts is typically implemented through administrative jobs, identity management integration, or other external account management processes rather than a single built-in MySQL inactivity timer.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review MySQL 9.x account management procedures and the mechanism used to identify and disable inactive accounts.

1. Determine the organization-defined inactivity period for database management system (DBMS) accounts.
2. Review the method used to detect inactivity, such as:
- Enterprise identity management tooling.
- Scheduled administrative jobs.
- Account review scripts.
- Audit log review processes.
3. Verify inactive accounts are automatically disabled after the defined period of inactivity.
4. Review account status and available account metadata:
SELECT user, host, account_locked, password_last_changed FROM mysql.user ORDER BY user, host;
5. Review the automated process or script that identifies inactive accounts and locks or disables them.
6. Verify there is evidence the process runs on schedule and has disabled inactive accounts when required.

If inactive accounts are not automatically disabled after the organization-defined period of inactivity, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure the MySQL 9.x operating environment to automatically disable inactive accounts after the organization-defined period of inactivity.

Implement an approved automated process that:
- Identifies inactive DBMS accounts.
- Locks or disables those accounts.
- Records the action for administrative review.

Example account lock action:
ALTER USER &apos;username&apos;@&apos;host&apos; ACCOUNT LOCK;

Ensure the inactivity detection logic, schedule, and exceptions are documented and aligned with organizational policy.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    <VULN>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Num</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>V-289372</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>SV-289372r1319037_rule</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Severity</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>medium</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Rule_Title</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>MySQL must require users to be individually authenticated before granting access to the shared accounts or resources.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Vuln_Discuss</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Individual authentication prior to shared group authentication mitigates the risk of using group accounts or authenticators.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Check_Content</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Review the system documentation to identify:
- Individual users authorized to access MySQL.
- MySQL roles used to provide shared access to database resources.
- Any application, service, proxy, or other shared accounts.
- Any approved exceptions requiring use of a shared account.

Review MySQL accounts:
SELECT User, Host, plugin, account_locked
FROM mysql.user
ORDER BY User, Host;

MySQL authenticates a client against the selected MySQL account and its configured authentication method before granting access.

Verify that human users who access MySQL interactively use individually identifiable accounts or individually identifiable external authentication identities.

If multiple human users directly authenticate using the same MySQL user name and credentials, this is a finding unless the use is specifically approved and an organization-approved mechanism individually authenticates the users before access is granted.

Review role assignments:
SELECT
    re.FROM_USER AS User,
    re.FROM_HOST AS User_Host,
    re.TO_USER AS Role,
    re.TO_HOST AS Role_Host,
    u.account_locked AS Role_Account_Locked
FROM mysql.role_edges AS re
LEFT JOIN mysql.user AS u
  ON u.User = re.TO_USER
 AND u.Host = re.TO_HOST
ORDER BY re.TO_USER, re.FROM_USER;

Verify that shared database privileges are assigned through roles to individually authenticated users where practical.

Verify that authorization identifiers intended solely to function as roles remain locked and cannot be used for direct authentication. MySQL roles are locked by default; a locked role cannot authenticate to the server.

For application, service, or other shared accounts, verify that:
- The account is not used as a shared interactive login by multiple human users.
- Human access to the associated application or resource requires individual authentication before the shared service account is used.
- Credentials for the shared account are not distributed to individual users.
- Use of the shared account is documented and approved.

If a user can obtain access to a shared MySQL account or shared database resource without first being individually authenticated, this is a finding.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STIG_DATA>
        <VULN_ATTRIBUTE>Fix_Text</VULN_ATTRIBUTE>
        <ATTRIBUTE_DATA>Configure MySQL so human users authenticate using individually identifiable accounts.

Do not provide multiple human users with the credentials for a common MySQL login account.

Where multiple users require the same database privileges, create a MySQL role representing the shared privilege set and grant the role to each individual&apos;s MySQL account.

For example:
CREATE ROLE &apos;r_shared_resource&apos;;

GRANT SELECT, INSERT, UPDATE
ON application_db.*
TO &apos;r_shared_resource&apos;;

GRANT &apos;r_shared_resource&apos;
TO &apos;user1&apos;@&apos;host1&apos;,
   &apos;user2&apos;@&apos;host2&apos;;

SET DEFAULT ROLE &apos;r_shared_resource&apos;
TO &apos;user1&apos;@&apos;host1&apos;,
   &apos;user2&apos;@&apos;host2&apos;;

Ensure the role cannot be used for direct authentication:
ALTER USER &apos;r_shared_resource&apos; ACCOUNT LOCK;

MySQL roles provide common privilege sets to separate authenticated accounts, avoiding the need for users to share a database login.

For application or service accounts that must be shared by a service, prevent direct human use of the account and require users to authenticate individually to the application or other approved access mechanism before the service account is used.

Remove or lock shared interactive accounts whose credentials are used directly by multiple human users, and replace them with individually authenticated accounts and appropriate role assignments.</ATTRIBUTE_DATA>
      </STIG_DATA>
      <STATUS>Not_Reviewed</STATUS>
      <FINDING_DETAILS></FINDING_DETAILS>
      <COMMENTS></COMMENTS>
    </VULN>
    </iSTIG>
  </STIGS>
</CHECKLIST>