Oracle MySQL 8.0 Security Technical Implementation Guide

  • Version/Release: V1R5
  • Published: 2024-01-24
  • Expand All:
  • Severity:
  • Sort:
Compare

Select any two versions of this STIG to compare the individual requirements

View

Select any old version/release of this STIG to view the previous requirements

This Security Technical Implementation Guide is published as a tool to improve the security of Department of Defense (DOD) information systems. The requirements are derived from the National Institute of Standards and Technology (NIST) 800-53 and related documents. Comments or proposed revisions to this document should be sent via email to the following address: disa.stig_spt@mail.mil.
c
MySQL Database Server 8.0 must integrate with an organization-level authentication/access mechanism providing account management and automation for all users, groups, roles, and any other principals.
AC-2 - High - CCI-000015 - V-235095 - SV-235095r879522_rule
RMF Control
AC-2
Severity
High
CCI
CCI-000015
Version
MYS8-00-000100
Vuln IDs
  • V-235095
Rule IDs
  • SV-235095r879522_rule
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 non-centralized 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 DBMS must be configured to automatically utilize organization-level account management functions, and these functions must immediately enforce the organization's current account policy. Automation may be comprised of differing technologies that when placed together contain an overall mechanism supporting an organization's automated account management requirements.
Checks: C-38314r623405_chk

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 '%ldap%' OR PLUGIN_NAME LIKE '%pam%' OR PLUGIN_NAME LIKE '%authentication_windows %'; 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 'auth%' ; If the LDAP plugin is installed, check the ldap_host 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="dc=example,dc=com" authentication_ldap_sasl_server_host=127.0.0.1 authentication_ldap_sasl_bind_base_dn="dc=example,dc=com" If the ldap_host is not a valid authentication host or the mapping to the base_dn 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 'authentication_pam'; 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 "authentication string". 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 'authentication_windows; 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 'auth%' and `user`.`User` not like 'mysql.%'; If any accounts listed by the query are not listed in the documentation and authorized, this is a finding.

Fix: F-38277r623406_fix

Integrate MySQL database server 8.0 security with an organization-level authentication/access mechanism using MySQL external authentication for Microsoft AD or LDAP, or Linux PAMs thus providing account management for all users, groups, roles, and any other principals. If native mysql users are required, document the need and justification; describe the measures taken to ensure the use of MySQL Server authentication is kept to a minimum; describe the measures taken to safeguard passwords; list or describe the MySQL logins used. For each MySQL database server 8.0 managed account that is not documented and approved, either transfer it to management by the external mechanism, or document the need for it and obtain approval, as appropriate. Install appropriate external authentication plugin, for example to install LDAP. INSTALL PLUGIN authentication_ldap_sasl SONAME 'authentication_ldap_sasl.so'; INSTALL PLUGIN authentication_ldap_simple SONAME 'authentication_ldap_simple.so'; Configure the plugin, for example: SET PERSIST authentication_ldap_sasl_server_host='127.0.0.1'; SET PERSIST authentication_ldap_sasl_bind_base_dn='dc=example,dc=com'; SET PERSIST authentication_ldap_simple_server_host='127.0.0.1'; SET PERSIST authentication_ldap_simple_bind_base_dn='dc=example,dc=com'; Create users with proper organizational mapping, for example: CREATE USER 'betsy'@'localhost' IDENTIFIED WITH authentication_ldap_simple BY 'uid=betsy_ldap,ou=People,dc=example,dc=com'; Assign appropriate permissions via grants on objects or to roles, etc. See https://dev.mysql.com/doc/refman/8.0/en/grant.html. For example: GRANT ALL ON db1.* TO 'betsy'@'localhost'; GRANT 'role1', 'role2' TO 'user1'@'localhost', 'user2'@'localhost'; GRANT SELECT ON world.* TO 'role3'; For accounts not required in the MySQL Server: DROP USER <user_name>;

b
MySQL Database Server 8.0 must limit the number of concurrent sessions to an organization-defined number per user for all accounts and/or account types.
AC-10 - Medium - CCI-000054 - V-235096 - SV-235096r879511_rule
RMF Control
AC-10
Severity
Medium
CCI
CCI-000054
Version
MYS8-00-000200
Vuln IDs
  • V-235096
Rule IDs
  • SV-235096r879511_rule
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 can potentially connect to the DBMS by other means. The organization will need to 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, 2 might be an acceptable limit for general users accessing the database via an application; but 10 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.)
Checks: C-38315r623408_chk

Determine whether the system documentation specifies limits on the number of concurrent MySQL database server 8.0 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 max_user_connections 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 'max_user_connections' ; If the value of MAX_USER_CONNECTIONS is 0 (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 'mysql.%' and user not like 'root'; If the user account has a nonzero MAX_USER_CONNECTIONS resource limit, the session MAX_USER_CONNECTIONS value is set to that limit. Otherwise, the session max_user_connections 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.

Fix: F-38278r623409_fix

The MySQL Database Server 8.0 is capable of enforcing this restriction. If not configured to do so, configure it to do so. Connect to the MySQL Database as an administrator. To set the global default to 50: SET PERSIST max_user_connections=50; Additionally, max user connections can be set per user as well as for a given period of time. GRANT ALL ON customer.* TO 'francis'@'localhost' WITH MAX_CONNECTIONS_PER_HOUR 5; MAX_USER_CONNECTIONS 2;

b
MySQL Database Server 8.0 must produce audit records containing sufficient information to establish what type of events occurred.
AU-3 - Medium - CCI-000130 - V-235097 - SV-235097r879563_rule
RMF Control
AU-3
Severity
Medium
CCI
CCI-000130
Version
MYS8-00-000300
Vuln IDs
  • V-235097
Rule IDs
  • SV-235097r879563_rule
Information system auditing capability is critical for accurate forensic analysis. Without establishing what type of event occurred, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. Audit record content that may be necessary to satisfy the requirement of this policy includes, for example, time stamps, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. Associating event types with detected events in the application and audit logs provides a means of investigating an attack; recognizing resource utilization or capacity thresholds; or identifying an improperly configured application. Database software is capable of a range of actions on data stored within the database. It is important, for accurate forensic analysis, to know exactly what actions were performed. This requires specific information regarding the event type to which an audit record refers. If event type information is not recorded and stored with the audit record, the record itself is of very limited use. MySQL provides auditing using the MySQL Enterprise Audit Log Plugin. When installed, the audit plugin enables MySQL Server to produce a log file containing an audit record of server activity. The log contents include when clients connect and disconnect, and what actions they perform while connected, such as which databases and tables they access.
Checks: C-38316r623411_chk

Verify, using vendor and system documentation if necessary, that the Database Management System (DBMS) is configured to use MySQL auditing features, or that a third-party product or custom code is deployed and configured to satisfy this requirement. Check MySQL auditing to determine whether organization-defined auditable events are being audited by the system. SELECT PLUGIN_NAME, plugin_status FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit_log' ; If the results are not 'audit_log' and plugin_status='ACTIVE' , this is a finding. Next, determine if the audit log is encrypted: SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME LIKE 'audit_log_encryption' ; If nothing is returned or the value for audit_log_encryption is not AES, this is a finding. Review the audit files in the file systems. Run the following command using the audit log location from above and review its output: ls -l &lt;directory where audit log files are located&gt;/audit*log* For example, if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log ls -l /usr/local/mysql/data/audit.log Example output: -rw-r----- 1 _mysql _mysql 3935888 Apr 25 12:34 audit.20190425T173437.log.enc -rw-r----- 1 _mysql _mysql 2336 Apr 25 12:35 audit.20190425T173527.log.enc -rw-r----- 1 _mysql _mysql 13763984 Apr 30 14:04 audit.log.enc Next, verify the log files have set permissions the log_destination: If the user owner is not "mysql", this is a finding. If the group owner is not "mysql", this is a finding. If the file is more permissive than "640", this is a finding. Check that the files end with the ".enc" file extension. If they do not, this means they are in plaintext, and this is a finding. Run following command to verify the directory permissions and review its output: ls -l /usr/local/mysql/data Example output: drwxr-x--- _mysql _mysql 1760 Apr 26 09:55 data Next, verify the log files have set permissions for the log_destination: If the user owner is not "mysql", this is a finding. If the group owner is not "mysql", this is a finding. If more permissive than "750", this is a finding. If there are no audit log files, then organizational auditable events are not being audited, and this is a finding. To confirm that MySQL audit is capturing sufficient information to establish the identity of the user/subject or process, perform a successful auditable action and an auditable action that results in an SQL error, and then view the results in the audit file, whichever is in use. If no audit event is returned for the auditable actions just performed, this is a finding.

Fix: F-38279r623412_fix

Configure DBMS auditing to audit standard and organization-defined auditable events, with the audit record to include what type of event occurred. Use this process to ensure auditable events are captured: Configure MySQL database server 8.0 for auditing and configure audit settings to include required events as part of the audit record. To install MySQL Enterprise Audit: Run the audit_log_filter_linux_install.sql script located in the sharedirectory of your MySQL installation. This can be determined by running – select @@basedir; For example if the basedir is /usr/local/mysql shell> bin/mysql -u root -p < /usr/local/mysql/share/audit_log_filter_linux_install.sql Verify the plugin installation by running: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The value for audit_log should return ACTIVE. To prevent the plugin from being removed at runtime, add the --audit-log option under the [mysqld] option group in the MySQL configuration file (/etc/my.cnf) with a setting of FORCE_PLUS_PERMANENT. audit-log=FORCE_PLUS_PERMANENT Restart the server to apply the configuration change. By default, rule-based audit log filtering logs no auditable events for any users. To produce log-everything behavior with rule-based filtering, create a filter to enable logging of all events and assign it to the audit all accounts. Run the following statements to filter all activity for all users: SELECT audit_log_filter_set_filter('log_all', '{ "filter": { "log": true } }'); SELECT audit_log_filter_set_user('%', 'log_all'); SELECT audit_log_filter_set_user('%', 'log_all');

b
The MySQL Database Server 8.0 must include additional, more detailed, organizationally defined information in the audit records for audit events identified by type, location, or subject.
AU-3 - Medium - CCI-000135 - V-235098 - SV-235098r879569_rule
RMF Control
AU-3
Severity
Medium
CCI
CCI-000135
Version
MYS8-00-000800
Vuln IDs
  • V-235098
Rule IDs
  • SV-235098r879569_rule
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.
Checks: C-38317r623414_chk

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.

Fix: F-38280r623415_fix

Design and deploy an audit configuration that captures all auditable events and data items. Create rule SELECT audit_log_filter_set_filter('log_all', '{ "filter": { "log": true } }'); SELECT audit_log_filter_set_user('%', 'log_all'); If a third-party tool is used for auditing, it must contain all the required information including, but not limited to, events, type, location, subject, date and time and by whom the change occurred. Implement additional custom audits to capture the additional organizationally required information.

b
The audit information produced by the MySQL Database Server 8.0 must be protected from unauthorized read access.
AU-9 - Medium - CCI-000162 - V-235099 - SV-235099r879576_rule
RMF Control
AU-9
Severity
Medium
CCI
CCI-000162
Version
MYS8-00-001200
Vuln IDs
  • V-235099
Rule IDs
  • SV-235099r879576_rule
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 potentially 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 audit_log_file 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.
Checks: C-38318r623417_chk

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 LIKE 'audit_log_file'; If there is no path for audit_log_file, then the audit files are located in the datadir. Run the this script to find the data directory: SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME LIKE 'datadir'; 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 - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log ls -l /usr/local/mysql/data/ See below for an example: Note: .enc 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 "mysql" or "_mysql", 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 "750", this is a finding.

Fix: F-38281r623418_fix

Apply controls and modify permissions to protect database audit log data from unauthorized access, whether stored in the database itself or at the OS level. sudo vi /etc/my.cnf [mysqld] audit-log=FORCE_PLUS_PERMANENT audit-log-format=JSON audit-log-encryption=AES After changing the my.cnf, restart the server. If not performed already, set the audit log password. SELECT audit_log_encryption_password_set(password); Set appropriate permissions on the directory and audit files. sudo chown mysql <audit directory path> sudo chgrp mysql <audit directory path> Change permissions chmod 750 <directory path>

b
The audit information produced by the MySQL Database Server 8.0 must be protected from unauthorized modification.
AU-9 - Medium - CCI-000163 - V-235100 - SV-235100r879577_rule
RMF Control
AU-9
Severity
Medium
CCI
CCI-000163
Version
MYS8-00-001300
Vuln IDs
  • V-235100
Rule IDs
  • SV-235100r879577_rule
If audit data were to become compromised, then competent forensic analysis and discovery of the true source of potentially malicious system activity is impossible to achieve. To ensure the veracity of audit data the information system and/or the application must protect audit information from unauthorized modification. This requirement can be achieved through multiple methods that will depend upon system architecture and design. Some commonly employed methods include ensuring log files enjoy the proper file system permissions and limiting log data locations. Applications providing a user interface to audit data will leverage user permissions and roles identifying the user accessing the data and the corresponding rights the user enjoys to make access decisions regarding the modification of audit data. Audit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity. Modification of database audit data could mask the theft of, or the unauthorized modification of, sensitive data stored in the database.
Checks: C-38319r623420_chk

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 LIKE 'audit_log_file'; If there is no path for audit_log_file then the audit files are located in the datadir. Run the this script to find the data directory: SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME LIKE 'datadir'; 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 - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log ls -l /usr/local/mysql/data/audit See below for an example: Note: .enc 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 "mysql" or" _mysql", 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 "750", this is a finding.

Fix: F-38282r623421_fix

Apply controls and modify permissions to protect database audit log data from unauthorized access, whether stored in the database itself or at the OS level. sudo vi /etc/my.cnf [mysqld] audit-log=FORCE_PLUS_PERMANENT audit-log-format=JSON audit-log-encryption=AES After changing the my.cnf restart the server. If not performed already, set the audit log password. SELECT audit_log_encryption_password_set(password); Set appropriate permissions on the directory and audit files. sudo chown mysql <audit directory path> sudo chgrp mysql <audit directory path> Change permissions chmod 750 <directory path>

b
The audit information produced by the MySQL Database Server 8.0 must be protected from unauthorized deletion.
AU-9 - Medium - CCI-000164 - V-235101 - SV-235101r879578_rule
RMF Control
AU-9
Severity
Medium
CCI
CCI-000164
Version
MYS8-00-001400
Vuln IDs
  • V-235101
Rule IDs
  • SV-235101r879578_rule
If audit data were to become compromised, then competent forensic analysis and discovery of the true source of potentially malicious system activity is impossible to achieve. To ensure the veracity of audit data, the information system and/or the application must protect audit information from unauthorized deletion. 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; restricting access; and backing up log data to ensure log data is retained. Applications providing a user interface to audit data will leverage user permissions and roles identifying the user accessing the data and the corresponding rights the user enjoys in order make access decisions regarding the deletion of audit data. Audit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity. Deletion of database audit data could mask the theft of, or the unauthorized modification of, sensitive data stored in the database.
Checks: C-38320r623423_chk

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 LIKE 'audit_log_file'; If there is no path for audit_log_file then the audit files are located in the datadir. Run the this script to find the data directory: SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME LIKE 'datadir'; 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 - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log ls -l /usr/local/mysql/data/ See below for an example: Note: .enc 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 "mysql" or "_mysql", 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 "750", this is a finding.

Fix: F-38283r623424_fix

Apply controls and modify permissions to protect database audit log data from unauthorized access, whether stored in the database itself or at the OS level. sudo vi /etc/my.cnf [mysqld] audit-log=FORCE_PLUS_PERMANENT audit-log-format=JSON audit-log-encryption=AES After changing the my.cnf, restart the server. If not performed already, set the audit log password. SELECT audit_log_encryption_password_set(password); Set appropriate permissions on the directory and audit files. sudo chown mysql <audit directory path> sudo chgrp mysql <audit directory path> Change permissions chmod 750 <directory path>

b
The MySQL Database Server 8.0 must protect against a user falsely repudiating having performed organization-defined actions.
AU-10 - Medium - CCI-000166 - V-235102 - SV-235102r879554_rule
RMF Control
AU-10
Severity
Medium
CCI
CCI-000166
Version
MYS8-00-001500
Vuln IDs
  • V-235102
Rule IDs
  • SV-235102r879554_rule
Non-repudiation 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. Non-repudiation 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 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.
Checks: C-38321r623426_chk

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 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.

Fix: F-38284r623427_fix

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'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 persons possible.

b
The MySQL Database Server 8.0 must be configured to provide audit record generation capability for DoD-defined auditable events within all database components.
AU-12 - Medium - CCI-000169 - V-235103 - SV-235103r879559_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000169
Version
MYS8-00-001600
Vuln IDs
  • V-235103
Rule IDs
  • SV-235103r879559_rule
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. DoD 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.
Checks: C-38322r623429_chk

Check MySQL auditing to determine whether organization-defined auditable events are being audited by the system. SELECT PLUGIN_NAME, plugin_status FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit_log' ; If nothing is returned OR if the results are not "audit_log" and "plugin_status='ACTIVE'" , this is a finding. Next determine if the audit lot is encrypted. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME LIKE 'audit_log_encryption' ; If nothing is returned OR the value for audit_log_encryption is not "AES", this is a finding.

Fix: F-38285r623430_fix

Deploy a MySQL Database Server 8.0 that supports the DoD minimum set of auditable events. Configure the MySQL Database Server 8.0 to generate audit records for at least the DoD minimum set of events. sudo vi /etc/my.cnf [mysqld] audit-log=FORCE_PLUS_PERMANENT audit-log-format=JSON audit-log-encryption=AES After changing the my.cnf, restart the server. SELECT audit_log_encryption_password_set(password); Create auditing rules - for example: Connect to MySQL and Use functions to define audit rules and audited users audit_log_filter_set,audit_log_filter_set_user To log all auditable events: SELECT audit_log_filter_set_filter('log_all', '{ "filter": { "log": true } }'); And to apply this log_all filter to all users: SELECT audit_log_filter_set_user('%', 'log_all');

b
The MySQL Database Server 8.0 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.
AU-12 - Medium - CCI-000171 - V-235104 - SV-235104r879560_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000171
Version
MYS8-00-001700
Vuln IDs
  • V-235104
Rule IDs
  • SV-235104r879560_rule
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'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. AUDIT_ADMIN enables audit log configuration. This privilege is defined by the audit_log plugin when it is installed. SUPER is a powerful and far-reaching privilege and should not be granted lightly.
Checks: C-38323r623432_chk

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 this query: SELECT * FROM INFORMATION_SCHEMA.USER_PRIVILEGES where PRIVILEGE_TYPE in ('AUDIT_ADMIN', 'SUPER'); 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.

Fix: F-38286r623433_fix

Configure the MySQL Database Server 8.0 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 '<auditusername>'@'<host_specification>'; For example: GRANT AUDIT_ADMIN ON *.* TO 'auditusername'@'%';

b
The MySQL Database Server 8.0 must be able to generate audit records when privileges/permissions are retrieved.
AU-12 - Medium - CCI-000172 - V-235105 - SV-235105r879561_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-001800
Vuln IDs
  • V-235105
Rule IDs
  • SV-235105r879561_rule
Under some circumstances, it may be useful to monitor who/what is reading privilege/permission/role information. Therefore, it must be possible to configure auditing to do this. Database Management Systems (DBMSs) typically make such information available through views or functions. This requirement addresses explicit requests for privilege/permission/role membership information. It does not refer to the implicit retrieval of privileges/permissions/role memberships that the DBMS continually performs to determine if any and every action on the database is permitted.
Checks: C-38324r623435_chk

Review the system documentation to determine if MySQL Server is required to audit the retrieval of privilege/permission/role membership information. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 privileges/permissions are retrieved, run the following query: select * from mysql.proxies_priv; Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log|egrep proxies_prim For example if the values returned by - "select @@datadir, @@audit_log_file;" are /usr/local/mysql/data/, audit.log ls -l /usr/local/mysql/data/audit.log The audit data will look similar to the example below: { "timestamp": "2020-08-19 21:03:39", "id": 13, "class": "general", "event": "status", "connection_id": 9, "account": { "user": "root", "host": "localhost" }, "login": { "user": "root", "os": "", "ip": "::1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "select", "query": "select * from mysql.proxies_priv\nLIMIT 0, 1000", "status": 0 } }, If the audit event is not present, this is a finding.

Fix: F-38287r623436_fix

If currently required, configure the MySQL Database Server to produce audit records when audit when privileges/permissions are retrieved. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must be able to generate audit records when unsuccessful attempts to retrieve privileges/permissions occur.
AU-12 - Medium - CCI-000172 - V-235106 - SV-235106r879561_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-001900
Vuln IDs
  • V-235106
Rule IDs
  • SV-235106r879561_rule
Under some circumstances, it may be useful to monitor who/what is reading privilege/permission/role information. Therefore, it must be possible to configure auditing to do this. Database Management Systems (DBMSs) typically make such information available through views or functions. This requirement addresses explicit requests for privilege/permission/role membership information. It does not refer to the implicit retrieval of privileges/permissions/role memberships that the DBMS continually performs to determine if any and every action on the database is permitted. To aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.
Checks: C-38325r623438_chk

Review the system documentation to determine if MySQL Server is required to audit when unsuccessful attempts to retrieve privileges/permissions occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin should be "active". If it is not "active", 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 to audit when unsuccessful attempts to retrieve privileges/permissions occur, run the following query using a user that does not have privileges so that it fails: select * from mysql.proxies_priv; ERROR: 1142: SELECT command denied to user 'auditme'@'localhost' for table 'proxies_priv' Review the audit log by running the command: sudo cat &lt;directory where audit log files are located&gt;/audit.log|egrep proxies_priv For example if the values returned by "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep proxies_priv The audit data will look similar to the example below: { "timestamp": "2020-08-19 21:10:39", "id": 1, "class": "general", "event": "status", "connection_id": 13, "account": { "user": "auditme", "host": "localhost" }, "login": { "user": "auditme", "os": "", "ip": "::1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "select", "query": "select * from mysql.proxies_priv", "status": 1142 } }, Note status is 1142, like the error. If the audit event is not present, this is a finding.

Fix: F-38288r623439_fix

If currently required, configure the MySQL Database Server to produce audit records when unsuccessful attempts to retrieve privileges/permissions occur. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must be able to generate audit records when security objects are accessed.
AU-12 - Medium - CCI-000172 - V-235107 - SV-235107r879863_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-002000
Vuln IDs
  • V-235107
Rule IDs
  • SV-235107r879863_rule
Changes to the security configuration must be tracked. This requirement applies to situations where security data is retrieved or modified via data manipulation operations, as opposed to via specialized security functionality. In SQL environment, types of access include, but are not necessarily limited to: SELECT INSERT UPDATE DELETE EXECUTE
Checks: C-38326r623441_chk

Review the system documentation to determine if MySQL Server is required to audit when security objects are accessed. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin should be "active". If it is not "active", 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 security objects are accessed, run the following query: select * from mysql.proxies_priv; Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log|egrep proxies_prim For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep proxies_priv The audit data will look similar to the example below: { "timestamp": "2020-08-19 21:03:39", "id": 13, "class": "general", "event": "status", "connection_id": 9, "account": { "user": "root", "host": "localhost" }, "login": { "user": "root", "os": "", "ip": "::1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "select", "query": "select * from mysql.proxies_priv\nLIMIT 0, 1000", "status": 0 } }, If the audit event is not present, this is a finding.

Fix: F-38289r623442_fix

If currently required, configure the MySQL Database Server to produce audit records when security objects are accessed. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful attempts to access security objects occur.
AU-12 - Medium - CCI-000172 - V-235108 - SV-235108r879863_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-002100
Vuln IDs
  • V-235108
Rule IDs
  • SV-235108r879863_rule
Changes to the security configuration must be tracked. This requirement applies to situations where security data is retrieved or modified via data manipulation operations, as opposed to via specialized security functionality. In a SQL environment, types of access include, but are not necessarily limited to: SELECT INSERT UPDATE DELETE EXECUTE To aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.
Checks: C-38327r623444_chk

Review the system documentation to determine if MySQL Server is required to audit when unsuccessful attempts to access security objects occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 when unsuccessful attempts to access security objects occur, run the following query with a user that does not have privileges so that it will fail: select * from mysql.proxies_priv; ERROR: 1142: SELECT command denied to user 'auditme'@'localhost' for table 'proxies_priv' Review the audit log by running the command: sudo cat &lt;directory where audit log files are located&gt;/audit.log|egrep proxies_priv For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep proxies_priv For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep proxies_priv The audit data will look similar to the example below: { "timestamp": "2020-08-19 21:10:39", "id": 1, "class": "general", "event": "status", "connection_id": 13, "account": { "user": "auditme", "host": "localhost" }, "login": { "user": "auditme", "os": "", "ip": "::1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "select", "query": "select * from mysql.proxies_priv", "status": 1142 } }, Note status is 1142, like the error. If the audit event is not present, this is a finding.

Fix: F-38290r623445_fix

If currently required, configure the MySQL Database Server to produce audit records when unsuccessful attempts to retrieve privileges/permissions occur. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when categories of information (e.g., classification levels/security levels) are accessed.
AU-12 - Medium - CCI-000172 - V-235109 - SV-235109r879865_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-002200
Vuln IDs
  • V-235109
Rule IDs
  • SV-235109r879865_rule
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.
Checks: C-38328r623447_chk

If classification levels/security levels labeling is not required, this is not a finding. Review the system documentation to determine if MySQL Server is required to audit records when unsuccessful attempts to delete categories of information (e.g., classification levels/security levels) occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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. Modify MySQL selects that check for changes to categories of information. Modify selects statements to audit when information categories are accessed using MySQL Audit by calling the audit_api_message_emit_udf() function and including the details related to the select. - An Example test - CREATE TABLE `test_trigger`.`info_cat_test` ( `id` INT NOT NULL, `name` VARCHAR(20) NULL, `desc` VARCHAR(20) NULL, `sec_level` CHAR(1) NULL, PRIMARY KEY (`id`)); DELIMITER $$ INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('1', 'fred', 'engineer', 'H'); INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('2', 'jill', 'program manager', 'M'); INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('3', 'joe', 'maintenance', 'L'); SELECT `info_cat_test`.`id`, `info_cat_test`.`name`, `info_cat_test`.`desc`, `info_cat_test`.`sec_level`, IF(`info_cat_test`.`sec_level`= 'H', audit_api_message_emit_udf('sec_level_selected', 'audit_select_attempt', ' H level sec data was accessed', 'FOR ', name ), 'Not Audited') FROM `test_trigger`.`info_cat_test`; Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log | egrep sec_level_selected For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep sec_level_priv The audit data will look similar to the example below: { "timestamp": "2020-08-20 21:19:21", "id": 1, "class": "message", "event": "user", "connection_id": 9, "account": { "user": "root", "host": "localhost" }, "login": { "user": "root", "os": "", "ip": "::1", "proxy": "" }, "message_data": { "component": "sec_level_selected", "producer": "audit_select_attempt", "message": " H level sec data was accessed", "map": { "FOR ": "fred" } } }, If the audit event is not present, this is a finding.

Fix: F-38291r623448_fix

If currently required, configure the MySQL Database Server with stored procedures that use selects that call audit_api_message_emit_udf() function to produce audit records when selection of categories of information occurs. Add security level details in an additional column. Add the component for adding information to the audit log. INSTALL COMPONENT "file://component_audit_api_message_emit”; create schema test_trigger; Modify selections adding the audit_api_message_emit_udf to be called, as well as providing the details for the audit event. Transparently enforcing the use of MySQL stored procedures is required. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful attempts to access categories of information (e.g., classification levels/security levels) occur.
AU-12 - Medium - CCI-000172 - V-235110 - SV-235110r879865_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-002300
Vuln IDs
  • V-235110
Rule IDs
  • SV-235110r879865_rule
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.
Checks: C-38329r623450_chk

If classification levels/security levels labeling is not required, this is not a finding. Review the system documentation to determine if MySQL Server is required to audit records when unsuccessful attempts to access categories of information (e.g., classification levels/security levels) occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin should be "active". If it is not "active", 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. Modify MySQL selects that check for changes to categories of information. Modify selects statements to audit when information categories are access using MySQL Audit by calling the audit_api_message_emit_udf() function and including the details related to the select. - An Example test - CREATE TABLE `test_trigger`.`info_cat_test` ( `id` INT NOT NULL, `name` VARCHAR(20) NULL, `desc` VARCHAR(20) NULL, `sec_level` CHAR(1) NULL, PRIMARY KEY (`id`)); DELIMITER $$ INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('1', 'fred', 'engineer', 'H'); INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('2', 'jill', 'program manager', 'M'); INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('3', 'joe', 'maintenance', 'L'); Create a view using the where clause similar to that shown in the select. If inappropriate access is attempted, in this case H level, the select statement will write to the Audit log using the emit function. SELECT `info_cat_test`.`id`, `info_cat_test`.`name`, `info_cat_test`.`desc`, `info_cat_test`.`sec_level` FROM `test_trigger`.`info_cat_test` where IF(`info_cat_test`.`sec_level`= 'H', CAST(audit_api_message_emit_udf('sec_level_H_ATTEMPTED_selected', 'audit_select_attempt', ' H level sec data was accessed', 'FOR ', name ) as CHAR), 'Not Audited') &lt;&gt; 'OK’; The above test will write an audit event related to the selection of H sec_level data. Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log | egrep sec_level_H_ATTEMPTED_selected For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep sec_level_H_ATTEMPTED_selected If the audit event similar to the example below is not present, this is a finding. The audit data will look similar to the example below: Not Audited') &lt;&gt; 'OK'\nLIMIT 0, 1000", "sql_command": "select" } }, { "timestamp": "2020-08-21 14:04:53", "id": 2, "class": "message", "event": "user", "connection_id": 9, "account": { "user": "root", "host": "localhost" }, "login": { "user": "root", "os": "", "ip": "::1", "proxy": "" }, "message_data": { "component": "sec_level_H_ATTEMPTED_selected", "producer": "audit_select_attempt", "message": " H level sec data was accessed", "map": { "FOR ": "fred" } } },

Fix: F-38292r623451_fix

If currently required, configure the MySQL Database Server with views that use selects that call audit_api_message_emit_udf() function to produce audit records when selection of categories of information occurs. Add security level details in an additional column if necessary. Add the component for adding information to the audit log. INSTALL COMPONENT "file://component_audit_api_message_emit”; To transparently enforce the use of MySQL view is required. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when privileges/permissions are added.
AU-12 - Medium - CCI-000172 - V-235111 - SV-235111r879866_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-002400
Vuln IDs
  • V-235111
Rule IDs
  • SV-235111r879866_rule
Changes in the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized elevation or restriction of individuals and groups 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 a SQL environment, adding permissions is typically done via the GRANT command, or, in the negative, the DENY command.
Checks: C-38330r623453_chk

Check that MySQL Server Audit is being used for the STIG compliant audit. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin should be "active". If it is not "active", 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 log_stig. Review the filter value. It will show filters for events of the type field general_sql_command.str for the following SQL statement types: grant grant_roles revoke revoke_all revoke_roles drop_role alter_user_default_role create_role drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user

Fix: F-38293r623454_fix

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 drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful attempts to add privileges/permissions occur.
AU-12 - Medium - CCI-000172 - V-235112 - SV-235112r879866_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-002500
Vuln IDs
  • V-235112
Rule IDs
  • SV-235112r879866_rule
Failed attempts to change the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized attempts to elevate or restrict individuals and groups privileges could go undetected. In a SQL environment, adding permissions is typically done via the GRANT command, or, in the negative, the DENY command. To aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.
Checks: C-38331r623456_chk

Check that MySQL Server Audit is being used for the STIG compliant audit. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 log_stig. Review the filter values. It will show filters for events of the type of field general_sql_command.str for the following SQL statement types: grant grant_roles revoke revoke_all revoke_roles drop_role alter_user_default_role create_role drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user

Fix: F-38294r623457_fix

Configure the MySQL Database Server to audit when privileges/permissions are added. Add the following events to the MySQL Server Audit that is being used for the STIG compliance audit: grant grant_roles revoke revoke_all revoke_roles drop_role alter_user_default_role create_role drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when privileges/permissions are modified.
AU-12 - Medium - CCI-000172 - V-235113 - SV-235113r879866_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-002600
Vuln IDs
  • V-235113
Rule IDs
  • SV-235113r879866_rule
Changes in the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized elevation or restriction of individuals and groups privileges could go undetected. Elevated privileges give users access to information and functionality that they should not have; restricted privileges wrongly deny access to authorized users. In a SQL environment, modifying permissions is typically done via the GRANT, REVOKE, and DENY commands.
Checks: C-38332r623459_chk

Check that MySQL Server Audit is being used for the STIG compliant audit. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 log_stig. Review the filter values it will show filters for events of the type of the field general_sql_command.str for the following SQL statement types: grant grant_roles revoke revoke_all revoke_roles drop_role alter_user_default_role create_role drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user

Fix: F-38295r623460_fix

Configure the MySQL Database Server to audit when privileges/permissions are added. Add the following events to the MySQL Server Audit that is being used for the STIG compliance audit: grant grant_roles revoke revoke_all revoke_roles drop_role alter_user_default_role create_role drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful attempts to modify privileges/permissions occur.
AU-12 - Medium - CCI-000172 - V-235114 - SV-235114r879866_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-002700
Vuln IDs
  • V-235114
Rule IDs
  • SV-235114r879866_rule
Failed attempts to change the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized attempts to elevate or restrict individual and group privileges could go undetected. In an SQL environment, modifying permissions is typically done via the GRANT, REVOKE, and DENY commands. To aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.
Checks: C-38333r623462_chk

Check that MySQL Server Audit is being used for the STIG compliant audit. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 log_stig. Review the filter values. It will show filters for events of the type of the field general_sql_command.str for the following SQL statement types: grant grant_roles revoke revoke_all revoke_roles drop_role alter_user_default_role create_role drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user

Fix: F-38296r623463_fix

Configure the MySQL Database Server to audit when privileges/permissions are added. Add the following events to the MySQL Server Audit that is being used for the STIG compliance audit: grant grant_roles revoke revoke_all revoke_roles drop_role alter_user_default_role create_role drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when security objects are modified.
AU-12 - Medium - CCI-000172 - V-235115 - SV-235115r879867_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-002800
Vuln IDs
  • V-235115
Rule IDs
  • SV-235115r879867_rule
Changes in the database objects (tables, views, procedures, functions) that record and control permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized changes to the security subsystem could go undetected. The database could be severely compromised or rendered inoperative.
Checks: C-38334r623465_chk

Review the system documentation to determine if MySQL Server is required to audit when security objects are modified. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 security objects are modified, run the following, which will test auditing without destroying data: update mysql.global_grants set host='%' where PRIV='XXXX’; Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log|egrep global_grants For example if the values returned by "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep global_grants For example if the values returned by "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep global_grants The audit data will look similar to the example below: { "timestamp": "2020-08-19 21:32:27", "id": 2, "class": "general", "event": "status", "connection_id": 9, "account": { "user": "root", "host": "localhost" }, "login": { "user": "root", "os": "", "ip": "::1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "update", "query": "update mysql.global_grants set host='%' where PRIV='XXXX'", "status": 0 } } If the audit event is not present, this is a finding.

Fix: F-38297r623466_fix

If currently required, configure the MySQL Database Server to produce audit records when security objects are modified. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful attempts to modify security objects occur.
AU-12 - Medium - CCI-000172 - V-235116 - SV-235116r879867_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-002900
Vuln IDs
  • V-235116
Rule IDs
  • SV-235116r879867_rule
Changes in the database objects (tables, views, procedures, functions) that record and control permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized changes to the security subsystem could go undetected. The database could be severely compromised or rendered inoperative. To aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.
Checks: C-38335r623468_chk

Review the system documentation to determine if MySQL Server is required to audit when unsuccessful attempts to modify security objects occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 when unsuccessful attempts to modify security objects occur, run the following as a user without administrator-level privileges: update mysql.global_grants set host='%' where PRIV='XXXX’; Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log|egrep global_grants For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep global_grants The audit data will look similar to the example below and contain a non-zero status value: { "timestamp": "2020-08-19 21:32:27", "id": 2, "class": "general", "event": "status", "connection_id": 9, "account": { "user": "root", "host": "localhost" }, "login": { "user": "root", "os": "", "ip": "::1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "update", "query": "update mysql.global_grants set host='%' where PRIV='XXXX'", "status": 1421 } } If the audit event is not present, this is a finding.

Fix: F-38298r623469_fix

If currently required, configure the MySQL Database Server to produce audit records when unsuccessful attempts to modify security objects occur. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when categories of information (e.g., classification levels/security levels) are modified.
AU-12 - Medium - CCI-000172 - V-235117 - SV-235117r879869_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-003000
Vuln IDs
  • V-235117
Rule IDs
  • SV-235117r879869_rule
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.
Checks: C-38336r623471_chk

If classification levels/security levels labeling is not required, this is not a finding. Review the system documentation to determine if MySQL Server is required to audit records when deletion of categories of information (e.g., classification levels/security levels) occurs. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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. Create MySQL insert, update, and delete triggers that check for changes to categories of information. If the trigger before data indicates an attempt to delete such information, the trigger must be written to prevent the delete as well as optionally write to the MySQL Audit by calling the audit_api_message_emit_udf() function and including the details related to the attempt. Note: To call from a trigger requires a minimal stored procedure as well. Once the trigger has been created, check if the audit filters in place are generating records when categories of information are deleted. - An Example test - CREATE TABLE `test_trigger`.`info_cat_test` ( `id` INT NOT NULL, `name` VARCHAR(20) NULL, `desc` VARCHAR(20) NULL, `sec_level` CHAR(1) NULL, PRIMARY KEY (`id`)); use test_trigger; DELIMITER $$ CREATE TRIGGER test_trigger.audit_delete BEFORE DELETE ON `test_trigger`.`info_cat_test` FOR EACH ROW BEGIN IF OLD.sec_level = 'H' THEN CALL audit_api_message_emit_sp(OLD.name); END IF; END$$ DELIMITER ; DELIMITER $$ CREATE TRIGGER audit_insert BEFORE INSERT ON `test_trigger`.`info_cat_test` FOR EACH ROW BEGIN IF NEW.sec_level = 'H' THEN CALL audit_api_message_emit_sp(NEW.name); END IF; END$$ DELIMITER ; DELIMITER $$ CREATE TRIGGER audit_update BEFORE UPDATE ON `test_trigger`.`info_cat_test` FOR EACH ROW BEGIN IF OLD.sec_level = 'H' THEN CALL audit_api_message_emit_sp(OLD.name); END IF; IF NEW.sec_level = 'H' THEN CALL audit_api_message_emit_sp(NEW.name); END IF; END$$ DELIMITER ; INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('1', 'fred', 'engineer', 'H'); INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('2', 'jill', 'program manager', 'M'); INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('3', 'joe', 'maintenance', 'L'); delete from `test_trigger`.`info_cat_test` where id=1; // this fails as the trigger defines that sec_level of H can not be deleted. update`test_trigger`.`info_cat_test` set sec_level=‘H’ where id=2; delete from `test_trigger`.`info_cat_test` where id=3; Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log | egrep audit_change_attempt If the audit event is not present, this is a finding.

Fix: F-38299r623472_fix

If currently required, configure the MySQL Database Server with update, insert, and delete triggers that call audit_api_message_emit_udf() function to produce audit records when unsuccessful attempts to modify categories of information occur. Add security level details in an additional column. Add the component for adding information to the audit log. INSTALL COMPONENT "file://component_audit_api_message_emit”; create schema test_trigger; Create a stored procedure to allow the audit_api_message_emit_udf to be called as well as providing the details for the audit event. DELIMITER $$ CREATE PROCEDURE audit_api_message_emit_delete_sp(name CHAR(20)) BEGIN DECLARE aud_msg VARCHAR(255); select audit_api_message_emit_udf('sec_level_trigger', 'TRIGGER audit_change_attempt', 'Attempt was made to change H level sec data', 'FOR ', name ) into aud_msg; END$$ DELIMITER ; See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful attempts to modify categories of information (e.g., classification levels/security levels) occur.
AU-12 - Medium - CCI-000172 - V-235118 - SV-235118r879869_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-003100
Vuln IDs
  • V-235118
Rule IDs
  • SV-235118r879869_rule
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.
Checks: C-38337r623474_chk

If classification levels/security levels labeling is not required, this is not a finding. Review the system documentation to determine if MySQL Server is required to audit records when unsuccessful attempts to modify categories of information (e.g., classification levels/security levels) occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin should be "active". If it is not "active", 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. Create MySQL insert, update, and delete triggers that check for changes to categories of information. If the trigger before data indicates an attempt to delete such information, the trigger should be written to prevent the delete as well as optionally write to the MySQL Audit by calling the audit_api_message_emit_udf() function and including the details related to the attempt. Note: To call from a trigger requires a minimal stored procedure as well. Once the trigger has been created, check if the audit filters that are in place are generating records when categories of information are deleted. - An Example test - CREATE TABLE `test_trigger`.`info_cat_test` ( `id` INT NOT NULL, `name` VARCHAR(20) NULL, `desc` VARCHAR(20) NULL, `sec_level` CHAR(1) NULL, PRIMARY KEY (`id`)); use test_trigger; DELIMITER $$ CREATE TRIGGER audit_delete BEFORE DELETE ON `test_trigger`.`info_cat_test` FOR EACH ROW BEGIN IF OLD.sec_level = 'H' THEN CALL audit_api_message_emit_sp(OLD.name); SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'ERROR - THIS DATA IS LEVEL H can not delete’; END IF; END$$ DELIMITER ; DELIMITER $$ CREATE TRIGGER audit_insert BEFORE INSERT ON `test_trigger`.`info_cat_test` FOR EACH ROW BEGIN IF NEW.sec_level = 'H' THEN CALL audit_api_message_emit_sp(NEW.name); SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'ERROR - THIS DATA IS LEVEL H can not insert’; END IF; END$$ DELIMITER ; DELIMITER $$ CREATE TRIGGER audit_update BEFORE UPDATE ON `test_trigger`.`info_cat_test` FOR EACH ROW BEGIN IF OLD.sec_level = 'H' THEN CALL audit_api_message_emit_sp(OLD.name); END IF; IF NEW.sec_level = 'H' THEN CALL audit_api_message_emit_sp(NEW.name); END IF; SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'ERROR - THIS DATA IS LEVEL H can not update'; END$$ DELIMITER ; INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('1', 'fred', 'engineer', 'H'); INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('2', 'jill', 'program manager', 'M'); INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('3', 'joe', 'maintenance', 'L'); delete from `test_trigger`.`info_cat_test` where id=1; // this fails as the trigger defines that sec_level of H can not be deleted. update`test_trigger`.`info_cat_test` set sec_level=‘H’ where id=2; delete from `test_trigger`.`info_cat_test` where id=3; Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log | egrep audit_change_attempt For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep audit_change_attempt If the audit event is not present, this is a finding.

Fix: F-38300r623475_fix

If currently required, configure the MySQL Database Server with update, insert, and delete triggers that call audit_api_message_emit_udf() function to produce audit records when unsuccessful attempts to modify categories of information occur. Add security level details in an additional column. Add the component for adding information to the audit log. INSTALL COMPONENT "file://component_audit_api_message_emit”; create schema test_trigger; Create a stored procedure to allow the audit_api_message_emit_udf to be called as well as providing the details for the audit event. DELIMITER $$ CREATE PROCEDURE audit_api_message_emit_delete_sp(name CHAR(20)) BEGIN DECLARE aud_msg VARCHAR(255); select audit_api_message_emit_udf('sec_level_trigger', 'TRIGGER audit_change_attempt', 'Attempt was made to change H level sec data', 'FOR ', name ) into aud_msg; END$$ DELIMITER ; See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when privileges/permissions are deleted.
AU-12 - Medium - CCI-000172 - V-235119 - SV-235119r879870_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-003200
Vuln IDs
  • V-235119
Rule IDs
  • SV-235119r879870_rule
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 should not have; restricted privileges wrongly deny access to authorized users. In an SQL environment, deleting permissions is typically done via the REVOKE or DENY command.
Checks: C-38338r623477_chk

Review the system documentation to determine if MySQL Server is required to audit when privileges/permissions are deleted. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 when privileges/permissions are deleted, run the following, which will test auditing without destroying data: delete from mysql.procs_priv where 1=2; Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log|egrep procs_priv For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep procs_priv The audit data will look similar to the example below: { "timestamp": "2020-08-19 21:24:26", "id": 2, "class": "general", "event": "status", "connection_id": 9, "account": { "user": "root", "host": "localhost" }, "login": { "user": "root", "os": "", "ip": "::1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "delete", "query": "delete from procs_priv", "status": 0 } } If the audit event is not present, this is a finding.

Fix: F-38301r623478_fix

If currently required, configure the MySQL Database Server to produce audit records when privileges/permissions are deleted. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful attempts to delete privileges/permissions occur.
AU-12 - Medium - CCI-000172 - V-235120 - SV-235120r879870_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-003300
Vuln IDs
  • V-235120
Rule IDs
  • SV-235120r879870_rule
Failed attempts to change the permissions, privileges, and roles granted to users and roles must be tracked. Without an audit trail, unauthorized attempts to elevate or restrict individuals and groups privileges could go undetected. In a SQL environment, deleting permissions is typically done via the REVOKE or DENY command. To aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.
Checks: C-38339r623480_chk

Review the system documentation to determine if MySQL Server is required to audit when unsuccessful attempts to delete privileges/permissions occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 when unsuccessful attempts to delete privileges/permissions occur, run the following, which will test auditing without destroying data but as a user without administrative privileges so that it fails: delete from mysql.procs_priv where 1=2; Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log|egrep procs_priv For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep procs_priv The audit data will look similar to the example below and contain a non-zero status value: { "timestamp": "2020-08-19 21:24:26", "id": 2, "class": "general", "event": "status", "connection_id": 9, "account": { "user": "root", "host": "localhost" }, "login": { "user": "root", "os": "", "ip": "::1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "delete", "query": "delete from procs_priv", "status": 1142 } } If the audit event is not present, this is a finding.

Fix: F-38302r623481_fix

Configure the MySQL Database Server to audit when unsuccessful attempts to delete privileges/permissions occur. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when security objects are deleted.
AU-12 - Medium - CCI-000172 - V-235121 - SV-235121r879872_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-003400
Vuln IDs
  • V-235121
Rule IDs
  • SV-235121r879872_rule
The removal of security objects from the database/Database Management System (DBMS) would seriously degrade a system's information assurance posture. If such an event occurs, it must be logged.
Checks: C-38340r623483_chk

Review the system documentation to determine if MySQL Server is required to audit when security objects are deleted. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 when security objects are deleted, run the following, which will test auditing. Note: This is destructive. Back up the database table prior to testing so it can be restored. drop mysql.procs_priv; Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log|egrep DROP For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep DROP The audit data will look similar to the example below: { "timestamp": "2020-08-21 17:06:02", "id": 1, "class": "general", "event": "status", "connection_id": 9, "account": { "user": "root", "host": "localhost" }, "login": { "user": "root", "os": "", "ip": "::1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "drop_table", "query": "DROP TABLE `mysql`.`proxies_priv`", "status": 0 } }, If the audit event is not present, this is a finding.

Fix: F-38303r623484_fix

Configure the MySQL Database Server to audit when security objects are deleted. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful attempts to delete security objects occur.
AU-12 - Medium - CCI-000172 - V-235122 - SV-235122r879872_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-003500
Vuln IDs
  • V-235122
Rule IDs
  • SV-235122r879872_rule
The removal of security objects from the database/Database Management System (DBMS) would seriously degrade a system's information assurance posture. If such an action is attempted, it must be logged. To aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.
Checks: C-38341r623486_chk

Review the system documentation to determine if MySQL Server is required to audit when unsuccessful attempts to delete security objects occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 when security objects are deleted, run the following, which will test auditing as a user with administrator-level privileges: drop table mysql.columns_priv; ERROR: 1142: DROP command denied to user 'newuser'@'localhost' for table 'columns_priv' Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log|egrep DROP For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep DROP The audit data will look similar to the example below and contain a non-zero status value: { "timestamp": "2020-08-21 17:21:12", "id": 0, "class": "general", "event": "status", "connection_id": 17, "account": { "user": "newuser", "host": "localhost" }, "login": { "user": "newuser", "os": "", "ip": "::1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "drop_table", "query": "drop table `mysql`.audit_log_user", "status": 1142 } }, If the audit event is not present, this is a finding.

Fix: F-38304r623487_fix

Configure the MySQL Database Server to audit when unsuccessful attempts to delete security objects occur. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when categories of information (e.g., classification levels/security levels) are deleted.
AU-12 - Medium - CCI-000172 - V-235123 - SV-235123r879873_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-003600
Vuln IDs
  • V-235123
Rule IDs
  • SV-235123r879873_rule
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.
Checks: C-38342r623489_chk

Review DBMS documentation to verify that audit records can be produced when categories of information are deleted. If the DBMS is not capable of this, this is a finding. Review the DBMS/database security and audit configurations to verify that audit records are produced when categories of information are deleted. If they are not produced, this is a finding.

Fix: F-38305r623490_fix

Deploy a MySQL Database Server 8.0 capable of producing the required audit records when categories of information are deleted. Configure the MySQL Database Server 8.0 to produce audit records when categories of information are deleted.

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful attempts to delete categories of information (e.g., classification levels/security levels) occur.
AU-12 - Medium - CCI-000172 - V-235124 - SV-235124r879873_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-003700
Vuln IDs
  • V-235124
Rule IDs
  • SV-235124r879873_rule
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.
Checks: C-38343r623492_chk

If classification levels/security levels labeling is not required, this is not a finding. Review the system documentation to determine if MySQL Server is required to audit records when unsuccessful attempts to delete categories of information (e.g., classification levels/security levels) occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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. Create MySQL Delete triggers that check for changes to categories of information. If the trigger before data indicates an attempt to delete such information, the trigger should be written to prevent the delete as well as optionally write to the MySQL Audit by calling the audit_api_message_emit_udf() function and including the details related to the attempt. Note: To call from a trigger requires a minimal stored procedure as well. Once the trigger has been created, check if the audit filters that are in place are generating records when categories of information are deleted. - An Example test - CREATE TABLE `test_trigger`.`info_cat_test` ( `id` INT NOT NULL, `name` VARCHAR(20) NULL, `desc` VARCHAR(20) NULL, `sec_level` CHAR(1) NULL, PRIMARY KEY (`id`)); DELIMITER $$ CREATE TRIGGER test_trigger.audit_delete_attempt BEFORE DELETE ON `test_trigger`.`info_cat_test` FOR EACH ROW BEGIN IF OLD.sec_level = 'H' THEN CALL audit_api_message_emit_sp(OLD.name); SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'ERROR - THIS DATA IS LEVEL H'; END IF; END$$ DELIMITER ; INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('1', 'fred', 'engineer', 'H'); INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('2', 'jill', 'program manager', 'M'); INSERT INTO `test_trigger`.`info_cat_test` (`id`, `name`, `desc`, `sec_level`) VALUES ('3', 'joe', 'maintenance', 'L'); delete from `test_trigger`.`info_cat_test` where id=1; // this fails as the trigger defines that sec_level of H can not be deleted. delete from `test_trigger`.`info_cat_test` where id=2; delete from `test_trigger`.`info_cat_test` where id=3; Review the audit log by running the Linux command: sudo cat &lt;directory where audit log files are located&gt;/audit.log | egrep sec_level_trigger For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep sec_level_trigger If the audit event is not present, this is a finding.

Fix: F-38306r623493_fix

If currently required, configure the MySQL Database Server with delete triggers which prevent unauthorized deletes and call audit_api_message_emit_udf() 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 "file://component_audit_api_message_emit”; create schema test_trigger; Create a stored procedure to allow the audit_api_message_emit_udf to be called as well as providing 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('sec_level_trigger', 'TRIGGER audit_delete_attempt', 'Attempt was made to delete H level sec data', 'FOR ', name ) into aud_msg; END$$ DELIMITER ;

b
The MySQL Database Server 8.0 must generate audit records when successful logons or connections occur.
AU-12 - Medium - CCI-000172 - V-235125 - SV-235125r879874_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-003800
Vuln IDs
  • V-235125
Rule IDs
  • SV-235125r879874_rule
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).
Checks: C-38344r623495_chk

Review the system documentation to determine if MySQL Server is required to audit when successful logons or connections occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 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 'newuser@localhost' MySQL localhost:33060+ ssl SQL &gt; \quit Bye! Review the audit log by running the Linux command: Note, "status": 0 for each indicates successful. sudo cat &lt;directory where audit log files are located&gt;/audit.log | egrep "\"event\": \”connect\"" For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep "\"event\": \”connect\"" The audit data will look similar to the example below: Logging in - connecting { "timestamp": "2020-08-21 17:47:09", "id": 0, "class": "connection", "event": "connect", "connection_id": 19, "account": { "user": "newuser", "host": "localhost" }, "login": { "user": "newuser", "os": "", "ip": "::1", "proxy": "" }, "connection_data": { "connection_type": "plugin", "status": 0, "db": "" } }, Logging out - disconnection sudo cat &lt;directory where audit log files are located&gt;/audit.log | egrep "\"event\": \"disconnect\”" Example output: { "timestamp": "2020-08-21 17:47:11", "id": 1, "class": "connection", "event": "disconnect", "connection_id": 19, "account": { "user": "newuser", "host": "localhost" }, "login": { "user": "newuser", "os": "", "ip": "::1", "proxy": "" }, "connection_data": { "connection_type": "plugin" } },

Fix: F-38307r623496_fix

If currently required, configure the MySQL Database Server to produce audit records when successful logons or connections occur. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful logons or connection attempts occur.
AU-12 - Medium - CCI-000172 - V-235126 - SV-235126r879874_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-003900
Vuln IDs
  • V-235126
Rule IDs
  • SV-235126r879874_rule
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.
Checks: C-38345r623498_chk

Review the system documentation to determine if MySQL Server is required to audit when unsuccessful logons or connection attempts occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 unsuccessful logons or connection attempts occur: Log in to MySQL and then log out. For example, using MySQL Shell: % mysqlsh —sql MySQL SQL &gt; \connect notauser@localhost Creating a session to 'notauser@localhost' Please provide the password for 'notauser@localhost': MySQL Error 1045: Access denied for user 'notauser'@'localhost' (using password: YES) Review the audit log by running the Linux command: Note, "status": 1045 for each indicates failed attempt. sudo cat &lt;directory where audit log files are located&gt;/audit.log | egrep notauser For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep notauser The audit data will look similar to the example below: { "timestamp": "2020-08-21 17:54:08", "id": 0, "class": "connection", "event": "connect", "connection_id": 20, "account": { "user": "", "host": "localhost" }, "login": { "user": "notauser", "os": "", "ip": "::1", "proxy": "" }, "connection_data": { "connection_type": "plugin", "status": 1045, "db": "" } },

Fix: F-38308r623499_fix

If currently required, configure the MySQL Database Server to audit when unsuccessful logons or connections attempts occur. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records for all privileged activities or other system-level access.
AU-12 - Medium - CCI-000172 - V-235127 - SV-235127r879875_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-004000
Vuln IDs
  • V-235127
Rule IDs
  • SV-235127r879875_rule
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 SELECT, INSERT, UPDATE, or DELETE to an application-defined security table executed by other than a security principal. Depending on the capabilities of the DBMS and the design of the database and associated applications, audit logging may be achieved by means of Database Management System (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.
Checks: C-38346r623501_chk

Review the system documentation to determine if MySQL Server is required to audit for all privileged activities or other system-level access. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 "log_stig". Review the filter values. It will show filters for events of the type of the field general_sql_command.str for the following SQL statement types: grant grant_roles revoke revoke_all revoke_roles drop_role alter_user_default_role create_role drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user

Fix: F-38309r623502_fix

Configure the MySQL Database Server to audit for all 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 drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful attempts to execute privileged activities or other system-level access occur.
AU-12 - Medium - CCI-000172 - V-235128 - SV-235128r879875_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-004100
Vuln IDs
  • V-235128
Rule IDs
  • SV-235128r879875_rule
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.
Checks: C-38347r623504_chk

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. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 log_stig. Review the filter values it will show filters for events of type of the field general_sql_command.str for the following SQL statement types: grant grant_roles revoke revoke_all revoke_roles drop_role alter_user_default_role create_role drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user

Fix: F-38310r623505_fix

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 drop_role grant_roles revoke_roles set_role create_user alter_user drop_user alter_user alter_user_default_role create_user drop_user rename_user show_create_user See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records showing starting and ending time for user access to the database(s).
AU-12 - Medium - CCI-000172 - V-235129 - SV-235129r879876_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-004200
Vuln IDs
  • V-235129
Rule IDs
  • SV-235129r879876_rule
For completeness of forensic analysis, it is necessary to know how long a user's (or other principal'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.
Checks: C-38348r623507_chk

Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 'newuser@localhost' MySQL localhost:33060+ ssl SQL &gt; \quit Bye! Review the audit log by running the Linux command: "status": 0 for each indicates successful. "connection_id": 19 is the same as the connections process id and there will be matching disconnect event with the same connection_id number. This can be used to differentiate multiple connections using the same login. Each connect and disconnect has a timestamp tag with the time in Coordinated Universal Time (UTC). sudo cat &lt;directory where audit log files are located&gt;/audit.log | egrep "\"event\": \”connect\"" For example if the values returned by - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep "\"event\": \”connect\"" The audit data will look similar to the example below: Logging in - connecting { "timestamp": "2020-08-21 17:47:09", "id": 0, "class": "connection", "event": "connect", "connection_id": 19, "account": { "user": "newuser", "host": "localhost" }, "login": { "user": "newuser", "os": "", "ip": "::1", "proxy": "" }, "connection_data": { "connection_type": "plugin", "status": 0, "db": "" } }, Logging out - disconnection sudo cat &lt;directory where audit log files are located&gt;/audit.log | egrep "\"event\": \"disconnect\”" { "timestamp": "2020-08-21 17:47:11", "id": 1, "class": "connection", "event": "disconnect", "connection_id": 19, "account": { "user": "newuser", "host": "localhost" }, "login": { "user": "newuser", "os": "", "ip": "::1", "proxy": "" }, "connection_data": { "connection_type": "plugin" } },

Fix: F-38311r623508_fix

If currently required, configure the MySQL Database Server to produce audit records when successful logons or connections occur. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when concurrent logons/connections by the same user from different workstations.
AU-12 - Medium - CCI-000172 - V-235130 - SV-235130r879877_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-004300
Vuln IDs
  • V-235130
Rule IDs
  • SV-235130r879877_rule
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 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).
Checks: C-38349r623510_chk

Review the system documentation to determine if MySQL Server is required to audit the concurrent logons/connections by the same user from different workstations. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log and the user is fewconnects then sudo cat /usr/local/mysql/data/audit.log |egrep fewconnects { "connection_type": "ssl", "status": 0, "db": "", "connection_attributes": { "_pid": "9132", "_os": "macos10.14", "_platform": "x86_64", "_client_version": "8.0.20", "_client_name": "libmysql", "program_name": "mysqlsh" } } }, { "timestamp": "2020-08-31 18:03:41", "id": 0, "class": "connection", "event": "connect", "connection_id": 28, "account": { "user": "fewconnects", "host": "localhost" }, "login": { "user": "fewconnects", "os": "", "ip": "", "proxy": "" }, "connection_data": { "connection_type": "ssl", "status": 0, "db": "", "connection_attributes": { "_pid": "9132", "_os": "macos10.14", "_platform": "x86_64", "_client_version": "8.0.20", "_client_name": "libmysql", "program_name": "mysqlsh" } } } { "timestamp": "2020-08-31 18:11:05", "id": 12, "class": "connection", "event": "connect", "connection_id": 38, "account": { "user": "fewconnects", "host": "localhost" }, "login": { "user": "fewconnects", "os": "", "ip": "93.122.141.147", "proxy": "" }, "connection_data": { "connection_type": "ssl", "status": 0, "db": "", "connection_attributes": { "_pid": "903", "_os": "macos10.15", "_platform": "x86_64", "_client_version": "8.0.20", "_client_name": "libmysql", "program_name": "MySQLWorkbench" } } }, 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 "event": “connect” and the "user": "fewconnects", "os": "", "ip": “127.0.0.1” and "login": { "user": "fewconnects", "os": "", "ip": “93.122.141.147” - 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. See the supplemental file "MySQL80Audit.sql".

Fix: F-38312r623511_fix

If currently required, configure the MySQL Database Server to produce audit records when connections occur. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must be able to generate audit records when successful accesses to objects occur.
AU-12 - Medium - CCI-000172 - V-235131 - SV-235131r879878_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-004400
Vuln IDs
  • V-235131
Rule IDs
  • SV-235131r879878_rule
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
Checks: C-38350r623513_chk

Review the system documentation to determine if MySQL Server is required to generate audit records when successful accesses to objects occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep &lt;tablename&gt; If the audit event is not present, this is a finding.

Fix: F-38313r623514_fix

Configure the MySQL Database Server to audit when successful accesses to objects occur. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records when unsuccessful accesses to objects occur.
AU-12 - Medium - CCI-000172 - V-235132 - SV-235132r879878_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-004500
Vuln IDs
  • V-235132
Rule IDs
  • SV-235132r879878_rule
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 a SQL environment, types of access include, but are not necessarily limited to: SELECT INSERT UPDATE DELETE EXECUTE To aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.
Checks: C-38351r623516_chk

Review the system documentation to determine if MySQL Server is required to generate audit records when unsuccessful accesses to objects occur. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 access is unsuccessful: Connect a user without access to an object. Run a failed query or other failed 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 "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log |egrep &lt;tablename&gt; The record will show the failed attempt which is note by a non-zero status value. If the audit event is not present, this is a finding.

Fix: F-38314r623517_fix

Configure the MySQL Database Server to audit when unsuccessful accesses to objects occur. See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must generate audit records for all direct access to the database(s).
AU-12 - Medium - CCI-000172 - V-235133 - SV-235133r879879_rule
RMF Control
AU-12
Severity
Medium
CCI
CCI-000172
Version
MYS8-00-004600
Vuln IDs
  • V-235133
Rule IDs
  • SV-235133r879879_rule
In this context, direct access is any query, command, or call to the Database Management System (DBMS) that comes from any source other than the application(s) that it supports. Examples would be the command line or a database management utility program. The intent is to capture all activity from administrative and non-standard sources.
Checks: C-38352r623519_chk

Review the system documentation to determine if MySQL Server is required to generate audit records for all direct access to the database(s). Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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 all direct access to the database(s): Run any access to the database. Review the audit log 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 - "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log If the audit events are not present, this is a finding.

Fix: F-38315r623520_fix

If currently required, configure the MySQL Database Server to produce audit records for all direct access to the database(s). See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0, when utilizing PKI-based authentication, must validate certificates by performing RFC 5280-compliant certification path validation.
IA-5 - Medium - CCI-000185 - V-235134 - SV-235134r879612_rule
RMF Control
IA-5
Severity
Medium
CCI
CCI-000185
Version
MYS8-00-004700
Vuln IDs
  • V-235134
Rule IDs
  • SV-235134r879612_rule
The DoD standard for authentication is DoD-approved PKI certificates. A certificate’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 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.
Checks: C-38353r623522_chk

The database supports PKI-based authentication by using digital certificates over TLS in addition to the native encryption and data integrity capabilities of these protocols. Review MySQL Database Server 8.0 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 ssl_crl is not set to a CRL file, this is a finding. If ssl_crlpath is empty then use the default, which is the datadir path. To get that path run select @@datadir. Next verify the existence of the CRL file. If the CRL file does not exist, this is a finding. Next, verify that require_secure_transport is ON by running: select @@require_secure_transport; If require_secure_transport is not 1 for ON, this is a finding. If the certificate is not a DoD approved certificate, or if no certificate is listed, this is a finding. Confirm Issuer and Subject 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.

Fix: F-38316r623523_fix

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 Transport Layer Security (TLS) protocols. mysql> set persist require_secure_transport=ON; Set system variables on the server side specify DoD 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 my.cnf 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 'jeffrey'@'localhost' REQUIRE X509; AND SUBJECT '/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Johan Smith' AND ISSUER '/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Some CA'; Or to add to an existing user ALTER USER 'johansmith'@'%' REQUIRE X509 AND SUBJECT '/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Johan Smith' AND ISSUER '/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Some CA';

c
The MySQL Database Server 8.0 must enforce authorized access to all PKI private keys stored/utilized by the MySQL Database Server 8.0.
IA-5 - High - CCI-000186 - V-235135 - SV-235135r879613_rule
RMF Control
IA-5
Severity
High
CCI
CCI-000186
Version
MYS8-00-004800
Vuln IDs
  • V-235135
Rule IDs
  • SV-235135r879613_rule
The DoD standard for authentication is DoD-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’s clients, loss of the corresponding private keys would allow an attacker to successfully perform undetected man-in-the-middle attacks against the DBMS system 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-2 or 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'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.
Checks: C-38354r863347_chk

Review DBMS configuration to determine whether appropriate access controls exist to protect the DBMS’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 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 ssl_path or ssl_crlpath are not defined the locations default to the datadir. To determine the datadir select @@datadir; Example if path is &lt;directory where audit log files are located&gt;/ sudo sh -c 'ls -l &lt;directory where data files are located&gt;/*.pem' For example if the value returned by "select @@datadir;' is /usr/local/mysql/data/ sudo sh -c 'ls -l /usr/local/mysql/data/*.pem' 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 "mysql", this is a finding. If the Group owner is not "mysql", this is a finding. For public certs and keys, permissions should be "rw" for mysql and "readonly" for mysql group and world. These files by default are named "ca.pem", "client-cert.pem", "public_key.pem", and "server-cert.pem". If not, this is a finding. For private certs and keys, permissions should be "rw" for mysql and "no rights" for mysql group or world. These files by default are named "ca-key.pem", "client-key.pem", "private_key.pem", and "server-key.pem". If not, this is a finding. Review system configuration to determine whether FIPS mode has been enabled. select @@ssl_fips_mode; - OFF: Disable FIPS mode. - ON: Enable FIPS mode. - STRICT: Enable “strict” FIPS mode. If FIPS mode is not "ON" or "STRICT", this is a finding. If the server-key.pem has a password, verify when starting mysqld in a console there is prompt requiring the passphrase for the server-key.

Fix: F-38317r623526_fix

Implement strong access and authentication controls to protect the database’s private key. Configure the database to support Transport Layer Security (TLS) protocols and the put in place file systems permissions on authentication and signing credentials, including private keys. Put keys in place in the datadir, or define their locations using ssl_capath and ssl_crlpath. Ensure proper permissions are set to protect the private keys and certificates. Change directory ssl_capath, ssl_crlpath, or the default datadir 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" $ 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 server-key.pem has a password, provide this password when prompted during a 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, ssl_fips_mode to ON or STRICT at startup causes the server to produce an error message and exit.

b
The MySQL Database Server 8.0 must map the PKI-authenticated identity to an associated user account.
IA-5 - Medium - CCI-000187 - V-235136 - SV-235136r879614_rule
RMF Control
IA-5
Severity
Medium
CCI
CCI-000187
Version
MYS8-00-004900
Vuln IDs
  • V-235136
Rule IDs
  • SV-235136r879614_rule
The DoD standard for authentication is DoD-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.
Checks: C-38355r623528_chk

Review MySQL Database Server 8.0 configuration to verify DBMS user accounts are being mapped directly to unique identifying information within the validated PKI certificate. Confirm Issuer and Subject 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.

Fix: F-38318r623529_fix

Configure the MySQL Database Server 8.0 to map the authenticated identity directly to the MySQL Database Server 8.0 user account. Alter users to require X509 certificates. Below is an example to add X509 as a requirement. For a new user: CREATE USER 'jeffrey'@'localhost' REQUIRE X509; AND SUBJECT '/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Johan Smith' AND ISSUER '/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Some CA'; Or to add to an existing user: ALTER USER 'johansmith'@'%' REQUIRE X509 AND SUBJECT '/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Johan Smith' AND ISSUER '/C=US/ST=Texas/L=Houston/O=SomeCompany/CN=Some CA';

c
If Database Management System (DBMS) authentication using passwords is employed, the DBMS must enforce the DoD standards for password complexity and lifetime.
IA-5 - High - CCI-000192 - V-235137 - SV-235137r879601_rule
RMF Control
IA-5
Severity
High
CCI
CCI-000192
Version
MYS8-00-005000
Vuln IDs
  • V-235137
Rule IDs
  • SV-235137r879601_rule
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 DoD standard for authentication is DoD-approved PKI certificates. Authentication based on User ID and Password may be used only when it is not possible to employ a PKI certificate, and requires AO approval. In such cases, the DoD 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.
Checks: C-38356r623531_chk

If DBMS authentication using passwords is not employed, this is not a finding. If the DBMS is configured to inherit password complexity and lifetime rules from the operating system or access control program, this is not a finding. Review the MySQL Database Server 8.0 settings relating to password complexity. Determine whether the following rules are enforced. If any are not, this is a finding. a. minimum of 15 characters, including at least one of each of the following character sets: - Uppercase - Lowercase - Numeric - Special characters (e.g., ~ ! @ # $ % ^ &amp; * ( ) _ + = - ' [ ] / ? &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 non-interactive 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. SELECT component_urn FROM mysql.component where component_urn='file://component_validate_password' group by component_urn; If the "validate password" component is installed the result will be file://component_validate_password. If "validate password" component is not installed, this is a finding. If the "component_validate_password" 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 'valid%password%' or VARIABLE_NAME like 'password_%' ; For example the results may look like the following: 'validate_password.check_user_name',’ON’ 'validate_password.dictionary_file','' 'validate_password.length','8' 'validate_password.mixed_case_count','1' 'validate_password.number_count','1' 'validate_password.policy','MEDIUM' 'validate_password.special_char_count','1' 'password_reuse_interval','0' 'password_require_current','OFF' 'password_history','0' If these results do not meet password complexity requirements listed above, this is a finding.

Fix: F-38319r623532_fix

If the use of passwords is not needed, configure the MySQL Database Server 8.0 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 8.0 can inherit password complexity rules from the operating system or access control program, configure it to do so. Otherwise, use MySQL Database Server 8.0 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., ~ ! @ # $ % ^ & * ( ) _ + = - ' [ ] / ? > <) 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 non-interactive 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 'file://component_validate_password'; # Set Password Policies - For Example set persist validate_password.check_user_name='ON'; set persist validate_password.dictionary_file='<FILENAME OF DICTIONARY FILE'; set persist validate_password.length=15; set persist validate_password.mixed_case_count=1; set persist validate_password.special_char_count=2; set persist validate_password.number_count=2; set persist validate_password.policy='STRONG'; 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 'jeffrey'@'localhost' PASSWORD HISTORY 5 PASSWORD REUSE INTERVAL 365 DAY; ALTER USER 'jeffrey'@'localhost' PASSWORD EXPIRE INTERVAL 90 DAY;

b
If passwords are used for authentication, the MySQL Database Server 8.0 must store only hashed, salted representations of passwords.
IA-5 - Medium - CCI-000196 - V-235138 - SV-235138r879608_rule
RMF Control
IA-5
Severity
Medium
CCI
CCI-000196
Version
MYS8-00-005100
Vuln IDs
  • V-235138
Rule IDs
  • SV-235138r879608_rule
The DoD standard for authentication is DoD-approved PKI certificates. Authentication based on User ID and Password may be used only when it is not possible to employ a PKI certificate, and requires Authorizing Official (AO) approval. In such cases, database passwords stored in clear text, using reversible encryption, or using unsalted hashes would be vulnerable to unauthorized disclosure. Database passwords must always be in the form of one-way, salted hashes when stored internally or externally to the Database Management System (DBMS). To prevent the compromise of authentication information, such as passwords and PINs, during the authentication process, the feedback from the information system must not provide any information that would allow an unauthorized user to compromise the authentication mechanism. Obfuscation of user-provided information when typed into the system is a method used in addressing this risk. For example, displaying asterisks when a user types in a password or PIN, is an example of obscuring feedback of authentication information. The password requirement is applicable when caching_sha2_password, sha2_password, native_mysql, or LDAP user/password authentication is enabled. When this is the case, password-authenticated accounts can be created in, and authenticated by, the MySQL Server. Other STIG requirements prohibit the use of password-based authentication except when justified and approved. This deals with the exceptions. The mysql, mysqlsh, and other command-line tools are part of most MySQL installations. These tools can accept a plain-text password, but do offer alternative techniques. Since the typical user of these tools is a Database Administrator (DBA), the consequences of password compromise are particularly serious. Therefore, the use of plain-text passwords must be prohibited as a matter of practice and procedure.
Checks: C-38357r623534_chk

MySQL stores and displays its user passwords in encrypted form. Nevertheless, this should be verified by reviewing the relevant system views, along with the other items to be checked here. Ask the DBA to review the list of DBMS database objects, database configuration files, associated scripts, and applications defined within, and external to, the DBMS that accesses the database. The list must also include files, tables, or settings used to configure the operational environment for the DBMS and for interactive DBMS user accounts. Ask the DBA and/or Information System Security Officer (ISSO) to determine if any DBMS database objects, database configuration files, associated scripts, and applications defined within or external to the DBMS that access the database, and DBMS/user environment files/settings/tables, contain database passwords. If any do, confirm that DBMS passwords stored internally or externally to the DBMS are encoded or encrypted. If any passwords are stored in clear text, this is a finding. Ask the DBA/System Administrator (SA)/Application Support staff if they have created an external password store for applications, batch jobs, and scripts to use. Verify that all passwords stored there are encrypted. If a password store is used and any password is not encrypted, this is a finding. Run this query to determine which MySQL Server authentication methods are enabled: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE '%ldap%' OR PLUGIN_NAME LIKE '%ldap%' OR PLUGIN_NAME LIKE '%pam%' OR PLUGIN_NAME like '%password'; If the results return any of the following values: 'mysql_native_password','ACTIVE' 'sha256_password','ACTIVE' 'caching_sha2_password’,’ACTIVE’ Next, determine if any accounts have been created that use passwords. SELECT user, host, `user`.`plugin` FROM `mysql`.`user` where (user.plugin like '%password') AND NOT (user like 'mysql.%' or user ='root'); For the mysql or mysqlsh command line tools, which can be configured to accept a plain-text password, and any other essential tool with the same limitation, verify that the system documentation explains the need for the tool, who uses it, and any relevant mitigations; and that AO approval has been obtained; if not, this is a finding. Request evidence that all users of the tool are trained in the importance of not using the plain-text password option; how to keep the password hidden; and adherence to this practice. If they are not, this is a finding.

Fix: F-38320r623535_fix

Develop, document, and maintain a list of DBMS database objects, database configuration files, associated scripts, and applications defined within or external to the DBMS that access the database, and DBMS/user environment files/settings in the System Security Plan. Record whether they do or do not contain DBMS passwords. If passwords are present, ensure they are encoded or encrypted and protected by host system security. Where possible, alter the authentication mode to X509 or LDAP SASL/Kerberos: Just X509 certificate - for example ALTER USER 'jeffrey'@'localhost' REQUIRE X509; Specific X509 - for example ALTER USER 'jeffrey'@'localhost' REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/ O=MySQL demo client certificate/ CN=client/emailAddress=client@example.com' AND ISSUER '/C=SE/ST=Stockholm/L=Stockholm/ O=MySQL/CN=CA/emailAddress=ca@example.com' AND CIPHER 'EDH-RSA-DES-CBC3-SHA’; LDAP SASL Example CREATE USER 'boris'@'localhost' IDENTIFIED WITH authentication_ldap_sasl AS 'uid=boris_ldap,ou=People,dc=example,dc=com'; If password authentication is necessary, then for mysql and mysqlsh command lines which cannot be configured not to accept a plain-text password when mixed-mode authentication is enabled, and any other essential tool with the same limitation: 1) Document the need for it, who uses it, any relevant mitigations, and obtain AO approval. 2) Train all users of the tool in the importance of not using the plain-text password option and in how to keep the password hidden.

c
If passwords are used for authentication, the MySQL Database Server 8.0 must transmit only encrypted representations of passwords.
IA-5 - High - CCI-000197 - V-235139 - SV-235139r879609_rule
RMF Control
IA-5
Severity
High
CCI
CCI-000197
Version
MYS8-00-005200
Vuln IDs
  • V-235139
Rule IDs
  • SV-235139r879609_rule
The DoD standard for authentication is DoD-approved PKI certificates. Authentication based on User ID and Password may be used only when it is not possible to employ a PKI certificate, and requires Authorizing Official (AO) approval. In such cases, passwords need to 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.
Checks: C-38358r623537_chk

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 ('require_secure_transport') ; If the require_secure_transport VARIABLE_VALUE is not 'ON' (1), this is a finding. If 1 (On), 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 DoD certificate, or if no certificate is listed, this is a finding.

Fix: F-38321r623538_fix

Configure encryption for transmission of passwords across the network. If the database does not provide encryption for logon events natively, employ encryption at the OS or network level. Ensure passwords remain encrypted from source to destination. connect to MySQL as admin (root) mysql> set persist require_secure_transport=ON; Set system variables on the server side specify DoD 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 my.cnf file, changing the file names as necessary: [mysqld] ssl_ca=ca.pem ssl_cert=server-cert.pem ssl_key=server-key.pem

c
The MySQL Database Server 8.0 must obscure feedback of authentication information during the authentication process to protect the information from possible exploitation/use by unauthorized individuals.
IA-6 - High - CCI-000206 - V-235140 - SV-235140r879615_rule
RMF Control
IA-6
Severity
High
CCI
CCI-000206
Version
MYS8-00-005300
Vuln IDs
  • V-235140
Rule IDs
  • SV-235140r879615_rule
The DoD standard for authentication is DoD-approved 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 "-p" without the password option. The user will then be prompted and the password obfuscated. 3) Make use of OS pluggable password manager integration to protect passwords using keyrings
Checks: C-38359r623540_chk

If all interaction with the user for purposes of authentication is handled by a software component separate from the MySQL Database Server 8.0, this is not a finding. If any application, tool, or feature associated with the MySQL Database Server 8.0/database displays any authentication secrets (to include PINs and passwords) during or after the authentication process, this is a finding. MySQL command line option --password (or -p) 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.

Fix: F-38322r623541_fix

Modify and configure each non-compliant application, tool, or feature associated with the MySQL Database Server 8.0/database so that it does not display authentication secrets. Use -p (--password) without providing a password for the mysql command line tool. Configure or modify applications to prohibit display of passwords in clear text. Use OS 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 'user@localhost':

c
The MySQL Database Server 8.0 must enforce approved authorizations for logical access to information and system resources in accordance with applicable access control policies.
AC-3 - High - CCI-000213 - V-235141 - SV-235141r879530_rule
RMF Control
AC-3
Severity
High
CCI
CCI-000213
Version
MYS8-00-005400
Vuln IDs
  • V-235141
Rule IDs
  • SV-235141r879530_rule
Authentication with a DoD-approved 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 DoD-approved PKIs, all DoD 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 database management systems. 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.
Checks: C-38360r623543_chk

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; 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, 'mysql.tables_priv' as PRIV_SOURCE , DB as _db, Table_Name as _obj , ' ' as _col FROM mysql.tables_priv where Table_name like '%' ), colprivs AS (SELECT User, Host, 'mysql.columns_priv' as PRIV_SOURCE , DB as _db, table_name as _obj , column_name as _col FROM mysql.columns_priv WHERE Table_name like '%' ) 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 specific user, role or user using role: Example User or role SHOW GRANTS FOR 'app_developer'@'%'; User with Role SHOW GRANTS FOR 'u1'@'localhost' USING 'r1'; 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.

Fix: F-38323r623544_fix

Configure the MySQL Database Server 8.0 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 GRANT, REVOKE, ALTER statements to add and remove permissions on server-level securables, bringing them into line with the documented requirements.

b
The MySQL Database Server 8.0 must be configured in accordance with the security configuration settings based on DoD security configuration and implementation guidance, including STIGs, NSA configuration guides, CTOs, DTMs, and IAVMs.
CM-6 - Medium - CCI-000366 - V-235142 - SV-235142r879887_rule
RMF Control
CM-6
Severity
Medium
CCI
CCI-000366
Version
MYS8-00-005500
Vuln IDs
  • V-235142
Rule IDs
  • SV-235142r879887_rule
Configuring the Database Management System (DBMS) to implement organization-wide security implementation guides and security checklists ensures compliance with federal standards and establishes a common security baseline across DoD that reflects the most restrictive security posture consistent with operational requirements. In addition to this SRG, sources of guidance on security and information assurance exist. These include NSA configuration guides, CTOs, DTMs, and IAVMs. The DBMS must be configured in compliance with guidance from all such relevant sources.
Checks: C-38361r623546_chk

Review the MySQL documentation and configuration to determine it is configured in accordance with DoD security configuration and implementation guidance, including STIGs, NSA configuration guides, CTOs, DTMs, and IAVMs. If the MySQL is not configured in accordance with security configuration settings, this is a finding.

Fix: F-38324r623547_fix

Configure MySQL in accordance with security configuration settings by reviewing the Operation System and MySQL documentation and applying the necessary configuration parameters to meet the configurations required by the STIG, NSA configuration guidelines, CTOs, DTMs, and IAVMs.

b
Default demonstration and sample databases, database objects, and applications must be removed.
CM-7 - Medium - CCI-000381 - V-235143 - SV-235143r879587_rule
RMF Control
CM-7
Severity
Medium
CCI
CCI-000381
Version
MYS8-00-005600
Vuln IDs
  • V-235143
Rule IDs
  • SV-235143r879587_rule
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.
Checks: C-38362r623549_chk

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 8.0. Review the MySQL Database Server 8.0 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 8.0 application. If any are present in the database or are included with the MySQL Database Server 8.0 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 ('mysql','information_schema', 'sys', 'performance_schema'); 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.

Fix: F-38325r623550_fix

MySQL 8.0 contains no demo databases by default. If demo schemas (aka databases) were added, remove them by executing: mysql -u root -p --execute="DROP DATABASE 'schema_name'"

b
Unused database components, MySQL Database Server 8.0 software, and database objects must be removed.
CM-7 - Medium - CCI-000381 - V-235144 - SV-235144r879587_rule
RMF Control
CM-7
Severity
Medium
CCI
CCI-000381
Version
MYS8-00-005700
Vuln IDs
  • V-235144
Rule IDs
  • SV-235144r879587_rule
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.
Checks: C-38363r623552_chk

Review the list of components and features installed with the MySQL Database Server 8.0. List options MySQL Plugins/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.

Fix: F-38326r623553_fix

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 UNINSTALL PLUGIN; command: Remove any plugin that is loaded at startup from the my.cnf file. For example - ddl_rewriter is discovered but are not being used. Follow these removal instructions. Remove this line from my.cnf: plugin-load-add=ddl_rewriter.so Remove any plugin that is not loaded at startup using the --plugin-load parameter from the my.cnf or on the command line. UNINSTALL PLUGIN <plugin_name>; UNINSTALL PLUGIN ddl_rewriter; Remove any component not in use UNINSTALL COMPONENT component_name [, component_name ] ...; For example - The audit message emit function is not being called, the component is not needed. UNINSTALL COMPONENT "file://component_audit_api_message_emit";

b
Unused database components which are integrated in the MySQL Database Server 8.0 and cannot be uninstalled must be disabled.
CM-7 - Medium - CCI-000381 - V-235145 - SV-235145r879587_rule
RMF Control
CM-7
Severity
Medium
CCI
CCI-000381
Version
MYS8-00-005800
Vuln IDs
  • V-235145
Rule IDs
  • SV-235145r879587_rule
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. Unused, unnecessary DBMS components increase the attack vector for the DBMS by introducing additional targets for attack. By minimizing the services and applications installed on the system, the number of potential vulnerabilities is reduced. Components of the system that are unused and cannot be uninstalled must be disabled. The techniques available for disabling components will vary by DBMS product, OS and the nature of the component and may include DBMS configuration settings, OS service settings, OS file access security, and DBMS user/group permissions.
Checks: C-38364r623555_chk

Review the list of components and features installed with the MySQL Database Server 8.0. List options MySQL Plugins/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.

Fix: F-38327r623556_fix

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 UNINSTALL PLUGIN; command: Remove any plugin that is loaded at startup from the my.cnf file. For example - ddl_rewriter is discovered but are not being used. Follow these removal instructions. Remove this line from my.cnf: plugin-load-add=ddl_rewriter.so Remove any plugin that is not loaded at startup using the --plugin-load parameter from the my.cnf or on the command line. UNINSTALL PLUGIN <plugin_name>; UNINSTALL PLUGIN ddl_rewriter; Remove any component not in use UNINSTALL COMPONENT component_name [, component_name ] ...; For example - The audit message emit function is not being called, the component is not needed. UNINSTALL COMPONENT "file://component_audit_api_message_emit";

b
The MySQL Database Server 8.0 must be configured to prohibit or restrict the use of organization-defined functions, ports, protocols, and/or services, as defined in the PPSM CAL and vulnerability assessments.
CM-7 - Medium - CCI-000382 - V-235146 - SV-235146r879588_rule
RMF Control
CM-7
Severity
Medium
CCI
CCI-000382
Version
MYS8-00-006000
Vuln IDs
  • V-235146
Rule IDs
  • SV-235146r879588_rule
To prevent unauthorized connection of devices, unauthorized transfer of information, or unauthorized tunneling (i.e., embedding of data types within data types), organizations must disable or restrict unused or unnecessary physical and logical ports/protocols/services on information systems. Applications 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. Additionally, it is sometimes convenient to provide multiple services from a single component (e.g., email and web services); however, doing so increases risk over limiting the services provided by any one component. To support the requirements and principles of least functionality, the application must support the organizational requirements providing only essential capabilities and limiting the use of ports, protocols, and/or services to only those required, authorized, and approved to conduct official business or to address authorized quality of life issues. Database Management Systems (DBMSs) using ports, protocols, and services deemed unsafe are open to attack through those ports, protocols, and services. This can allow unauthorized access to the database and through the database to other components of the information system.
Checks: C-38365r623558_chk

Review the MySQL Database Server 8.0 settings and local documentation for functions, ports, protocols, and services that are not approved. If any are found, this is a finding. Run the following SQL to list ports: SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME in ('port', 'mysqlx_port', 'admin_port'); The default ports for MySQL for organizational connects are: Classic MySQL - 3306 MySQL X - 33060 MySQL Admin Port - 33062 (disabled by default) If any 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 '%pipe%' or VARIABLE_NAME = 'socket' or VARIABLE_NAME = 'mysqlx_socket'; Values for classic and xprotocol will be returned. For example on Linux: 'socket','/tmp/mysql.sock' 'mysqlx_socket','/tmp/mysqlx.sock' Windows 'named_pipe', 'ON' If these are in conflict with guidance, and not explained and approved in the system documentation, this is a finding.

Fix: F-38328r623559_fix

Disable functions, ports, protocols, and services that are not approved. Change mysql options related to network, ports, and protocols for the server and additionally consider refining further at user account level. vi my.cnf [mysqld] port=<port value> admin_address=<addr> admin_port=<port value> mysqlx_port=<port value> socket={file_name|pipe_name} If admin_address is not defined then access via the admin port is disabled. Additionally the X Plugin can be disabled at startup by either setting mysqlx=0 in the MySQL configuration file, or by passing in either --mysqlx=0 or --skip-mysqlx when starting the MySQL server. Restart mysqld

b
The MySQL Database Server 8.0 must uniquely identify and authenticate organizational users (or processes acting on behalf of organizational users).
IA-2 - Medium - CCI-000764 - V-235147 - SV-235147r879589_rule
RMF Control
IA-2
Severity
Medium
CCI
CCI-000764
Version
MYS8-00-006100
Vuln IDs
  • V-235147
Rule IDs
  • SV-235147r879589_rule
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.
Checks: C-38366r623561_chk

Review MySQL Database Server 8.0 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 '%ldap%' OR PLUGIN_NAME LIKE '%ldap%' OR PLUGIN_NAME LIKE '%pam%'; 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 'auth%' ; This will show external configuration setup for authentication using an organizational authentication source. Review users using organizational authentication. Review the "authentication_string" for proper mapping: SELECT `user`.`Host`, `user`.`user`, `user`.`plugin`, `user`.`authentication_string` from mysql.user where plugin like 'auth%'; 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.

Fix: F-38329r623562_fix

Configure MySQL Database Server 8.0 settings to uniquely identify and authenticate all organizational users who log on/connect to the system. Remove user-accessible shared accounts and use individual user names. Configure applications to ensure successful individual authentication prior to shared account access. Ensure each user'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 'authentication_ldap_sasl.so'; INSTALL PLUGIN authentication_ldap_simple SONAME 'authentication_ldap_simple.so'; Configure SET PERSIST authentication_ldap_sasl_server_host='127.0.0.1'; SET PERSIST authentication_ldap_sasl_bind_base_dn='dc=example,dc=com'; SET PERSIST authentication_ldap_simple_server_host='127.0.0.1'; SET PERSIST authentication_ldap_simple_bind_base_dn='dc=example,dc=com'; Create users with proper organizational mapping, for example: CREATE USER 'betsy'@'localhost' IDENTIFIED WITH authentication_ldap_simple BY 'uid=betsy_ldap,ou=People,dc=example,dc=com'; Assign appropriate roles and grants.

c
The MySQL Database Server 8.0 must use NIST FIPS 140-2 or 140-3 validated cryptographic modules for cryptographic operations.
IA-7 - High - CCI-000803 - V-235148 - SV-235148r879616_rule
RMF Control
IA-7
Severity
High
CCI
CCI-000803
Version
MYS8-00-006200
Vuln IDs
  • V-235148
Rule IDs
  • SV-235148r879616_rule
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-2 or 140-3 validated cryptographic modules that meet the requirements of applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. NSA Type-X (where X=1, 2, 3, 4) products are NSA-certified, hardware-based encryption modules. The standard for validating cryptographic modules will transition to the NIST FIPS 140-3 publication. FIPS 140-2 modules can remain active for up to five years after validation or until September 21, 2026, when the FIPS 140-2 validations will be moved to the historical list. Even on the historical list, CMVP supports the purchase and use of these modules for existing systems. While Federal Agencies decide when they move to FIPS 140-3 only modules, purchasers are reminded that for several years there may be a limited selection of FIPS 140-3 modules from which to choose. CMVP recommends purchasers consider all modules that appear on the Validated Modules Search Page: https://csrc.nist.gov/projects/cryptographic-module-validation-program/validated-modules More information on the FIPS 140-3 transition can be found here: https://csrc.nist.gov/Projects/fips-140-3-transition-effort/
Checks: C-38367r863349_chk

Review DBMS configuration to verify it is using NIST FIPS 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 = 'ssl_fips_mode'; The result will be either "ON" or "STRICT". If not, then NIST FIPS validated modules are not being used, and this is a finding.

Fix: F-38330r863350_fix

Utilize NIST FIPS validated cryptographic modules for all cryptographic operations. See Use MySQL Server OpenSSL FIPS mode. See https://dev.mysql.com/doc/refman/8.0/en/fips-mode.html Turn on MySQL FIPS mode and restart mysqld Edit my.cnf [mysqld] ssl_fips_mode=ON or [mysqld] ssl_fips_mode=STRICT ON: Enable FIPS mode. STRICT: Enable “strict” FIPS mode.

b
The MySQL Database Server 8.0 must uniquely identify and authenticate non-organizational users (or processes acting on behalf of non-organizational users).
IA-8 - Medium - CCI-000804 - V-235149 - SV-235149r879617_rule
RMF Control
IA-8
Severity
Medium
CCI
CCI-000804
Version
MYS8-00-006300
Vuln IDs
  • V-235149
Rule IDs
  • SV-235149r879617_rule
Non-organizational 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). Non-organizational 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.
Checks: C-38368r623567_chk

Review MySQL Database Server 8.0 settings to determine if users uniquely identify and authenticate all non-organizational users who log on to the system. select host, user FROM mysql.user WHERE user not in ('mysql.infoschema', 'mysql.session', 'mysql.sys'); 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 non-organizational users are not uniquely identified and authenticated, this is a finding.

Fix: F-38331r623568_fix

Configure MySQL Database Server 8.0 settings to uniquely identify and authenticate all non-organizational users who log on to the system. Ensure all logins are uniquely identifiable and authenticate all non-organizational users who log on to the system. This likely would be done by ensuring mapping of MySQL accounts to individual accounts. Verify server documentation to ensure accounts are documented and unique.

b
The MySQL Database Server 8.0 must separate user functionality (including user interface services) from database management functionality.
SC-2 - Medium - CCI-001082 - V-235150 - SV-235150r879631_rule
RMF Control
SC-2
Severity
Medium
CCI
CCI-001082
Version
MYS8-00-006400
Vuln IDs
  • V-235150
Rule IDs
  • SV-235150r879631_rule
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.
Checks: C-38369r623570_chk

Check MySQL settings and documentation to verify that administrative functionality is separate from user functionality. As Database Administrator (DBA) (“root"), list all roles and permissions for the database: &gt; mysql -u root -p SELECT user,host, 'Global Priv', 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 'Y' 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 ('mysql.infoschema', 'mysql.session'); If any non-administrative 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.

Fix: F-38332r623571_fix

Configure MySQL Database Server 8.0 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/8.0/en/access-control.html.

b
The MySQL Database Server 8.0 must isolate security functions from non-security functions.
SC-3 - Medium - CCI-001084 - V-235151 - SV-235151r879643_rule
RMF Control
SC-3
Severity
Medium
CCI
CCI-001084
Version
MYS8-00-006500
Vuln IDs
  • V-235151
Rule IDs
  • SV-235151r879643_rule
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 typically separate security functionality from non-security functionality via separate databases or schemas. Database objects or code implementing security functionality should not be commingled with objects or code implementing application logic. When security and non-security functionality are commingled, users who have access to non-security functionality may be able to access security functionality. The mysql database is the system database. It 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. The Performance Schema has these characteristics: The Performance Schema 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 “instrumentation points” in server source code. Tables in the Performance Schema are in-memory tables that use no persistent on-disk storage. MySQL 8.0 includes the sys schema, a set of objects that helps DBAs and developers interpret data collected by the Performance Schema. The sys schema objects can be used for typical tuning and diagnosis use cases.
Checks: C-38370r623573_chk

Determine elements of security functionality (lists of permissions, additional authentication information, stored procedures, application specific auditing, etc.) which are being 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 ('mysql', 'information_schema', 'performance_schema','sys'); 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.

Fix: F-38333r623574_fix

Check the server documentation, 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.

b
Database contents must be protected from unauthorized and unintended information transfer by enforcement of a data-transfer policy.
SC-4 - Medium - CCI-001090 - V-235152 - SV-235152r879649_rule
RMF Control
SC-4
Severity
Medium
CCI
CCI-001090
Version
MYS8-00-006600
Vuln IDs
  • V-235152
Rule IDs
  • SV-235152r879649_rule
Applications, including DBMSs, must prevent unauthorized and unintended information transfer via shared system resources. Data used for the development and testing of applications often involves copying data from production. It is important that specific procedures exist for this process, to include the conditions under which such transfer may take place, where the copies may reside, and the rules for ensuring sensitive data are not exposed. Copies of sensitive data must not be misplaced or left in a temporary location without the proper controls.
Checks: C-38371r623576_chk

Review the procedures for the refreshing of development/test data from production. Review any scripts or code that exists for the movement of production data to development/test systems, or to any other location or for any other purpose. Verify that copies of production data are not left in unprotected locations. If the code that exists for data movement does not comply with the organization-defined data transfer policy and/or fails to remove any copies of production data from unprotected locations, this is a finding.

Fix: F-38334r623577_fix

Modify any code used for moving data from production to development/test systems to comply with the organization-defined data transfer policy, and to ensure copies of production data are not left in unsecured locations.

b
Access to database files must be limited to relevant processes and to authorized, administrative users.
SC-4 - Medium - CCI-001090 - V-235153 - SV-235153r879649_rule
RMF Control
SC-4
Severity
Medium
CCI
CCI-001090
Version
MYS8-00-006800
Vuln IDs
  • V-235153
Rule IDs
  • SV-235153r879649_rule
Applications, including 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 principal 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.
Checks: C-38372r623579_chk

Review the permissions granted to users via the operating system/file system on the instance files, database files, database redo, undo, archive, bin and audit log files, and database backup files. If any user/role who is not an authorized system administrator with a need to know or database administrator with a need to know, or a system account for running DBMS processes permitted to read/view any of these files, this is a finding. Note: When the instance and database directories are created by mysql installations packages, the permissions are secure and should not be changed. Run ls -l on the various files and directory. Permissions should be limited to the mysql user and mysql group. Use the following queries/commands to find the locations of instance directory, database directory, transaction logs directory, archive logs directory, audit logs directory, and backup files location. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME LIKE '%dir' or VARIABLE_NAME LIKE '%file' order by VARIABLE_NAME; Regarding Linux default installation: Proper permissions are shown below. If the permissions are more permissive for a Location Type, this is a finding. The following table shows directory and file permissions for the generic binary distribution installation of MySQL Enterprise Edition for Linux x86-64 on Oracle Linux that is described in this guide. As indicated previously, most of the MySQL installation can be owned by root. The exceptions are the data directory, the error log file, the mysql-files directory, the pid file, and the socket file, to which the mysql user must have write access. Files and resources to which the mysql user requires read access include configuration files (/etc/my.cnf) and the MySQL binaries (for example /usr/local/mysql/bin). Desc/Typical Location Owner Directory File Permissions Permissions --------------------- ----- ----------- ----------- Client and utility programs directory /usr/local/mysql/bin root drwxr-xr-x mysqld server /usr/local/mysql/bin root drwxr-xr-x -rwxr-xr-x MySQL configuration file /etc/my.cnf root drwxr-xr-x -rw-r--r-- Data directory /usr/local/mysql/data mysql drwxr-x--- Error log file &lt;directory where audit log files are located&gt;/host_name.err mysql drwxr-x--- -rw------- secure_file_priv directory /usr/local/mysql/mysql-files mysql drwxr-x--- mysqld systemd service file /usr/lib/systemd/system/mysqld.service root drwxr-xr-x -rw-r--r-- systemd tmpfiles configuration file /usr/lib/tmpfiles.d/mysql.conf root drwxr-xr-x -rw-r--r-- pid file &lt;directory where audit log files are located&gt;/mysqld.pid mysql drwxr-x--- -rw-r----- socket file /tmp/mysql.sock mysql drwxrwxrwt srwxrwxrwx Unix manual pages directory /usr/local/mysql/man root drwxr-xr-x Include Header files directory /usr/local/mysql/include root drwxr-xr-x Libraries directory /usr/local/mysql/lib root drwxr-xr-x Miscellaneous support files directory /usr/local/mysql/support-files root drwxr-xr-x Miscellaneous files directory /usr/local/mysql/share root drwxr-xr-x

Fix: F-38335r623580_fix

Configure the permissions granted by the operating system/file system on the database files, database log files, and database backup files so that only relevant system accounts and authorized system administrators and database administrators with a need to know are permitted to read/view these files. Remove any unauthorized permission grants from MySQL data, audit, certificate, key, or other directories.

b
The MySQL Database Server 8.0 must maintain the authenticity of communications sessions by guarding against man-in-the-middle attacks that guess at Session ID values.
SC-23 - Medium - CCI-001188 - V-235154 - SV-235154r879639_rule
RMF Control
SC-23
Severity
Medium
CCI
CCI-001188
Version
MYS8-00-007000
Vuln IDs
  • V-235154
Rule IDs
  • SV-235154r879639_rule
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-2 or 140-3 approved random number generator. However, it is recognized that available 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.
Checks: C-38373r623582_chk

Determine if MySQL is configured to require SSL. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME like 'require_secure_transport'; If require_secure_transport is not "ON", 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 = 'ssl_fips_mode'; If ssl_fips_mode is not "ON", this is a finding.

Fix: F-38336r623583_fix

Connect as a mysql administrator mysql> set persist require_secure_transport=ON; Turn on MySQL FIPS mode (ON or STRICT) and restart mysqld Edit my.cnf [mysqld] ssl_fips_mode=ON or ssl_fips_mode=STRICT

c
The MySQL Database Server 8.0 must protect the confidentiality and integrity of all information at rest.
SC-28 - High - CCI-001199 - V-235155 - SV-235155r879642_rule
RMF Control
SC-28
Severity
High
CCI
CCI-001199
Version
MYS8-00-007200
Vuln IDs
  • V-235155
Rule IDs
  • SV-235155r879642_rule
This control is intended to address the confidentiality and integrity of information at rest in non-mobile 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.
Checks: C-38374r810830_chk

If the application owner and Authorizing Official have determined that encryption of data at rest is NOT required, this is not a finding. Review settings to ensure appropriate controls are applied to protect the confidentiality and integrity of data at rest in the database. Using SQL determine if all data-at-rest is encrypted. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'audit_log_encryption'; If "audit_log_encryption" is not set to "AES", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'binlog_encryption'; If "binlog_encrypt" is not set to "ON", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'innodb_redo_log_encrypt'; If "innodb_redo_log_encrypt" is not set to "ON", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'innodb_undo_log_encrypt'; If "innodb_undo_log_encrypt" is not set to "ON", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME like 'general_log'; If "general_log"is not "OFF", this is a finding. Find encryption status for all mysql table and tablespaces. SELECT `INNODB_TABLESPACES`.`NAME`, `INNODB_TABLESPACES`.`ENCRYPTION` FROM `information_schema`.`INNODB_TABLESPACES`; If any tablespace other than innodb_temporary does not have ENCRYPTION set to "Y (yes)", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'table_encryption_privilege_check'; If "innodb_redo_log_encrypt" is not set to "ON", this is a finding.

Fix: F-38337r623586_fix

Apply appropriate MySQL Database 8.0 controls to protect the confidentiality and integrity of data at rest in the database. sudo vi /etc/my.cnf [mysqld] audit-log=FORCE_PLUS_PERMANENT audit-log-format=JSON audit-log-encryption=AES Turn on binlog encryption set persist binlog_encryption=ON; Turn on undo and redo 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, specify the ENCRYPTION option in a CREATE TABLE statement. The following example assumes that innodb_file_per_table is enabled. mysql> CREATE TABLE t1 (c1 INT) ENCRYPTION='Y'; To enable encryption for an existing file-per-table tablespace, specify the ENCRYPTION option in an ALTER TABLE statement. mysql> ALTER TABLE t1 ENCRYPTION='Y'; To disable encryption for file-per-table tablespace, set ENCRYPTION='N' using ALTER TABLE. mysql> ALTER TABLE t1 ENCRYPTION='N'; Disable the general_log SET PERSIST general_log = 'OFF';

b
The MySQL Database Server 8.0 must check the validity of all data inputs except those specifically identified by the organization.
SI-10 - Medium - CCI-001310 - V-235156 - SV-235156r879652_rule
RMF Control
SI-10
Severity
Medium
CCI
CCI-001310
Version
MYS8-00-007300
Vuln IDs
  • V-235156
Rule IDs
  • SV-235156r879652_rule
Invalid user input occurs when a user inserts data or characters into an application'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.
Checks: C-38375r623588_chk

Review MySQL Database Server 8.0 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.

Fix: F-38338r623589_fix

Use parameterized queries, constraints, foreign keys, etc., to validate data input. Modify MySQL SQL Server to properly use the correct column data types as required in the database.

b
The MySQL Database Server 8.0 and associated applications must reserve the use of dynamic code execution for situations that require it.
SI-10 - Medium - CCI-001310 - V-235157 - SV-235157r879652_rule
RMF Control
SI-10
Severity
Medium
CCI
CCI-001310
Version
MYS8-00-007400
Vuln IDs
  • V-235157
Rule IDs
  • SV-235157r879652_rule
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 utilized 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).
Checks: C-38376r623591_chk

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.

Fix: F-38339r623592_fix

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.

b
The MySQL Database Server 8.0 and associated applications, when making use of dynamic code execution, must scan input data for invalid values that may indicate a code injection attack.
SI-10 - Medium - CCI-001310 - V-235158 - SV-235158r879652_rule
RMF Control
SI-10
Severity
Medium
CCI
CCI-001310
Version
MYS8-00-007500
Vuln IDs
  • V-235158
Rule IDs
  • SV-235158r879652_rule
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 utilized 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, and the word "ESCAPE" is also a clue that wildcards are in use. -- If SQL key words, such as SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, ESCAPE, UNION, GRANT, REVOKE, DENY, 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'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 whitelists 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.
Checks: C-38377r623594_chk

Review MySQL Database Server 8.0 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 of abnormal requests. Run the following command: SHOW GLOBAL VARIABLES LIKE 'mysql_firewall_mode'; 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 allow list for the userhost user. If PROTECTING is returned, the firewall will only permit SQL on the allow list for the userhost user to execute. If DETECTING is returned, the firewall will write to the firewall log SQL not on the allow list for the userhost user to execute. If dynamic code execution is employed without protective measures against code injection, this is a finding.

Fix: F-38340r623595_fix

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 < linux_install_firewall.sql Train the firewall for users where dynamic code injection is possible, for examples applications that allow user input. CALL mysql.sp_set_firewall_mode('fwuser@localhost', 'RECORDING'); 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('fwuser@localhost', 'PROTECTING'); CALL mysql.sp_set_firewall_mode('fwuser@localhost', 'DETECTING');

b
The MySQL Database Server 8.0 must initiate session auditing upon startup.
AU-14 - Medium - CCI-001464 - V-235159 - SV-235159r879562_rule
RMF Control
AU-14
Severity
Medium
CCI
CCI-001464
Version
MYS8-00-007800
Vuln IDs
  • V-235159
Rule IDs
  • SV-235159r879562_rule
Session auditing is for use when a user'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.
Checks: C-38378r623597_chk

Determine if an audit is configured and enabled. The my.cnf file will set the variable audit_file. Review the my.cnf file for the following entries: [mysqld] plugin-load-add=audit_log.so audit-log=FORCE_PLUS_PERMANENT If these entries are not present. This is a finding. Execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the "audit_log plugin" must be "active". If it is not "active", 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.

Fix: F-38341r623598_fix

Configure the MySQL Audit to automatically start during system startup. Add to the my.cnf: [mysqld] plugin-load-add=audit_log.so audit-log=FORCE_PLUS_PERMANENT audit-log-format=JSON

b
The MySQL Database Server 8.0 must protect its audit features from unauthorized access.
AU-9 - Medium - CCI-001493 - V-235160 - SV-235160r879579_rule
RMF Control
AU-9
Severity
Medium
CCI
CCI-001493
Version
MYS8-00-008000
Vuln IDs
  • V-235160
Rule IDs
  • SV-235160r879579_rule
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. It is, therefore, 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, OS-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, he 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.
Checks: C-38379r623600_chk

Check users with permissions to administer MySQL Auditing. select * from information_schema.user_privileges where privilege_type = 'AUDIT_ADMIN'; If unauthorized accounts have these the AUDIT_ADMIN privilege, this is a finding.

Fix: F-38342r623601_fix

Remove audit-related permissions from individuals and roles not authorized to have them. REVOKE AUDIT_ADMIN on *.* FROM <user>;

b
The MySQL Database Server 8.0 must protect its audit configuration from unauthorized modification.
AU-9 - Medium - CCI-001494 - V-235161 - SV-235161r879580_rule
RMF Control
AU-9
Severity
Medium
CCI
CCI-001494
Version
MYS8-00-008100
Vuln IDs
  • V-235161
Rule IDs
  • SV-235161r879580_rule
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 in order 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.
Checks: C-38380r623603_chk

Check users with permissions to administer MySQL Auditing. select * from information_schema.user_privileges where privilege_type = 'AUDIT_ADMIN'; If unauthorized accounts have the AUDIT_ADMIN privilege, this is a finding. Check that a keyring plugin is installed. SELECT * FROM information_schema.PLUGINS where plugin_name like 'keyring%'; If no keyring is installed, this is a finding. Check if the audit files are encrypted. To check for data encryption at rest settings in MySQL: SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'audit_log_encryption'; If "audit_log_encryption" is not set to "AES", this is a finding.

Fix: F-38343r623604_fix

Remove audit-related permissions from individuals and roles not authorized to have them. REVOKE AUDIT_ADMIN on *.* FROM <user>; Set audit log format to use AES encryption. sudo vi /etc/my.cnf [mysqld] early-plugin-load=keyring_file.so audit-log=FORCE_PLUS_PERMANENT audit-log-format=JSON audit-log-encryption=AES Note: First instantiate the keyring plugin which is needed to store the audit encryption key. The example above has an "early-plugin-load=keyring_file.so" entry in the my.cnf file. A keyring plugin must be present before adding the "audit-log-encryption=AES" entry or the database will not start. Below are valid key ring plugins: For dev test - not encrypted early-plugin-load=keyring_file.so Encrypted file early-plugin-load=keyring_encrypted_file.so keyring_encrypted_file_data=/usr/local/mysql/mysql-keyring/keyring-encrypted keyring_encrypted_file_password=password KMIP early-plugin-load=keyring_okv.so keyring_okv_conf_dir=/usr/local/mysql/mysql-keyring-okv Oracle Cloud Vault early-plugin-load=keyring_oci.so keyring_oci_user=ocid1.user.oc1..longAlphaNumericString keyring_oci_tenancy=ocid1.tenancy.oc1..longAlphaNumericString keyring_oci_compartment=ocid1.compartment.oc1..longAlphaNumericString keyring_oci_virtual_vault=ocid1.vault.oc1.iad.shortAlphaNumericString.longAlphaNumericString keyring_oci_master_key=ocid1.key.oc1.iad.shortAlphaNumericString.longAlphaNumericString keyring_oci_encryption_endpoint=shortAlphaNumericString-crypto.kms.us-ashburn-1.oraclecloud.com keyring_oci_management_endpoint=shortAlphaNumericString-management.kms.us-ashburn-1.oraclecloud.com keyring_oci_vaults_endpoint=vaults.us-ashburn-1.oci.oraclecloud.com keyring_oci_secrets_endpoint=secrets.vaults.us-ashburn-1.oci.oraclecloud.com keyring_oci_key_file=file_name keyring_oci_key_fingerprint=12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef Hashicorp early-plugin-load=keyring_hashicorp.so keyring_hashicorp_role_id='ee3b495c-d0c9-11e9-8881-8444c71c32aa' keyring_hashicorp_secret_id='0512af29-d0ca-11e9-95ee-0010e00dd718' keyring_hashicorp_store_path='/v1/kv/mysql'

b
The MySQL Database Server 8.0 must protect its audit features from unauthorized removal.
AU-9 - Medium - CCI-001495 - V-235162 - SV-235162r879581_rule
RMF Control
AU-9
Severity
Medium
CCI
CCI-001495
Version
MYS8-00-008200
Vuln IDs
  • V-235162
Rule IDs
  • SV-235162r879581_rule
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 in order make access decisions regarding the deletion 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.
Checks: C-38381r623606_chk

Check users with permissions to administer MySQL Auditing. select * from information_schema.user_privileges where privilege_type = 'AUDIT_ADMIN'; If unauthorized accounts have these the AUDIT_ADMIN privilege, this is a finding.

Fix: F-38344r623607_fix

This requirement is a permanent finding and cannot be fixed. An appropriate mitigation for the system must be implemented, but this finding cannot be considered fixed.

b
The MySQL Database Server 8.0 must limit privileges to change software modules, to include stored procedures, functions and triggers, and links to software external to the MySQL Database Server 8.0.
CM-5 - Medium - CCI-001499 - V-235163 - SV-235163r879586_rule
RMF Control
CM-5
Severity
Medium
CCI
CCI-001499
Version
MYS8-00-008300
Vuln IDs
  • V-235163
Rule IDs
  • SV-235163r879586_rule
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.
Checks: C-38382r623609_chk

Review Server documentation to determine the authorized owner and users or groups with modify rights for this SQL instance's binary files. Additionally check the owner and users or groups with modify rights for shared software library paths on disk. If any unauthorized users are granted modify rights, this is a finding. A plugin located in a plugin library file can be loaded at runtime with the INSTALL PLUGIN statement. The statement also registers the plugin in the mysql.plugin table to cause the server to load it on subsequent restarts. For this reason, INSTALL PLUGIN requires the INSERT privilege for the mysql.plugin table, and UNINSTALL requires DELETE. Run the following statement to check for table specific privileges: SELECT * FROM information_schema.TABLE_PRIVILEGES where (table_schema='mysql' and table_name=`plugin`) or (table_schema='mysql' and table_name='component';) If privilege_type is INSERT or DELETE for an unauthorized user, this is a finding. Run the following statement to check for global privileges: select * from information_schema.user_privileges where privilege_type='INSERT' or privilege_type='DELETE'; If privilege_type is INSERT or DELETE for an unauthorized user, this is a finding.

Fix: F-38345r623610_fix

Remove permissions from users who should not have insert or update access to the mysql.plugin or mysql.component table.

b
The MySQL Database Server 8.0 software installation account must be restricted to authorized users.
CM-5 - Medium - CCI-001499 - V-235164 - SV-235164r879586_rule
RMF Control
CM-5
Severity
Medium
CCI
CCI-001499
Version
MYS8-00-008400
Vuln IDs
  • V-235164
Rule IDs
  • SV-235164r879586_rule
When dealing with change control issues, it must be noted 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. DBA and other privileged administrative or application owner accounts are granted privileges that allow actions that 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.
Checks: C-38383r623612_chk

Review procedures for controlling and granting access to use of the 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.

Fix: F-38346r623613_fix

Develop, document, and implement procedures to restrict and track use of the MySQL Database Server 8.0 software installation account.

b
Database software, including MySQL Database Server 8.0 configuration files, must be stored in dedicated directories, or DASD pools (remove), separate from the host OS and other applications.
CM-5 - Medium - CCI-001499 - V-235165 - SV-235165r879586_rule
RMF Control
CM-5
Severity
Medium
CCI
CCI-001499
Version
MYS8-00-008500
Vuln IDs
  • V-235165
Rule IDs
  • SV-235165r879586_rule
When dealing with change control issues, it should be noted any changes to the hardware, software, and/or firmware components of the information system and/or application can potentially 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's database objects or directories. Any method that provides any level of separation of security context assists in the protection between applications.
Checks: C-38384r623615_chk

Review the MySQL Database Server 8.0 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 '%dir%'; If any non-MySQL Database Server 8.0 software directories exist on the datadir, basedir, or other non tmpdir 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 8.0, this is a finding. Only applications that are required for the functioning and administration, not use, of the MySQL Database Server 8.0 should be located in the same disk directory as the DBMS software libraries. If other applications are located in the same directory as the 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 result of VARIABLE_PATH shows that configuration values are not stored in files dedicated directories separate from the host os or other applications, this is a finding.

Fix: F-38347r623616_fix

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 "--defaults-file" to point to the new location and filename for the mysql configuration file.

b
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 8.0, etc.) must be restricted to authorized users.
CM-5 - Medium - CCI-001499 - V-235166 - SV-235166r879586_rule
RMF Control
CM-5
Severity
Medium
CCI
CCI-001499
Version
MYS8-00-008700
Vuln IDs
  • V-235166
Rule IDs
  • SV-235166r879586_rule
If the 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.
Checks: C-38385r623618_chk

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 grants 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 'test'@'%'; If any database objects are found to have access by users not authorized to the database objects, this is a finding.

Fix: F-38348r623619_fix

Assign ownership of authorized objects to authorized object owner accounts. Review user accounts with the GRANT OPTION. REVOKE GRANT OPTION to limit users with grant privileges.

b
The MySQL Database Server 8.0 must disable network functions, ports, protocols, and services deemed by the organization to be nonsecure, in accord with the Ports, Protocols, and Services Management (PPSM) guidance.
CM-7 - Medium - CCI-001762 - V-235167 - SV-235167r879756_rule
RMF Control
CM-7
Severity
Medium
CCI
CCI-001762
Version
MYS8-00-009000
Vuln IDs
  • V-235167
Rule IDs
  • SV-235167r879756_rule
Use of nonsecure network functions, ports, protocols, and services exposes the system to avoidable threats.
Checks: C-38386r623621_chk

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 ('port', 'mysqlx_port', 'admin_port'); The default ports for MySQL for organizational connects are: Classic MySQL Protocol - 3306, MySQL X Protocol 33060, 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 socker/pipe are in use: SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where VARIABLE_NAME like '%pipe%' or VARIABLE_NAME = 'socket' or VARIABLE_NAME = 'mysqlx_socket'; Values are for classic and xprotocol will be returned. For example on Linux 'socket','/tmp/mysql.sock' 'mysqlx_socket','/tmp/mysqlx.sock' Windows 'named_pipe', 'ON'; 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 '%port%' or VARIABLE_NAME LIKE '%port' 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.

Fix: F-38349r623622_fix

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=<port value> admin_port=<port value> mysqlx_port=<port value> socket=/path/to/socket To turn off TCP/IP: skip_networking=ON If admin_address is not defined then access via the admin port is disabled. Additionally the X Plugin can be disabled at startup/restart by either setting mysqlx=0 in the MySQL configuration file, or by passing in either "--mysqlx=0" or "--skip-mysqlx" when starting the MySQL server.

b
The MySQL Database Server 8.0 must prohibit user installation of logic modules (stored procedures, functions, triggers, views, etc.) without explicit privileged status.
CM-11 - Medium - CCI-001812 - V-235168 - SV-235168r879751_rule
RMF Control
CM-11
Severity
Medium
CCI
CCI-001812
Version
MYS8-00-009100
Vuln IDs
  • V-235168
Rule IDs
  • SV-235168r879751_rule
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 control 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.
Checks: C-38387r623624_chk

MySQL requires users (other than root) to be explicitly granted the CREATE ROUTINE privilege in order 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`='Y' OR `Alter_routine_priv` = 'Y'; 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`='Y' OR `db`.`Alter_routine_priv` = 'Y'; 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.

Fix: F-38350r623625_fix

MySQL requires users (other than root) to be explicitly granted the CREATE ROUTINE privilege in order to install logical modules. Check user grants using the SHOW GRANTS and look for appropriate assignment of CREATE ROUTINE. For example - REVOKE CREATE ROUTINE ON mydb.* TO 'someuser'@'somehost';

b
The MySQL Database Server 8.0 must enforce access restrictions associated with changes to the configuration of the MySQL Database Server 8.0 or database(s).
CM-5 - Medium - CCI-001813 - V-235169 - SV-235169r879753_rule
RMF Control
CM-5
Severity
Medium
CCI
CCI-001813
Version
MYS8-00-009200
Vuln IDs
  • V-235169
Rule IDs
  • SV-235169r879753_rule
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 potentially 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 purposes of initiating changes, including upgrades and modifications.
Checks: C-38388r623627_chk

Review the security configuration of the MySQL Database Server 8.0 and database(s). If it does not enforce access restrictions associated with changes to the configuration of the MySQL Database Server 8.0 or database(s), this is a finding. MySQL configuration can be set two ways: 1) The mysql configuration file. This file must be owned and permissions to read or write to it limited to the mysql OS user only. 2) Via a SET command within the server itself. These commands may be limited by limiting "server administration" privileges. User privileges can be shown using the SHOW GRANTS [FOR user]. This data is written to mysqld-auto.cnf file. See the mysql secure configuration guide for more information. Run the following command to check the mysql the linux permissions on my.cnf: 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 8.0 configuration variables can also be set and changed using persist system variable settings that save to a file named mysqld-auto.cnf This file is in the mysql data dir. See the example below. sudo ls -l /usr/local/mysql-commercial-8.0.16-macos10.14-x86_64/data/mysqld-auto.cnf -rw-r----- 1 _mysql _mysql 2721 May 13 14:00 /usr/local/mysql-commercial-8.0.16-macos10.14-x86_64/data/mysqld-auto.cnf If the permissions of the mysqld-auto.cnf are more permissive, this is a finding.

Fix: F-38351r623628_fix

Configure the MySQL Database Server 8.0 to enforce access restrictions associated with changes to the configuration of the MySQL Database Server 8.0 or database(s). Check and change file permissions on the MySQL Configuration file so the mysql OS user owns and file and is the only user with read-write permissions. Use the SHOW GRANTS statements to audit who has SUPER permissions and remove any users with excess privileges. For my.cnf, 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 mysqld-auto.cnf is created and managed by the mysql instance, as such permissions should be correct. If not correct, change "owner" to "mysql" and "rw r" to "640".

b
The MySQL Database Server 8.0 must produce audit records of its enforcement of access restrictions associated with changes to the configuration of the MySQL Database Server 8.0 or database(s).
CM-5 - Medium - CCI-001814 - V-235170 - SV-235170r879754_rule
RMF Control
CM-5
Severity
Medium
CCI
CCI-001814
Version
MYS8-00-009300
Vuln IDs
  • V-235170
Rule IDs
  • SV-235170r879754_rule
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.
Checks: C-38389r623630_chk

Determine if an audit is configured to capture denied actions. Check if MySQL audit is configured and enabled. The my.cnf file will set the variable audit_file. To further check, execute the following query: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'audit%'; The status of the audit_log plugin must be "active". If it is not "active", 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's password, all of which should fail: set persist wait_timeout=28000; rename user passme to cantchange; SET PASSWORD FOR passme = 'sfsdfsdf'; 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 "select @@datadir, @@audit_log_file; " are /usr/local/mysql/data/, audit.log sudo cat /usr/local/mysql/data/audit.log { "timestamp": "2020-08-31 20:10:21", "id": 1, "class": "general", "event": "status", "connection_id": 38, "account": { "user": "fewconnects", "host": "localhost" }, "login": { "user": "fewconnects", "os": "", "ip": "127.0.0.1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "set_option", "query": "set persist wait_timeout=28000", "status": 1227 } }, { "timestamp": "2020-08-31 20:10:48", "id": 1, "class": "general", "event": "status", "connection_id": 38, "account": { "user": "fewconnects", "host": "localhost" }, "login": { "user": "fewconnects", "os": "", "ip": "127.0.0.1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "rename_user", "query": "rename user passme to cantchange", "status": 1227 } }, , "host": "localhost" }, "login": { "user": "fewconnects", "os": "", "ip": "127.0.0.1", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "set_password", "query": "SET PASSWORD FOR `passme`@`%`=&lt;secret&gt;", "status": 1044 } }, Note each has a non-zero status, 1227, 1227, and 1044 respectively. If the audit log does not contain records of its enforcement of access restrictions associated with changes to the configuration of the DBMS or database(s), this is a finding.

Fix: F-38352r623631_fix

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). See the supplemental file "MySQL80Audit.sql".

b
The MySQL Database Server 8.0 must utilize centralized management of the content captured in audit records generated by all components of the MySQL Database Server 8.0.
AU-3 - Medium - CCI-001844 - V-235171 - SV-235171r879729_rule
RMF Control
AU-3
Severity
Medium
CCI
CCI-001844
Version
MYS8-00-009400
Vuln IDs
  • V-235171
Rule IDs
  • SV-235171r879729_rule
The content captured in audit records must be managed from a central location (necessitating automation). Centralized management of audit records and logs provides for efficiency in maintenance and management of records, as well as the backup and archiving of those records. The MySQL Server writes audit records to files in the file system and this data is available via ReadOnly using functions within the MySQL Server. These files are available via SQL functions or on the filesystem in JSON and XML formats providing compatibility for off-loading audit records to centralized system(s).
Checks: C-38390r623633_chk

Review the system documentation for a description of how audit records are off-loaded and how local audit log space is managed. If the MySQL Server audit records are not written directly to or systematically transferred to a centralized log management system, this is a finding.

Fix: F-38353r623634_fix

Configure and/or deploy software tools to ensure that MySQL Server audit records are written directly to or systematically transferred to a centralized log management system.

b
The MySQL Database Server 8.0 must provide centralized configuration of the content to be captured in audit records generated by all components of the MySQL Database Server 8.0.
AU-3 - Medium - CCI-001844 - V-235172 - SV-235172r879729_rule
RMF Control
AU-3
Severity
Medium
CCI
CCI-001844
Version
MYS8-00-009500
Vuln IDs
  • V-235172
Rule IDs
  • SV-235172r879729_rule
If the configuration of the Database Management System's (DBMS's) auditing is spread across multiple locations in the database management software, or across multiple commands, only loosely related, it is harder to use and takes longer to reconfigure in response to events. The DBMS must provide a unified tool for audit configuration.
Checks: C-38391r623636_chk

Review the system documentation for a description of how audit records are off-loaded and how local audit log space is managed. If the MySQL Server audit records are not written directly to or systematically transferred to a centralized log management system, this is a finding.

Fix: F-38354r623637_fix

Configure and/or deploy software tools to ensure that MySQL Server audit records are written directly to or systematically transferred to a centralized log management system.

b
The MySQL Database Server 8.0 must allocate audit record storage capacity in accordance with organization-defined audit record storage requirements.
AU-4 - Medium - CCI-001849 - V-235173 - SV-235173r879730_rule
RMF Control
AU-4
Severity
Medium
CCI
CCI-001849
Version
MYS8-00-009600
Vuln IDs
  • V-235173
Rule IDs
  • SV-235173r879730_rule
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 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's ability to reuse the space formerly occupied by off-loaded records.
Checks: C-38392r623639_chk

Check the server documentation for the SQL Audit file size configurations. Locate the Audit file path and drive. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME = 'audit_log_file' OR VARIABLE_NAME= 'datadir' OR VARIABLE_NAME = 'audit_log_rotate_on_size'; If the value of audit_log_file contains a path, for example: /var/log/mysql/audit.log This is the location of the audit log, and the location to assess the storage capacity. If the value of audit_log_file is the filename alone, for example: audit.log The audit logs are located in the path returned by datadir. Calculate the space needed based on the audit file size and number of audit files to be stored simultaneously. Note that MySQL does not delete log files; that requires third-party tools or custom scripts. If the calculated product of the "audit_log_rotate_on_size" times the number of audit files allowed will exceed the size of the storage location, this is a finding.

Fix: F-38355r623640_fix

Review the MySQL Audit file location, ensure the destination has enough space available to accommodate the maximum total size of all files that could be written. Use a script or third-party tool to manage the maximum number of audit log files that are to be stored, staying within the number of logs the system was sized to support. Use compression and JSON format to reduce file growth. Update the location for audit_log_file in the MySQL configuration file, for example: [mysqld] audit-log-file=/var/log/mysql/audit.log audit-log-format=JSON audit-log-compression=GZIP

b
The MySQL Database Server 8.0 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.
AU-4 - Medium - CCI-001851 - V-235174 - SV-235174r879886_rule
RMF Control
AU-4
Severity
Medium
CCI
CCI-001851
Version
MYS8-00-009700
Vuln IDs
  • V-235174
Rule IDs
  • SV-235174r879886_rule
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 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.
Checks: C-38393r623642_chk

Review the system documentation for a description of how audit records are off-loaded. Check that the OS or software is in place to copy or transfer the specified audit record content to a centralized audit log repository. If it is not, this is a finding. Check that permissions are set on the either the MySQL audit log read functions (users granted AUDIT_ADMIN or MySQL Audit Files and on the target repository to enable the required transfer of audit data. If not, this is a finding. Verify that the specified audit record content is indeed copied or transferred to the central repository. If it is not, this is a finding.

Fix: F-38356r623643_fix

If necessary, employ SQL code calls to the audit log read functions or other software to copy or transfer the specified audit record content to the repository. Ensure that permissions are set to enable transfer of the data. Some SQL may require the AUDIT_ADMIN permission be granted to the MySQL user account used for transferring the data. Based on the setup, allocate sufficient audit file/table space to support peak demand. For example to set to 1 GB: set persist audit_log_rotate_on_size=1024*1024*1024; If using file copies to move audit logs, only audit.<timestamp>.log* formatted files should be copied as audit.log* are still being written to. If audit data is copied using a SQL function, the audit files still require removal using some alternative method on the OS filesystem, for example a third-party tool or a scheduled script. If, after the preceding steps, the transfer is not succeeding, diagnose and repair the problem.

b
The MySQL Database Server 8.0 must provide a warning to appropriate support staff when allocated audit record storage volume reaches 75 percent of maximum audit record storage capacity.
AU-5 - Medium - CCI-001855 - V-235175 - SV-235175r879732_rule
RMF Control
AU-5
Severity
Medium
CCI
CCI-001855
Version
MYS8-00-009800
Vuln IDs
  • V-235175
Rule IDs
  • SV-235175r879732_rule
Organizations are required to use a central log management system, so, under normal conditions, the audit space allocated to the DBMS on its own server will not be an issue. However, space will still be required on the Database Management System's (DBMS) server for audit records in transit, and, under abnormal conditions, this could fill up. 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).
Checks: C-38394r623645_chk

Review OS, 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.

Fix: F-38357r623646_fix

Modify OS, or third-party logging application settings to alert appropriate personnel when 75 percent of audit log storage capacity is reached.

b
The MySQL Database Server 8.0 must provide an immediate real-time alert to appropriate support staff of all audit log failures.
AU-5 - Medium - CCI-001858 - V-235176 - SV-235176r879733_rule
RMF Control
AU-5
Severity
Medium
CCI
CCI-001858
Version
MYS8-00-009900
Vuln IDs
  • V-235176
Rule IDs
  • SV-235176r879733_rule
It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without a real-time alert, security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected. The appropriate support staff include, at a minimum, the Information System Security Officer (ISSO) and the database administrator (DBA)/system administrator (SA). A failure of database auditing will result in either the database continuing to function without auditing or in a complete halt to database operations. When audit processing fails, appropriate personnel must be alerted immediately to avoid further downtime or unaudited transactions. Alerts provide organizations with urgent messages. Real-time alerts provide these messages immediately (i.e., the time from event detection to alert occurs in seconds or less).
Checks: C-38395r623648_chk

Review MySQL Server settings, OS, or third-party logging software settings to determine whether a real-time alert will be sent to the appropriate personnel when auditing fails for any reason. If real-time alerts are not sent upon auditing failure, this is a finding.

Fix: F-38358r623649_fix

Configure the system to provide immediate real-time alerts to appropriate support staff when an audit log failure occurs.

b
The MySQL Database Server 8.0 must prohibit the use of cached authenticators after an organization-defined time period.
IA-5 - Medium - CCI-002007 - V-235177 - SV-235177r879773_rule
RMF Control
IA-5
Severity
Medium
CCI
CCI-002007
Version
MYS8-00-010300
Vuln IDs
  • V-235177
Rule IDs
  • SV-235177r879773_rule
If cached authentication information is out-of-date, the validity of the authentication information may be questionable.
Checks: C-38396r623651_chk

Verify that the MySQL is using Kerberos Authentication. On the server: SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE '%ldap%'; On the client(s) where Kerberos will authenticate, check how long the ticket is cached. First check whether Kerberos authentication works correctly: Use kinit to authenticate to Kerberos, for example. kinit bredon@MYSQL.LOCAL The command authenticates for the Kerberos principal named bredon@MYSQL.LOCAL. Enter the principal's password when the command prompts for it. The KDC returns a TGT that is cached on the client side for use by other Kerberos-aware applications. Use klist to check whether the TGT was obtained correctly. The output should be similar to this: Ticket cache: FILE:/tmp/krb5cc_244306 Default principal: bredon@MYSQL.LOCAL Valid starting Expires Service principal 03/23/2020 08:18:33 03/23/2020 18:18:33 krbtgt/MYSQL.LOCAL@MYSQL.LOCAL If the ticket expiration time exceeds the desired maximum expiration, and Kerberos is enabled, check the LDAP server for the maximum lifetime of the Kerberos service Tickets expiration policy. If the lifetime exceeds the desired expiration time, this is a finding.

Fix: F-38359r623652_fix

Modify system settings to implement the organization-defined limit on the lifetime of cached authenticators. Configure the MySQL server for GSSAPI/Kerberos LDAP authentication plugin to use the GSSAPI/Kerberos authentication method. Following is an example of plugin-related settings the server my.cnf file might contain: [mysqld] plugin-load-add=authentication_ldap_sasl.so authentication_ldap_sasl_auth_method_name="GSSAPI" authentication_ldap_sasl_server_host=198.51.100.10 authentication_ldap_sasl_server_port=389 authentication_ldap_sasl_bind_root_dn="cn=admin,cn=users,dc=MYSQL,dc=LOCAL" authentication_ldap_sasl_bind_root_pwd="password" authentication_ldap_sasl_bind_base_dn="cn=users,dc=MYSQL,dc=LOCAL" authentication_ldap_sasl_user_search_attr="sAMAccountName" Create account(s) using Kerberos Authentication. For example: CREATE USER 'bredon@MYSQL.LOCAL' IDENTIFIED WITH authentication_ldap_sasl BY '#krb_grp=proxied_krb_user'; CREATE USER 'proxied_krb_user' IDENTIFIED WITH mysql_no_login; GRANT ALL ON krb_user_db.* TO 'proxied_krb_user'; GRANT PROXY ON 'proxied_krb_user' TO 'bredon@MYSQL.LOCAL’;

b
The MySQL Database Server 8.0 must require users to reauthenticate when organization-defined circumstances or situations require reauthentication.
IA-11 - Medium - CCI-002038 - V-235178 - SV-235178r879762_rule
RMF Control
IA-11
Severity
Medium
CCI
CCI-002038
Version
MYS8-00-010400
Vuln IDs
  • V-235178
Rule IDs
  • SV-235178r879762_rule
The DoD standard for authentication of an interactive user is the presentation of a Common Access Card (CAC) or other physical token bearing a valid, current, DoD-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 DoD, the minimum circumstances requiring reauthentication are privilege escalation and role changes.
Checks: C-38397r623654_chk

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 ='&lt;name&gt; and host like '%'; 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 processslist_id; If the provided SQL does not force reauthentication, this is a finding.

Fix: F-38360r623655_fix

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 processslist_id;

b
The MySQL Database Server 8.0 must enforce discretionary access control policies, as defined by the data owner, over defined subjects and objects.
AC-3 - Medium - CCI-002165 - V-235179 - SV-235179r879705_rule
RMF Control
AC-3
Severity
Medium
CCI
CCI-002165
Version
MYS8-00-010500
Vuln IDs
  • V-235179
Rule IDs
  • SV-235179r879705_rule
Discretionary Access Control (DAC) is based on the notion that individual users are "owners" 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 discretionary access control 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 policies is still able to operate under the less rigorous constraints of this requirement. Thus, while Mandatory Access Control 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 discretionary access control require identity-based access control, that limitation is not required for this use of discretionary access control.
Checks: C-38398r623657_chk

Use the following query to discover database object access rights: Users with DDL rights on database objects At Instance Level SELECT * FROM `mysql`.`user` WHERE (`mysql`.`user`.`user` not like 'mysql.%') AND ( `user`.`Create_priv` = 'Y' OR `user`.`Drop_priv` = 'Y' OR `user`.`Grant_priv` = 'Y' OR `user`.`References_priv` = 'Y' OR `user`.`Index_priv` = 'Y' OR `user`.`Alter_priv` = 'Y' OR `user`.`Super_priv` = 'Y' OR `user`.`Execute_priv` = 'Y' OR `user`.`Create_view_priv` = 'Y' OR `user`.`Create_routine_priv` = 'Y' OR `user`.`Alter_routine_priv` = 'Y' OR `user`.`Create_user_priv` = 'Y' OR `user`.`Event_priv` = 'Y' OR `user`.`Trigger_priv` = 'Y' OR `user`.`Create_role_priv` = 'Y' OR `user`.`Drop_role_priv` = 'Y') ; At DB/Schema Level - Users with DDL rights on database objects Ensure only administrative users are returned in the result set. SELECT * FROM mysql.db where (`db`.`Grant_priv` = 'Y' OR `db`.`References_priv`= 'Y' OR `db`.`Index_priv`= 'Y' OR `db`.`Alter_priv`= 'Y' OR `db`.`Create_tmp_table_priv`= 'Y' OR `db`.`Lock_tables_priv`= 'Y' OR `db`.`Create_view_priv`= 'Y' OR `db`.`Show_view_priv`= 'Y' OR `db`.`Create_routine_priv`= 'Y' OR `db`.`Alter_routine_priv`= 'Y' OR `db`.`Execute_priv`= 'Y' OR `db`.`Event_priv`= 'Y' OR `db`.`Trigger_priv`) and user not like 'mysql.%'; 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`='YES'; Ensure only administrative users are returned in the result set. If any of these rights are not documented and authorized, this is a finding.

Fix: F-38361r623658_fix

To correct object ownership: To 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 ] ...

b
Execution of software modules (to include stored procedures, functions, and triggers) with elevated privileges must be restricted to necessary cases only.
AC-6 - Medium - CCI-002233 - V-235180 - SV-235180r879719_rule
RMF Control
AC-6
Severity
Medium
CCI
CCI-002233
Version
MYS8-00-010600
Vuln IDs
  • V-235180
Rule IDs
  • SV-235180r879719_rule
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 utilized only where necessary and protected from misuse.
Checks: C-38399r623660_chk

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; 'INVOKER'; SHOW FUNCTION STATUS where security_type &lt;&gt; 'INVOKER'; If DEFINER accounts are returned that are not documented and authorized, this is a finding. If elevation of MySQL privileges using DEFINER 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, or in contexts other than intended, or by subjects/principals other than intended, this is a finding.

Fix: F-38362r623661_fix

Remove any procedures that are not authorized. Drop the procedure or function using DROP PROCEDURE <proc_name>; DROP FUNCTION <function_name>;

b
The MySQL Database Server 8.0 must prevent non-privileged users from executing privileged functions, to include disabling, circumventing, or altering implemented security safeguards/countermeasures.
AC-6 - Medium - CCI-002235 - V-235181 - SV-235181r879717_rule
RMF Control
AC-6
Severity
Medium
CCI
CCI-002235
Version
MYS8-00-010700
Vuln IDs
  • V-235181
Rule IDs
  • SV-235181r879717_rule
Preventing non-privileged users from executing privileged functions mitigates the risk that unauthorized individuals or processes may gain unnecessary access to information or privileges. System documentation should include a definition of the functionality considered privileged. Depending on circumstances, privileged functions can include, for example, establishing accounts, performing system integrity checks, or administering cryptographic key management activities. Non-privileged users are individuals that do not possess appropriate authorizations. Circumventing intrusion detection and prevention mechanisms or malicious code protection mechanisms are examples of privileged functions that require protection from non-privileged users. A privileged function in the Database Management System (DBMS)/database 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 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 SELECT, INSERT, UPDATE, or DELETE to an application-defined security table executed by other than a security principal. Depending on the capabilities of the DBMS and the design of the database and associated applications, the prevention of unauthorized use of privileged functions may be achieved by means of DBMS security features, database triggers, other mechanisms, or a combination of these.
Checks: C-38400r623663_chk

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; 'INVOKER'; SHOW FUNCTION STATUS where security_type &lt;&gt; 'INVOKER'; If DEFINER accounts are returned that are not documented and authorized, this is a finding. If elevation of MySQL privileges using DEFINER 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, or in contexts other than intended, or by subjects/principals other than intended, this is a finding.

Fix: F-38363r623664_fix

Remove any procedures that are not authorized. Drop the procedure or function using DROP PROCEDURE <proc_name>; DROP FUNCTION <function_name>;

b
The MySQL Database Server 8.0 must associate organization-defined types of security labels having organization-defined security label values with information in storage.
AC-16 - Medium - CCI-002262 - V-235182 - SV-235182r879689_rule
RMF Control
AC-16
Severity
Medium
CCI
CCI-002262
Version
MYS8-00-010800
Vuln IDs
  • V-235182
Rule IDs
  • SV-235182r879689_rule
Without the association of security labels to information, there is no basis for the 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 FOUO. 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. To use a view requires appropriate privileges only for the view itself. The user need not be given privileges on base objects underlying the view.
Checks: C-38401r623666_chk

If security labeling is not required, this is not a finding. For data that have been labeled with a column indicating data is classified read-only views can be created and secured via access privileges such that a user can only view the data that have a specific tag or tags (e.g., user [x] can only view records that are labeled with the tag of classified). If security labeling requirements have been specified, but neither a third-party solution nor a MySQL Views and Stored Procedures are used to implement row level security solution is implemented that reliably maintains labels on information in storage, this is a finding.

Fix: F-38364r623667_fix

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.

b
The MySQL Database Server 8.0 must associate organization-defined types of security labels having organization-defined security label values with information in process.
AC-16 - Medium - CCI-002263 - V-235183 - SV-235183r879690_rule
RMF Control
AC-16
Severity
Medium
CCI
CCI-002263
Version
MYS8-00-010900
Vuln IDs
  • V-235183
Rule IDs
  • SV-235183r879690_rule
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 FOUO. 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. To use a view requires appropriate privileges only for the view itself. The user need not be given privileges on base objects underlying the view.
Checks: C-38402r623669_chk

If security labeling is not required, this is not a finding. If security labeling requirements have been specified, check for a MySQL solution using views and Stored Procedures to implement a row-level security solution that reliably maintains labels on information in storage. For data that have been labeled with a column indicating data is classified read-only, views can be created and secured via access privileges such that a user should only be able to view the data that have a specific tag or tags (e.g., user [x] can only view records that are labeled with the tag of classified). If a MySQL solution through the use of views and stored procedures or a third party solution does not exist, this is a finding.

Fix: F-38365r623670_fix

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.

b
The MySQL Database Server 8.0 must associate organization-defined types of security labels having organization-defined security label values with information in transmission.
AC-16 - Medium - CCI-002264 - V-235184 - SV-235184r879691_rule
RMF Control
AC-16
Severity
Medium
CCI
CCI-002264
Version
MYS8-00-011000
Vuln IDs
  • V-235184
Rule IDs
  • SV-235184r879691_rule
Without the association of security labels to information, there is no basis for the 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 FOUO. 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. To use a view requires appropriate privileges only for the view itself. The user need not be given privileges on base objects underlying the view.
Checks: C-38403r623672_chk

If security labeling is not required, this is not a finding. If security labeling requirements have been specified, check for a MySQL solution using views and Stored Procedures to implement a row-level security solution that reliably maintains labels on information in storage. For data that have been labeled with a column indicating data is classified read-only, views can be created and secured via access privileges such that a user can only view the data that have a specific tag or tags (e.g., user [x] can only view records that are labeled with the tag of classified). If a MySQL solution through the use of views and stored procedures or a third party solution does not exist, this is a finding.

Fix: F-38366r623673_fix

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.

b
The MySQL Database Server 8.0 must automatically terminate a user session after organization-defined conditions or trigger events requiring session disconnect.
AC-12 - Medium - CCI-002361 - V-235185 - SV-235185r879673_rule
RMF Control
AC-12
Severity
Medium
CCI
CCI-002361
Version
MYS8-00-011100
Vuln IDs
  • V-235185
Rule IDs
  • SV-235185r879673_rule
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'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.
Checks: C-38404r623675_chk

Review system documentation to obtain the organization's definition of circumstances requiring automatic session termination. If the documentation explicitly states that such termination is not required or is prohibited, this is not a finding. Determine the 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 ='&lt;name&gt; and host like '%'; 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 processslist_id; If the provided SQL does not force reauthentication, this is a finding.

Fix: F-38367r623676_fix

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 processslist_id;

b
The MySQL Database Server 8.0 must maintain the confidentiality and integrity of information during preparation for transmission.
SC-8 - Medium - CCI-002420 - V-235186 - SV-235186r879812_rule
RMF Control
SC-8
Severity
Medium
CCI
CCI-002420
Version
MYS8-00-011300
Vuln IDs
  • V-235186
Rule IDs
  • SV-235186r879812_rule
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 DBMS, associated applications, and infrastructure must leverage transmission protection mechanisms.
Checks: C-38405r623678_chk

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; The value should be 1 (ON) versus 0 (OFF), if the value is 0 (OFF), this is a finding.

Fix: F-38368r623679_fix

Turn on require_secure_transport. In this mode the server permits only TCP/IP connections encrypted using 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 ER_SECURE_TRANSPORT_REQUIRED error. set persist require_secure_transport=ON;

b
The MySQL Database Server 8.0 must use NSA-approved cryptography to protect classified information in accordance with the data owner's requirements.
SC-13 - Medium - CCI-002450 - V-235187 - SV-235187r917659_rule
RMF Control
SC-13
Severity
Medium
CCI
CCI-002450
Version
MYS8-00-011500
Vuln IDs
  • V-235187
Rule IDs
  • SV-235187r917659_rule
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 DBMS with the encryption devices.
Checks: C-38406r863353_chk

Detailed information on the NIST Cryptographic Module Validation Program (CMVP) is available at the following website: http://csrc.nist.gov/groups/STM/cmvp/index.html. Review system documentation to determine whether cryptography for classified or sensitive information is required by the information owner. If the system documentation does not specify the type of information hosted on MySQL: classified, sensitive, and/or unclassified, this is a finding. If classified or sensitive information does not exist within MySQL Server, this is not a finding. Verify that the operating system provides the OpenSSL FIPS Object Module, and is configured to require the use of OpenSSL of FIPS compliant algorithms, available at MySQL runtime. If the Security Setting for FIPS mode option is "Disabled" on the server's OS, this is a finding. If cryptography is being used by MySQL, verify that the cryptography is NIST FIPS certified by running the following SQL query: Determine if MySQL is running in FIPS mode. select @@ssl_fips_mode; If ssl_fips_mode is not "ON" or "STRICT", this is a finding. View the versions of TLS, then review the cipher suites in use for the versions returned by statement: SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME = 'tls_version'; If the results include less than version TLS 1.2, for example TLS 1.0 or 1.1, this is a finding. If the results include TLS 1.2 view the supported ciphers on the MySQL Server, run select * from performance_schema.global_status where variable_name= 'Ssl_cipher_list'; If the results include TLS 1.3 view the supported ciphers on the MySQL Server, run SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME = 'tls_ciphersuites'; If any results list show an uncertified NIST FIPS 140-2 algorithm type, this is a finding. Check MySQL certificate PEM file(s) for compliance with DoD requirements by running this command: openssl x509 -in server-cert.pem -text -noout If any PEM file is not in compliance, this is a finding.

Fix: F-38369r917658_fix

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='TLSv1.2,TLSv1.3' Example to define ciphers for TLSv1.2: [mysqld] ssl_ciphers='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' If TLSv1.3 is enabled, the "tls_ciphersuites" setting must contain all or a subset of the following ciphers based on certificates being used by 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='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' After adding any entries to the my.cnf file, restart mysqld. Create and use DOD-approved certificates for asymmetric keys used by the database.

b
The MySQL Database Server 8.0 must implement NIST FIPS 140-2 or 140-3 validated cryptographic modules to provision digital signatures.
SC-13 - Medium - CCI-002450 - V-235188 - SV-235188r879885_rule
RMF Control
SC-13
Severity
Medium
CCI
CCI-002450
Version
MYS8-00-011600
Vuln IDs
  • V-235188
Rule IDs
  • SV-235188r879885_rule
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-2 or Publication 140-3, Security Requirements For Cryptographic Modules. Note that the product's cryptographic modules must be validated and certified by NIST as FIPS-compliant.
Checks: C-38407r623684_chk

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 = 'ssl_fips_mode'; If the VARIABLE_VALUE does not return "ON" or "STRICT", this is a finding. In general, STRICT imposes more restrictions than ON, 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 ON or STRICT depends on the OpenSSL version.

Fix: F-38370r863355_fix

Implement NIST FIPS 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, STRICT imposes more restrictions than ON, 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 ON or STRICT depends on the OpenSSL version.

c
The MySQL Database Server 8.0 must implement NIST FIPS 140-2 or 140-3 validated cryptographic modules to generate and validate cryptographic hashes.
SC-13 - High - CCI-002450 - V-235189 - SV-235189r879885_rule
RMF Control
SC-13
Severity
High
CCI
CCI-002450
Version
MYS8-00-011700
Vuln IDs
  • V-235189
Rule IDs
  • SV-235189r879885_rule
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-2 or Publication 140-3, Security Requirements For Cryptographic Modules. Note that the product's cryptographic modules must be validated and certified by NIST as FIPS-compliant.
Checks: C-38408r623687_chk

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 = 'ssl_fips_mode'; If the VARIABLE_VALUE does not return "ON" or "STRICT", this is a finding. In general, STRICT imposes more restrictions than ON, 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 ON or STRICT depends on the OpenSSL version.

Fix: F-38371r863357_fix

Implement NIST FIPS 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, STRICT imposes more restrictions than ON, 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 ON or STRICT depends on the OpenSSL version.

b
The MySQL Database Server 8.0 must implement NIST FIPS 140-2 or 140-3 validated cryptographic modules to protect unclassified information requiring confidentiality and cryptographic protection, in accordance with the data owner's requirements.
SC-13 - Medium - CCI-002450 - V-235190 - SV-235190r879885_rule
RMF Control
SC-13
Severity
Medium
CCI
CCI-002450
Version
MYS8-00-011800
Vuln IDs
  • V-235190
Rule IDs
  • SV-235190r879885_rule
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. For detailed information, refer to NIST FIPS Publication 140-2 or Publication 140-3, Security Requirements For Cryptographic Modules. Note that the product's cryptographic modules must be validated and certified by NIST as FIPS-compliant.
Checks: C-38409r623690_chk

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 = 'ssl_fips_mode'; If the VARIABLE_VALUE does not return "ON" or "STRICT", this is a finding. In general, STRICT imposes more restrictions than ON, 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 ON or STRICT depends on the OpenSSL version.

Fix: F-38372r863359_fix

Implement NIST FIPS 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, STRICT imposes more restrictions than ON, 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 ON or STRICT depends on the OpenSSL version.

b
The MySQL Database Server 8.0 must only accept end entity certificates issued by DoD PKI or DoD-approved PKI Certification Authorities (CAs) for the establishment of all encrypted sessions.
SC-23 - Medium - CCI-002470 - V-235191 - SV-235191r879798_rule
RMF Control
SC-23
Severity
Medium
CCI
CCI-002470
Version
MYS8-00-011900
Vuln IDs
  • V-235191
Rule IDs
  • SV-235191r879798_rule
Only DoD-approved external PKIs have been evaluated to ensure they have security controls and identity vetting procedures in place that are sufficient for DoD 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 DoD-approved PKIs is published at https://cyber.mil/pki-pke/interoperability. This requirement focuses on communications protection for the DBMS session rather than for the network packet.
Checks: C-38410r623693_chk

To run MySQL in 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 DoD certificate authority. Run this command: openssl x509 -in &lt;path_to_certificate_pem_file&gt; -text | grep -i "issuer" If there is any issuer present in the certificate that is not a DoD-approved certificate authority, this is a finding.

Fix: F-38373r623694_fix

Remove any certificate that was not issued by a valid DoD certificate authority. Contact the organization's certificate issuer and request a new certificate that is issued by a valid DoD certificate authorities.

b
The MySQL Database Server 8.0 must implement cryptographic mechanisms to prevent unauthorized modification of organization-defined information at rest (to include, at a minimum, PII and classified information) on organization-defined information system components.
SC-28 - Medium - CCI-002475 - V-235192 - SV-235192r879799_rule
RMF Control
SC-28
Severity
Medium
CCI
CCI-002475
Version
MYS8-00-012000
Vuln IDs
  • V-235192
Rule IDs
  • SV-235192r879799_rule
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.
Checks: C-38411r623696_chk

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 8.0 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 = 'audit_log_encryption'; If the value for audit_log_encryption is not AES, this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'binlog_encryption'; If the value for binlog_encryption is not "ON", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'innodb_redo_log_encrypt'; If the value for binlog_innodb_redo_log_encrypt is not "ON", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'innodb_undo_log_encrypt'; If the value for innodb_undo_log_encrypt is not "ON", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'table_encryption_privilege_check'; If the value for table_encryption_privilege_check is not "ON", 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 "Y", this is a finding.

Fix: F-38374r623697_fix

Configure the MySQL Database Server 8.0, operating system/file system, and additional software as relevant, to provide the required level of cryptographic protection. Enable the MySQL Key Ring for securely managing encryption keys with KMIP or other supported protocols. Change TABLESPACES, TABLES to put in place encryption. ALTER TABLESPACE <tablespacename> ENCRYPTION = 'Y'; ALTER TABLE <tablespacename> ENCRYPTION = 'Y'; Require all new tables and tablespaces to be encrypted. set persist table_encryption_privilege_check=ON; Require AUDIT LOG encryption sudo vi /etc/my.cnf [mysqld] audit-log=FORCE_PLUS_PERMANENT audit-log-format=JSON audit-log-encryption=AES Require BINLOG 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; Turn off insecure logging (use the audit log above to track activity). SET PERSIST general_log = 'OFF';

b
The MySQL Database Server 8.0 must implement cryptographic mechanisms preventing the unauthorized disclosure of organization-defined information at rest on organization-defined information system components.
SC-28 - Medium - CCI-002476 - V-235193 - SV-235193r879800_rule
RMF Control
SC-28
Severity
Medium
CCI
CCI-002476
Version
MYS8-00-012100
Vuln IDs
  • V-235193
Rule IDs
  • SV-235193r879800_rule
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.
Checks: C-38412r623699_chk

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 8.0 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 = 'audit_log_encryption'; If the value for audit_log_encryption is not "AES", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'binlog_encryption'; If the value for binlog_encryption is not "ON", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'innodb_redo_log_encrypt'; If the value for binlog_innodb_redo_log_encrypt is not "ON", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'innodb_undo_log_encrypt'; If the value for innodb_undo_log_encrypt is not "ON", this is a finding. SELECT VARIABLE_NAME, VARIABLE_VALUE FROM performance_schema.global_variables where variable_name = 'table_encryption_privilege_check'; If the value for table_encryption_privilege_check is not "ON", 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 "Y", this is a finding.

Fix: F-38375r623700_fix

Configure the MySQL Database Server 8.0, operating system/file system, and additional software as relevant, to provide the required level of cryptographic protection. Enable the MySQL Key Ring for securely managing encryption keys with KMIP or other supported protocols. Change TABLESPACES, TABLES to put in place encryption. ALTER TABLESPACE <tablespacename> ENCRYPTION = 'Y'; ALTER TABLE <tablespacename> ENCRYPTION = 'Y'; Require all new tables and tablespaces to be encrypted. set persist table_encryption_privilege_check=ON; Require AUDIT LOG encryption sudo vi /etc/my.cnf [mysqld] audit-log=FORCE_PLUS_PERMANENT audit-log-format=JSON audit-log-encryption=AES Require BINLOG 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; Turn off insecure logging - (use the audit log above to track activity) SET PERSIST general_log = 'OFF';

b
Security-relevant software updates to the MySQL Database Server 8.0 must be installed within the time period directed by an authoritative source (e.g., IAVM, CTOs, DTMs, and STIGs).
SI-2 - Medium - CCI-002605 - V-235194 - SV-235194r879827_rule
RMF Control
SI-2
Severity
Medium
CCI
CCI-002605
Version
MYS8-00-012300
Vuln IDs
  • V-235194
Rule IDs
  • SV-235194r879827_rule
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 utilized must be a configurable parameter. Time frames for application of security-relevant software updates may be dependent upon the Information Assurance Vulnerability Management (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).
Checks: C-38413r623702_chk

To check the version of the installed MySQL, run the following SQL statement: select @@version; The result will show the version, for example: 8.0.22-commercial Obtain evidence that software MRU updates 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 vulnerability. 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/8.0/en/ If MySQL Enterprise Edition 8.0 is not at the latest version, this is a finding.

Fix: F-38376r623703_fix

Institute and adhere to policies and procedures to ensure that patches are consistently applied to MySQL within the time allowed.

b
When invalid inputs are received, the MySQL Database Server 8.0 must behave in a predictable and documented manner that reflects organizational and system objectives.
SI-10 - Medium - CCI-002754 - V-235195 - SV-235195r879818_rule
RMF Control
SI-10
Severity
Medium
CCI
CCI-002754
Version
MYS8-00-012500
Vuln IDs
  • V-235195
Rule IDs
  • SV-235195r879818_rule
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.
Checks: C-38414r623705_chk

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 that 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.

Fix: F-38377r623706_fix

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 CHECK 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 ) ); Adding a constraint to an existing table ALTER TABLE <table_name> ADD [CONSTRAINT [symbol]] CHECK (condition) [[NOT] ENFORCED]

c
MySQL database products must be a version supported by the vendor.
SA-22 - High - CCI-003376 - V-259798 - SV-259798r947240_rule
RMF Control
SA-22
Severity
High
CCI
CCI-003376
Version
MYS8-00-012600
Vuln IDs
  • V-259798
Rule IDs
  • SV-259798r947240_rule
Unsupported commercial and database systems should not be used because fixes to newly identified bugs will not be implemented by the vendor. The lack of support can result in potential vulnerabilities. Systems at unsupported servicing levels or releases will not receive security updates for new vulnerabilities, which leaves them subject to exploitation. When maintenance updates and patches are no longer available, the database software is no longer considered supported and should be upgraded or decommissioned.
Checks: C-54617r947238_chk

Review the version and release information. To check the version of the installed MySQL, run the following SQL statement: select @@version; The result will show the version. For example: 8.0.22-commercial Access the vendor website or use other means to verify the version is still supported. Oracle lifetime support: https://www.oracle.com/us/assets/lifetime-support-technology-069183.pdf Scroll down to Oracle MySQL Releases (approximately page 28). If the Oracle MySQL version or any of the software components are not supported by the vendor, this is a finding.

Fix: F-54571r947239_fix

Remove or decommission all unsupported software products. Upgrade unsupported DBMS or unsupported components to a supported version of the product. Oracle supported platforms can be found here: https://www.mysql.com/support/supportedplatforms/database.html