{"stig":{"title":"MariaDB Enterprise Server Security Technical Implementation Guide","version":"1","release":"1"},"checks":[{"vulnId":"V-286171","ruleId":"SV-286171r1292225_rule","severity":"medium","ruleTitle":"MariaDB must limit the number of concurrent sessions to an organization-defined number per user for all accounts and/or account types.","description":"Database management includes the ability to control the number of users and user sessions using MariaDB. Unlimited concurrent connections to MariaDB 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.\n\nThis 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.\n\nThe capability to limit the number of concurrent sessions per user must be configured in or added to MariaDB (for example, by use of a logon trigger). 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 MariaDB by other means.\n\nThe organization must define the maximum number of concurrent sessions by account type, by account, or a combination thereof. In deciding on the appropriate number, it is important to consider the work requirements of the various types of users. For example, two might be an acceptable limit for general users accessing the database via an application; but 10 might be too few for a DBA using a database management GUI tool, where each query tab and navigation pane may count as a separate session.\n\nSessions may also be referred to as connections or logons.","checkContent":"Check the number of connections allowed for each user. \n\nAs the DBA (root), log in to the database (mariadb -u root -p) and run:\n\nSELECT user, max_user_connections from mysql.user;\n\nIf any users have more connections configured than documented, this is a finding. \n\nA value of \"0\" indicates Unlimited and is a finding.","fixText":"Limit the number of connections allowed by a specific user. \n\nAs the DBA (root), log in to the database (mariadb -u root -p) and run: \n\nGRANT USAGE ON *.* TO  'username'@'server'  WITH MAX_USER_CONNECTIONS  number of connections;","ccis":["CCI-000054"]},{"vulnId":"V-286172","ruleId":"SV-286172r1292133_rule","severity":"high","ruleTitle":"MariaDB must integrate with an organization-level authentication/access mechanism providing account management and automation for all users, groups, roles, and any other principals.","description":"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.\n\nA comprehensive application account management process that includes automation helps to ensure that accounts designated as requiring attention are consistently and promptly addressed. \n\nExamples include, but are not limited to, using automation to act on multiple accounts designated as inactive, suspended, or terminated, or by disabling accounts located in noncentralized account stores, such as multiple servers. Account management functions can also include assignment of group or role membership; identifying account type; specifying user access authorizations (i.e., privileges); account removal, update, or termination; and administrative alerts. The use of automated mechanisms can include, for example: using email or text messaging to notify account managers when users are terminated or transferred; using the information system to monitor account usage; and using automated telephone notification to report atypical system account usage.\n\nMariaDB must be configured to automatically use organization-level account management functions, and these functions must immediately enforce the organization's current account policy. \n\nAutomation may comprise differing technologies that when placed together contain an overall mechanism supporting an organization's automated account management requirements.","checkContent":"Verify MariaDB is integrated with an organization-level authentication/access mechanism.\n\nAs the OS administrator, review the configuration files \"/etc/pam.d\" and \"/etc/pam.conf\".\n\nIf either file is missing or not configured, this is a finding.\n\nAs the DBA (root), log in to the database (mariadb -u root -p).\n\nUse the result of the next query to verify the MariaDB Server is using certificates:\n\nSHOW PLUGINS;\n\nIf PAM is not listed as active, this is a finding.\n\nUse results of next query to show PAM authentication for all users:\n\nSELECT user,  host, plugin from mysql.user;\n\nIf plugin is blank, this is a finding.\n\nIf all accounts are authenticated by the organization-level authentication/access mechanism such as LDAP, Kerberos, Active Directory and not by MariaDB, this is not a finding.\n\nIf there are any accounts managed by the DBMS, review the system documentation for justification and approval of these accounts.\n\nIf any DBMS-managed accounts exist that are not documented and approved, this is a finding.","fixText":"Integrate MariaDB security with an organization-level authentication/access mechanism providing account management for all users, groups, roles, and any other principals.\n\nAs the DBA (root), install and configure the PAM authentication module. \n\nLog in to the database (mariadb -u root -p) and run: \n\nINSTALL SONAME 'auth_pam';\n\nPAM supports many authentication methods including LDAP, Active Directory, and Kerberos. Each method must be configured properly in \"/etc/pam.d\" and \"/etc/pam.conf\".\n\nFor each MariaDB-managed account that is not documented and approved, transfer it to management by the external mechanism or document its need for approval.\n\nALTER USER username@host IDENTIFIED VIA pam USING method;","ccis":["CCI-000015"]},{"vulnId":"V-286173","ruleId":"SV-286173r1291813_rule","severity":"high","ruleTitle":"MariaDB must enforce approved authorizations for logical access to information and system resources in accordance with applicable access control policies.","description":"Authentication with a DoW-approved PKI certificate does not necessarily imply authorization to access MariaDB. To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DoW-approved PKIs, all DoW systems, including databases, must be properly configured to implement access control policies.\n\nSuccessful 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.\n\nAccess 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.\n\nThis requirement is applicable to access control enforcement applications, a category that includes database management systems. If MariaDB 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.","checkContent":"As the DBA, check the privileges of all users and roles in the database.\n\nFind all users:\n\nMariaDB> SELECT user, host FROM mysql.user WHERE is_role = 'N';\n\nFind all roles:\n\nMariaDB> SELECT user FROM mysql.user WHERE is_role = 'Y';\n\nFor each user found, check grants:\n\nMariaDB> SHOW GRANTS FOR 'username'@'host';\n\nFor each role found, check grants: \n\nMariaDB> SHOW GRANTS FOR 'rolename';\n\nReview all users and roles and their associated privileges. If any users and/or roles privileges exceed those documented, this is a finding.\n\nAs the DBA, check the configured authentication settings:\n\nMariaDB> SHOW PLUGINS;\n\nFind users not using PAM plugin for authentication: \n\nMariaDB> SELECT user, host, plugin FROM mysql.user WHERE plugin != 'pam';\n\nIf any users are returned, this is a finding. \n\nReview all entries and their associated authentication methods. If any entries do not have their documented authentication requirements, this is a finding.","fixText":"Create and/or maintain documentation of each group roles appropriate permissions on database objects. \n\nImplement these permissions in the database and remove any permissions that exceed those documented.\n \nThe following are examples of how to use role privileges in MariaDB to enforce access controls. Run these as the DBA. For a complete list of privileges, refer to the official documentation at https://mariadb.com/kb/en/grant/.\n\n#### Roles Example 1:\nThis example demonstrates how to create an admin role with SHUTDOWN privileges.\n\nAs the DBA, run:\n\nMariaDB> CREATE ROLE admin;\nMariaDB> GRANT SHUTDOWN ON *.* TO admin;\n\n#### Roles Example 2:\nThis example demonstrates how to create a user make the user a member of the admin role.\n\nAs the DBA, run:\n\nMariaDB> CREATE USER 'admin_user'@'host' IDENTIFIED VIA PAM;\nMariaDB> GRANT admin TO 'admin_user'@'%';\n\n#### Roles Example 3:\nThe following demonstrates how to revoke privileges from a role using REVOKE.\n\nAs the DBA, run:\n\nMariaDB> REVOKE admin FROM 'admin_user'@'host';\n\n#### Roles Example 4:\nThe following demonstrates how to modify privileges for a role using GRANT.\n\nAs the DBA, run:\n\nMariaDB> GRANT PROCESS ON *.* TO admin;\n\nThe following are examples of how to use grant privileges in MariaDB to enforce access controls on objects.\n\n#### Grant Example 1:\nThis example demonstrates how to grant INSERT on a table to a role.\n\nAs the DBA, run:\n\nMariaDB> GRANT INSERT ON test.t1 TO admin;\n\n#### Grant Example 2:\nThis example demonstrates how to grant ALL PRIVILEGES on a table to a role.\n\nAs the DBA, run:\n\nMariaDB> GRANT ALL PRIVILEGES ON test.t1 TO admin;\n\n#### Grant Example 3:\nThis example demonstrates how to grant a role to a role.\n\nAs the DBA, run:\n\nMariaDB> CREATE ROLE admin_master;\nMariaDB> GRANT admin TO admin_master;\n\n#### Revoke Example:\nThis example demonstrates how to revoke access from a role.\n\nAs the DBA, run:\n\nMariaDB> REVOKE PROCESS ON *.* FROM admin;\n\nTo change authentication requirements for the database, as the OS administrator, review the configuration files \"/etc/pam.d\" and \"/etc/pam.conf\". \n\nAfter making changes to the configuration files \"/etc/pam.d\" and \"/etc/pam.conf\", reload the server:\n\n# SYSTEMD SERVER ONLY\n$ sudo systemctl reload mariadb\n# INITD SERVER ONLY\n$ sudo service mariadb reload","ccis":["CCI-000213"]},{"vulnId":"V-286174","ruleId":"SV-286174r1292134_rule","severity":"medium","ruleTitle":"MariaDB must protect against a user falsely repudiating having performed organization-defined actions.","description":"Nonrepudiation of actions taken is required to maintain data integrity. Examples of particular actions taken by individuals include creating information, sending a message, approving information (e.g., indicating concurrence or signing a contract), and receiving a message. \n\nNonrepudiation 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.\n\nIn 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 MariaDB's audit tools to capture the necessary audit trail. Design and implementation also must ensure that applications pass individual user identification to MariaDB, even where the application connects to MariaDB with a standard, shared account.","checkContent":"All users must have individual accounts with appropriate privileges. The root user must be removed after administrative accounts with the \"SUPER\" privilege are created. Query all users and determine if any are suspected shared accounts. Document any necessary shared accounts.\n\nMariaDB> SELECT user, host FROM mysql.user; \n\nDetermine 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 MariaDB. An example of a shared account is the MariaDB root account \"root@localhost\".\n\nIf accounts are determined to be shared, determine if individuals are first individually authenticated. \n\nIf 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. \n\nIndividual accountability is key. If this can be traced, this is not a finding.\n\nIf accounts are shared, determine if they are directly accessible to end users. If so, this is a finding.\n\nReview contents of audit logs, traces, and data tables to confirm the identity of the individual user performing the action is captured.\n\nIf shared identifiers are found and are not accompanied by individual identifiers, this is a finding.","fixText":"Remove shared accounts which are not documented and have been determined to be unnecessary:\n\nMariaDB> DROP USER 'user'@'hostname';","ccis":["CCI-000166"]},{"vulnId":"V-286175","ruleId":"SV-286175r1292135_rule","severity":"medium","ruleTitle":"MariaDB must provide audit record generation capability for DoW-defined auditable events within all DBMS/database components.","description":"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. \n\nAudit records can be generated from various components within MariaDB (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 can generate audit records.\n\nDoW has defined the list of events for which MariaDB will provide an audit record generation capability as the following: \n\n(i) Successful and unsuccessful attempts to access, modify, or delete privileges, security objects, security levels, or categories of information (e.g., classification levels);\n\n(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\n\n(iii) All account creation, modification, disabling, and termination actions.\n\nOrganizations may define additional events requiring continuous or ad hoc auditing.\n\nSatisfies: SRG-APP-000089-DB-000064, SRG-APP-000091-DB-000066, SRG-APP-000091-DB-000325, SRG-APP-000092-DB-000208, SRG-APP-000492-DB-000332, SRG-APP-000492-DB-000333, SRG-APP-000494-DB-000344, SRG-APP-000494-DB-000345, SRG-APP-000495-DB-000326, SRG-APP-000495-DB-000327, SRG-APP-000495-DB-000328, SRG-APP-000495-DB-000329, SRG-APP-000496-DB-000334, SRG-APP-000496-DB-000335, SRG-APP-000498-DB-000346, SRG-APP-000498-DB-000347, SRG-APP-000499-DB-000330, SRG-APP-000499-DB-000331, SRG-APP-000501-DB-000336, SRG-APP-000501-DB-000337, SRG-APP-000502-DB-000348, SRG-APP-000502-DB-000349, SRG-APP-000503-DB-000350, SRG-APP-000504-DB-000355, SRG-APP-000504-DB-000354, SRG-APP-000505-DB-000352, SRG-APP-000503-DB-000351, SRG-APP-000506-DB-000353, SRG-APP-000507-DB-000356, SRG-APP-000507-DB-000357, SRG-APP-000508-DB-000358","checkContent":"Verify the MariaDB Enterprise audit plugin is installed and active:\n\nSHOW PLUGINS;\n\nVerify the \"SERVER_AUDIT\" plugin is installed and the status is \"ACTIVE\".\n\nIf the plugin is not installed and the status is not \"ACTIVE\", this is a finding.\n\nVerify auditing is enabled:\n\nSHOW GLOBAL VARIABLES LIKE 'server_audit_logging';\n\nVerify the \"server_audit_logging\" status is \"ON\". \n\nIf the status is not \"ON\", this is a finding.\n\nVerify audit logging is active:\n\nSHOW GLOBAL STATUS LIKE 'Server_audit_active';\n\nVerify the value is \"ON\". If the value is not \"ON\", this is a finding.\n\nVerify the system can audit required event types:\n\nSHOW GLOBAL VARIABLES LIKE 'server_audit_events';\n\nVerify that auditable event types required by DoW policy (at a minimum, CONNECT, QUERY, TABLE, etc.) are configured. \n\nIf required event types are not configured, this is a finding.","fixText":"Configure MariaDB Enterprise Server 11.8 or higher to generate audit records containing the required audit event information.\n\nInstall the MariaDB Enterprise audit plugin if it is not already installed. Log in to the database (mariadb -u root -p) and run:\n\nINSTALL PLUGIN server_audit SONAME 'server_audit';\n\nEdit the \"mariadb-enterprise.cnf\" configuration file located in \"/etc/my.cnf.d/\".\n\nUnder [mariadb], add/edit the following: \n\n[mariadb]\nplugin-load-add=server_audit\nserver_audit_logging=ON\nserver_audit_output_type=file\nserver_audit_file_path=/var/log/mariadb/server_audit.log\nserver_audit_events=CONNECT,QUERY,TABLE,QUERY_DDL\n\nRestart MariaDB if required for configuration changes to take effect:\n\nsystemctl restart mariadb","ccis":["CCI-000169","CCI-000172","CCI-001464"]},{"vulnId":"V-286176","ruleId":"SV-286176r1291822_rule","severity":"medium","ruleTitle":"MariaDB 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.","description":"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.\n\nSuppression of auditing could permit an adversary to evade detection.\n\nMisconfigured audits can degrade the systems 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.","checkContent":"Verify audit tables exist:\n\nSHOW TABLES FROM mysql LIKE 'server_audit%';\n\nThe expected results are \"server_audit_filters\" and \"server_audit_users\".\n\nIf \"server_audit_filters\" and \"server_audit_users\" are missing, this is a finding.\n\nIdentify users with global privileges that could modify audit configuration:\n\nSELECT user, host, Insert_priv, Update_priv, Delete_priv, Drop_priv, Super_priv \nFROM mysql.user \nWHERE Insert_priv='Y' OR Update_priv='Y' \nOR \nDelete_priv='Y' OR Drop_priv='Y' OR Super_priv='Y';\n\nIf any non-ISSM-approved users have these privileges, this is a finding.\n\nIdentify users with privileges on the mysql database:\n\nSELECT user, host, db, Insert_priv, Update_priv, Delete_priv, Drop_priv \nFROM mysql.db \nWHERE db='mysql' AND (Insert_priv='Y' OR Update_priv='Y' OR Delete_priv='Y' OR Drop_priv='Y');\n\nIf any non-ISSM-approved users have these privileges, this is a finding.\n\nIdentify users with table-level privileges on audit tables:\n\nSELECT user, host, db, table_name, table_priv FROM mysql.tables_priv \nWHERE db='mysql' AND table_name IN ('server_audit_filters','server_audit_users') \nAND (table_priv LIKE '%Insert%' OR table_priv LIKE '%Update%' \nOR table_priv LIKE '%Delete%' OR table_priv LIKE '%Drop%');\n\nIf any non-ISSM-approved users have these privileges, this is a finding.\n\nFor each user and role identified above, verify effective privileges:\n\nSHOW GRANTS FOR 'username'@'host';\nSELECT user FROM mysql.user WHERE is_role='Y';\nSHOW GRANTS FOR 'rolename';\n\nIf any user or role not designated by the ISSM has privileges allowing modification of \"mysql.server_audit_filters\", \"mysql.server_audit_users\", the mysql database, or audit-related global settings, this is a finding.","fixText":"Grant the necessary privileges to authorized users:\n\nMariaDB> GRANT ALL PRIVILEGES ON mysql.server_audit_filters TO 'username'@'host';\nMariaDB> GRANT ALL PRIVILEGES ON mysql.server_audit_users TO 'username'@'host';\n\nFor users found with access who are not authorized to modify audit filters, review the user's privileges and update accordingly.","ccis":["CCI-000171"]},{"vulnId":"V-286177","ruleId":"SV-286177r1292227_rule","severity":"medium","ruleTitle":"MariaDB must produce audit records containing sufficient information including time stamps, sources (origins), identity, and type to establish events that have occurred.","description":"Information system auditing capability is critical for accurate forensic analysis. Without establishing when events occurred, it is impossible to establish, correlate, and investigate the events relating to an incident.\n\nIn order to compile an accurate risk assessment and provide forensic analysis, it is essential for security personnel to know the date and time when events occurred. It is also essential for security personnel to know where events occurred, such as application components, modules, session identifiers, filenames, host names, and functionality. \n\nAssociating the date, time, and location of the 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. The application must also produce audit records that identify the application itself as the source of the event.\n \nAssociating information about where the event and source occurred within the application provides a means of investigating an attack; recognizing resource utilization or capacity thresholds; or identifying an improperly configured application.\n\nDatabase software is capable of a range of actions on data stored within the database. It is important for accurate forensic analysis, to know exactly when specific actions were performed. This requires the date and time an audit record is referring to. If date and time information is not recorded and stored with the audit record, the record itself is of very limited use.\n\nWithout information that establishes the identity of the subjects (i.e., users or processes acting on behalf of users) associated with the events, security personnel cannot determine responsibility for the potentially harmful event.\n\nIdentifiers (if authenticated or otherwise known) include, but are not limited to, user database tables, primary key values, usernames, or process identifiers.\n\nWithout information about the outcome of events, security personnel cannot make an accurate assessment as to whether an attack was successful or if changes were made to the security state of the system.\n\nEvent outcomes can include indicators of event success or failure and event-specific results (e.g., the security state of the information system after the event occurred). As such, they also provide a means to measure the impact of an event and help authorized personnel to determine the appropriate response.\n\nSatisfies: SRG-APP-000095-DB-000039, SRG-APP-000096-DB-000040, SRG-APP-000097-DB-000041, SRG-APP-000098-DB-000042, SRG-APP-000099-DB-000043, SRG-APP-000100-DB-000201","checkContent":"Verify the MariaDB Enterprise audit plugin is enabled and generating audit records containing the required audit information.\n\nVerify the audit plugin is installed and active:\n\nSHOW PLUGINS;\n\nVerify audit logging is enabled:\n\nSHOW GLOBAL VARIABLES LIKE 'server_audit_logging';\n\nReview the configured audit log output location:\n\nSHOW GLOBAL VARIABLES LIKE 'server_audit_file_path';\n\nReview sample audit log records and verify the audit logs contain the following information for audited events:\n- Timestamp.\n- Server host.\n- Username.\n- Client host.\n- Connection identifier.\n- Query identifier.\n- Operation performed.\n- Database name.\n- Object name.\n- Return code/status.\n\nExample:\ntail -n 20 /path/to/server_audit.log\n\nExample audit record content:\n20260508 10:15:42,dbserver01,admin,10.0.0.10,12345,67890,QUERY,testdb,test_table,0\n\nIf audit records do not contain the required audit event content, this is a finding.","fixText":"Configure MariaDB Enterprise Server 11.8 or higher to generate audit records containing the required audit event information.\n\nEnsure the MariaDB Enterprise Audit Plugin is installed and enabled.\n\nEdit the \"mariadb-enterprise.cnf\" configuration file located in \"/etc/my.cnf.d/\".\n\nUnder [mariadb], add/edit the following: \n\n[mariadb]\nplugin-load-add=server_audit\nserver_audit_logging=ON\nserver_audit_output_type=file\nserver_audit_file_path=/var/log/mariadb/server_audit.log\n\nRestart MariaDB if required for configuration changes to take effect:\n\nsystemctl restart mariadb","ccis":["CCI-000130","CCI-000131","CCI-000132","CCI-000133","CCI-000134","CCI-001487"]},{"vulnId":"V-286178","ruleId":"SV-286178r1291828_rule","severity":"medium","ruleTitle":"MariaDB must include additional, more detailed, organization-defined information in the audit records for audit events identified by type, location, or subject.","description":"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.\n\nThe 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 users of shared accounts, or both. The organization must maintain audit trails in sufficient detail to reconstruct events to determine the cause and impact of compromise. \n\nExamples of detailed information the organization may require in audit records are full-text recording of privileged commands or the individual identities of shared account users.","checkContent":"Review the system documentation to identify what additional information the organization has determined necessary.\n \nCheck MariaDB existing audit records to verify that all organization-defined information is in the audit records for audit events identified by operation, location, or subject.\n\nIf nothing is being logged in the audit log, this is a finding.","fixText":"Check the directory returned by the \"plugin_dir\" system variable at the filesystem level and verify that the MariaDB Enterprise audit plugin library is present. The plugin library should exist as \"server_audit.so\" (Linux/Unix) or \"server_audit.dll\" (Windows). \n\nIf the plugin library is not present in the configured plugin directory, install or upgrade MariaDB to a version that includes the MariaDB Enterprise audit plugin.","ccis":["CCI-000135"]},{"vulnId":"V-286179","ruleId":"SV-286179r1291831_rule","severity":"medium","ruleTitle":"The audit information produced by MariaDB must be protected from unauthorized read access.","description":"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.\n\nTo 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.\n\nThis 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 using file system protections and limiting log data location. \n\nAdditionally, 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.\n\nAudit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity.\n\nSatisfies: SRG-APP-000118-DB-000059, SRG-APP-000119-DB-000060, SRG-APP-000120-DB-000061","checkContent":"Connect to MariaDB using an administrative account from the operating system shell:\n\nmariadb -u root -p\n\nIdentify the audit log path and data directory:\n\nSHOW GLOBAL VARIABLES LIKE 'server_audit_file_path';\nSHOW GLOBAL VARIABLES LIKE 'datadir';\n\nIf \"server_audit_file_path\" returns a full path, use that path to locate the audit log file.\n\nIf \"server_audit_file_path\" returns only a file name, use the MariaDB data directory returned by \"datadir\" as the base directory. \n\nFor example, if \"server_audit_file_path\" is \"server_audit.log\" and \"datadir\" is \"/var/lib/mysql/\", the audit log file should be reviewed at \"/var/lib/mysql/server_audit.log\".\n\nCheck ownership and permissions on the audit log file from the operating system shell:\n\nsudo ls -al /path/to/server_audit.log\n\nIf the audit log file is not owned by the MariaDB service account/group or has permissions more permissive than 660, this is a finding.\n\nIf the MariaDB server is configured to use syslog for logging, consult the organization's syslog setting for permissions and ownership of logs.","fixText":"Set restrictive ownership and permissions on the audit log file:\n\nsudo chown mysql /path/to/server_audit.log\nsudo chmod 660 /path/to/server_audit.log\n\nIf the audit log path is not explicitly configured, configure \"server_audit_file_path\" as a full path in the MariaDB configuration file under the [mariadb] section, for example:\n\nserver_audit_file_path=/var/lib/mysql/server_audit.log\n\nRestart the MariaDB service after updating the configuration.\n\nIf configuring MariaDB server to use syslog for logging, consult the organization's syslog setting for permissions and ownership of logs.","ccis":["CCI-000162","CCI-000163","CCI-000164"]},{"vulnId":"V-286180","ruleId":"SV-286180r1292229_rule","severity":"medium","ruleTitle":"MariaDB must protect its audit features from unauthorized access.","description":"Protecting audit data also includes identifying and protecting the tools used to view and manipulate log data. \n\nDepending 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. \n\nApplications 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 access to audit tools.\n\nAudit 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. \n\nIf 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.\n\nSatisfies: SRG-APP-000121-DB-000202, SRG-APP-000122-DB-000203, SRG-APP-000123-DB-000204","checkContent":"The directory the audit logs are in the \"my.cnf\" (for CentOS, Red Hat, and similar distributions, this will be the \"/etc/my.cnf\") configuration file. By default, this file is owned by the OS DBA account. \n\nTo check that the permissions of the \"my.cnf\" are owned by the DBA (root) with permissions of \"0644\", run: \n\n$ sudo su - root\n\n$ ls -la /etc/my.cnf \n$ ls -la /etc/my.cnf.d\n\nIf \"my.cnf\" or any .cnf files located in the \"my.cnf.d\" directory are not owned by the DBA or do not have \"0644\" permissions, this is a finding. \n\nFor stderr logging, verify the directory the audit logs have the database owner (mysql) as owner and group, with \"0750\" permissions. Check the \"audit_log_dir\" file permissions as follows:\n \n$ sudo su - root\n$ ls -la  audit_log_dir /..\n\nIf permissions are not \"0750\", this is a finding. \n\nIf the owner is not the database owner mysql, this is a finding.\n\nIf the group is not the database owner mysql, this is a finding.\n\nFor syslog logging, if MariaDB is configured to use syslog, verify the logs are owned by root and have \"0600\" permissions. If not, this is a finding.","fixText":"Apply or modify access controls and permissions within MariaDB and at the operating system level for tools used to view or modify audit log data. These tools must be configurable only by authorized personnel.\n\nAs the Linux DBA (root), ensure the MariaDB configuration file is owned by the operating system DBA and has appropriate permissions:\n\nsudo su - root\nchown root:root /etc/my.cnf\nchmod 644 /etc/my.cnf\nchown root:root /etc/my.cnf.d/*.cnf\nchmod 644 /etc/my.cnf.d/*.cnf\n\nFor stderr logging, ensure the directory containing the audit logs has appropriate ownership and permissions:\n\nsudo su - root\nchown mysql:mysql audit_log_dir\nchmod 750 audit_log_dir\n\nFor syslog logging, if MariaDB is configured to send logs to syslog, review the system security configuration to ensure that syslog log files are created with appropriate ownership and permissions in accordance with organizational security requirements.","ccis":["CCI-001493","CCI-001494","CCI-001495"]},{"vulnId":"V-286181","ruleId":"SV-286181r1292138_rule","severity":"medium","ruleTitle":"MariaDB must limit privileges to change software modules, to include stored procedures, functions and triggers, and links to software external to the DBMS.","description":"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.\n \nAccordingly, only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.\n\nUnmanaged changes that occur to the database code can lead to unauthorized or compromised installations.","checkContent":"Only DEFINERS of routines (functions and procedures) can change them. To view all functions and procedures; their DEFINERS, and source, run:\n \nSELECT * from mysql.proc \\G\n \nOnly DEFINERS of triggers can change them. To view all triggers, trigger procedures, their DEFINERS, and source, run: \n\nSELECT * from information_schema.triggers \\G\n \nFind the DATADIR:\n\nSHOW GLOBAL VARIABLES LIKE 'datadir';\n(usually /var/lib/mysql/ )\n\nOnly the OS database owner user (shown here as mysql) or an OS superuser can change links to external software. As the OS DBA (shown here as root), check the permissions of configuration files for the database: \n\nExample:\n$ ls -al -R /var/lib/mysql/ \n\nIf any files are not owned by the database owner (usually mysql) or have permissions allowing others to modify (write) configuration files, this is a finding. \n\nReview monitoring procedures and implementation evidence to verify monitoring of changes to database software libraries, related applications, and configuration files is completed.\n\nVerify the list of files and directories being monitored is complete.\n\nIf monitoring does not occur or is not complete, this is a finding.","fixText":"Remove privileges from users identified as not authorized to install/uninstall MariaDB Enterprise Server plugins. \n\nInside the MariaDB database, monitoring for unauthorized changes to stored procedures or other similar objects primarily involves auditing Data Definition Language (DDL) operations. This can be achieved through MariaDB's built-in Server Audit.\n\nEdit the \"mariadb-enterprise.cnf\" configuration file located in \"/etc/my.cnf.d/\".\n\nUnder [mariadb], add/edit the following: \n\n[mariadb]\nserver_audit_events='QUERY_DDL';","ccis":["CCI-001499"]},{"vulnId":"V-286182","ruleId":"SV-286182r1291840_rule","severity":"high","ruleTitle":"The MariaDB software installation account must be restricted to authorized users.","description":"When dealing with change control issues, it should be noted that any changes to the hardware, software, and/or firmware components of the information system and/or application can have significant effects on the overall security of the system. \n\nIf 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.\n\nAccordingly, only qualified and authorized individuals must be allowed access to information system components for purposes of initiating changes, including upgrades and modifications.\n\nDBA 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.","checkContent":"Review procedures for controlling, granting access to, and tracking use of the MariaDB software installation account.\n\nIf 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.","fixText":"Develop, document, and implement procedures to restrict and track use of the MariaDB software installation account.","ccis":["CCI-001499"]},{"vulnId":"V-286183","ruleId":"SV-286183r1292181_rule","severity":"medium","ruleTitle":"Database software, including MariaDB configuration files, must be stored in dedicated directories, separate from the host OS and other applications.","description":"When dealing with change control issues, it should be noted that any changes to the hardware, software, and/or firmware components of the information system and/or application can potentially have significant effects on the overall security of the system.\n\nMultiple 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.","checkContent":"Review the MariaDB software library directory and note other root directories located on the same disk directory or any subdirectories.\n\nThe following files and directories are common MariaDB Enterprise Server 11.8 configuration, data, log, and plugin directories across supported Linux deployments:\n\n/etc/my.cnf\n/etc/my.cnf.d/\n/etc/mysql/\n/var/lib/mysql/\n/var/log/mariadb/\n/usr/lib64/mysql/plugin/\n\nIf any non-MariaDB software directories exist on the disk directory, examine or investigate their use. If any of the directories are used by other applications, including third-party applications that use MariaDB, this is a finding.\n\nOnly applications that are required for the functioning and administration, not use, of MariaDB should be located in the same disk directory as the MariaDB software libraries.\n\nIf other applications are located in the same directory as MariaDB, this is a finding.","fixText":"Install all applications on directories separate from the MariaDB software library directory. Relocate any directories or reinstall other application software that currently shares the MariaDB software library directory.","ccis":["CCI-001499"]},{"vulnId":"V-286184","ruleId":"SV-286184r1292231_rule","severity":"medium","ruleTitle":"Database objects (including but not limited to tables, indexes, storage, stored procedures, functions, triggers, links to software external to MariaDB, etc.) must be owned by database/MariaDB principals authorized for ownership.","description":"Within the database, object ownership implies full privileges to the owned object, including the privilege to assign access to the owned objects to other subjects. Database functions and procedures can be coded using definer's rights. This allows anyone who uses the object to perform the actions if they were the owner. If not properly managed, this can lead to privileged actions being taken by unauthorized individuals.\n\nConversely, if critical tables or other objects rely on unauthorized owner accounts, these objects may be lost when an account is removed.","checkContent":"Review system documentation to identify accounts authorized to have privileges against database objects. Review accounts privileges on objects in the database(s).\n \nShow the list of system privileges that the MariaDB server supports:\n\nSHOW PRIVILEGES;\n\nRun this database query to create the \"SHOW GRANTS\" script for each user: \n\nSELECT DISTINCT CONCAT( 'SHOW GRANTS FOR ', user,'@', host,';') AS grantQuery FROM mysql.user WHERE is_role = 'N';\n\nExample output:\n+----------------------------------------+\n| grantQuery                             |\n+----------------------------------------+\n| SHOW GRANTS FOR mariadb.sys@localhost; |\n| SHOW GRANTS FOR root@localhost;        |\n\nRun each \"SHOW GRANTS\" command for each user.\n\nVerify that all users have the correct privileges. If they do not, this is a finding. \n\nOnly DEFINERS of routines (functions and procedures) can change routines. To view the DEFINERS of all functions and procedures as DBA, run:\n \nSELECT * from mysql.proc \\G\n \nOnly DEFINERS of triggers can change triggers. To view all triggers and their DEFINERS as DBA, run: \n\nSELECT * from information_schema.triggers \\G\n \nIf any database users are found to have unauthorized privileges on database objects, this is a finding.","fixText":"Assign ownership of authorized objects to authorized object owner accounts.","ccis":["CCI-001499"]},{"vulnId":"V-286185","ruleId":"SV-286185r1292234_rule","severity":"medium","ruleTitle":"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 MariaDB, etc.) must be restricted to authorized users.","description":"If the MariaDB 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.\n\nAccordingly, only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.\n\nUnmanaged changes that occur to the database software libraries or configuration can lead to unauthorized or compromised installations.","checkContent":"As the DBA (root), list all roles and their permissions. \n\nRun this database query to create the \"SHOW GRANTS\" script for each role: \n\nSELECT DISTINCT CONCAT( 'SHOW GRANTS FOR ', user,'@', host,';') AS grantQuery FROM mysql.user WHERE is_role = 'Y';\n\nExample output:\n+----------------------------------------+\n| grantQuery                             |\n+----------------------------------------+\n| SHOW GRANTS FOR admin@; |\n| SHOW GRANTS FOR app_writer@;        |\n\nRun each \"SHOW GRANTS\" command for each role.\n\nSELECT * FROM information_schema.APPLICABLE_ROLES;\n\nVerify that all roles have the correct privileges. If they do not, this is a finding.","fixText":"As the DBA, revoke any permissions from a role that are deemed unnecessary by running the following SQL:\n\nREVOKE privilege_type ON database_name.table_name FROM 'username'@'host';\n\nRevoke any roles from a user if they are deemed unnecessary by running the following SQL:\n\nREVOKE  ROLE_NAME  FROM  test_user ;\n\nIf the revoked role is the default role for the user, the \"REVOKE\" command should be followed by a command to set a new default role that has appropriate permissions, or no default role:\n\nSET DEFAULT ROLE NONE FOR  test_user ;\nSET DEFAULT ROLE  ROLE_NAME  for  test_user ;","ccis":["CCI-001499"]},{"vulnId":"V-286186","ruleId":"SV-286186r1291852_rule","severity":"medium","ruleTitle":"Default demonstration and sample databases, database objects, and applications must be removed.","description":"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).\n\nIt 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.\n\nDBMSs must adhere to the principles of least functionality by providing only essential capabilities.\n\nDemonstration 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.","checkContent":"As the DBA (shown here as root) run:\n\nmariadb -u root -p\n\nList all databases present on the server:\n\nSHOW DATABASES;\n\nReview the output and verify that default demonstration or sample databases are not present. Examples of databases that should not exist in a production environment include:\n\ntest\nsample\ndemo\n\nIf any demonstration or sample databases are present and not required by the organization, this is a finding.\n\nReview the contents of remaining databases for demonstration or sample objects:\n\nSELECT TABLE_SCHEMA, TABLE_NAME\nFROM information_schema.tables\nWHERE TABLE_SCHEMA NOT IN ('mysql','information_schema','performance_schema','sys');\n\nVerify that no demonstration or sample tables, procedures, or objects remain. \n\nIf demonstration or sample objects are identified and not required by the organization, this is a finding.\n\nVerify that the default test database is not accessible to unauthorized users:\n\nSELECT host, db, user\nFROM mysql.db\nWHERE db='test';\n\nIf the test database exists or privileges are granted for it, this is a finding.\n\nVerify that no demonstration applications or example schemas have been installed as part of the MariaDB deployment or application stack. If such applications or schemas are present and not required for operational use, this is a finding.","fixText":"Secure the installation of the MariaDB server by executing the \"mysql_secure_installation\" script. This script prompts for configuration of the MariaDB root user password, removal of anonymous users, disabling remote root login, removal of the test database and its access privileges, and reloading of the privilege tables.\n\n$ mysql_secure_installation\n\nReply \"Y\" when prompted to set a root password if one is not already configured.\nReply \"Y\" when prompted to remove anonymous users.\nReply \"Y\" when prompted to disallow root login remotely.\nReply \"Y\" when prompted to remove the test database and access to it.\nReply \"Y\" when prompted to reload the privilege tables. This ensures that all changes take effect immediately.\n\nNote: For this requirement, selecting \"Y\" to remove the test database and access to it satisfies the control. Selecting \"Y\" for all prompts is recommended to further secure the installation.","ccis":["CCI-000381"]},{"vulnId":"V-286187","ruleId":"SV-286187r1292183_rule","severity":"medium","ruleTitle":"Unused database components, DBMS software, and database objects must be removed.","description":"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).\n\nIt is detrimental for software products to provide, or install by default, functionality exceeding requirements or mission objectives. \n\nDBMSs must adhere to the principles of least functionality by providing only essential capabilities.\n\nSatisfies: SRG-APP-000141-DB-000091, SRG-APP-000141-DB-000092","checkContent":"Connect to MariaDB using an administrative account from the operating system shell:\n\nmariadb -u root -p\n\nAfter connecting to the MariaDB client, run:\n\nSELECT engine, GROUP_CONCAT(DISTINCT TABLE_SCHEMA) Table_Schema_List, COUNT(*)\nFROM information_schema.tables\nGROUP BY engine;\n\nReview the output to determine which storage engines are in use.\n\nReview the installed plugins:\n\nSHOW PLUGINS;\n\nIf unauthorized or unnecessary storage engines or plugins are enabled, this is a finding.","fixText":"Update the MariaDB configuration file under the [mariadb] section to disable unused storage engines.\n\nExample:\n\ndisabled_storage_engines=\"MyISAM,BLACKHOLE,FEDERATED,ARCHIVE\"\n\nRestart the MariaDB service after modifying the configuration file.\n\nTo uninstall unnecessary plugins, first connect to MariaDB:\n\nmariadb -u root -p\n\nThen run:\n\nUNINSTALL PLUGIN IF EXISTS plugin_name;\nor\nUNINSTALL SONAME IF EXISTS 'plugin_library';\n\nExample:\n\nUNINSTALL SONAME IF EXISTS 'ha_example';","ccis":["CCI-000381"]},{"vulnId":"V-286188","ruleId":"SV-286188r1292185_rule","severity":"medium","ruleTitle":"Access to external executables must be disabled or restricted.","description":"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). \n\nIt is detrimental for applications to provide or install by default functionality exceeding requirements or mission objectives. \n\nApplications must adhere to the principles of least functionality by providing only essential capabilities.\n\nMariaDB may spawn additional external processes to execute procedures that are defined in MariaDB but stored in external host files (external procedures). The spawned process used to execute the external procedure may operate within a different OS security context than MariaDB and provide unauthorized access to the host system.","checkContent":"Log in to the MariaDB Enterprise Server as a database administrator.\n\nVerify whether the \"local_infile\" option is enabled:\n\nSHOW GLOBAL VARIABLES LIKE 'local_infile';\n\nIf \"local_infile\" is enabled (ON), review all database accounts and their assigned privileges to ensure only authorized users have the ability to perform file operations.\n\nList all database accounts:\n\nSELECT USER, HOST\nFROM mysql.global_priv;\n\nExecute the following for each account returned:\n\nSHOW GRANTS FOR 'user'@'host';\n\nReplace user and host with the values returned from the previous query.\n\nReview each grant for the presence of:\n\nFILE\nGRANT OPTION\n\nReview the grants assigned to each role using:\n\nSHOW GRANTS FOR role_name;\n\nReview the output to determine whether the FILE privilege or the ability to grant that privilege has been assigned only to authorized users or roles.\n\nIf local_infile is enabled and any unauthorized user or role possesses the FILE privilege or GRANT OPTION, this is a finding.","fixText":"To disable LOAD DATA LOCAL INFILE, run the following command as the database administrator (shown here as root). \n\nDisable local_infile for the running server:\n\nSET GLOBAL local_infile = OFF;\n\nConfigure the server startup option to make the change persistent across server restarts:\n\n[mariadb]\nlocal_infile=OFF\n\nRestart the MariaDB Enterprise server, if required, for the configuration change to take effect.\n\nIf local_infile must remain enabled to support operational requirements, then ensure only authorized users have the FILE privilege.\n\nReview database accounts:\n\nSELECT USER, HOST\nFROM mysql.global_priv;\n\nReview the assigned privileges for each account returned:\n\nSHOW GRANTS FOR 'user'@'host';\n\nIf an unauthorized account has the FILE privilege, revoke it:\n\nREVOKE FILE ON *.* FROM 'user'@'host';\n\nIf an unauthorized account has the GRANT OPTION privilege, revoke the unauthorized privilege or revoke the privileges that include GRANT OPTION.\n\nReview the privileges assigned to each role:\n\nSHOW GRANTS FOR role_name;\n\nRevoke the FILE privilege from any role that is not authorized to perform file operations.\n\nVerify the following after making the changes:\n\nSHOW GLOBAL VARIABLES LIKE 'local_infile';\n\nReturns only authorized users or roles retain the FILE privilege.","ccis":["CCI-000381"]},{"vulnId":"V-286189","ruleId":"SV-286189r1291861_rule","severity":"medium","ruleTitle":"MariaDB must be configured to prohibit or restrict the use of organization-defined functions, ports, protocols, and/or services, as defined in the Ports, Protocols, and Services Management (PPSM) Category Assurance List (CAL) and vulnerability assessments.","description":"In order 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.\n\nApplications 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. \n\nTo 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.\n\nDatabase Management Systems 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.\n\nSatisfies: SRG-APP-000142-DB-000094, SRG-APP-000383-DB-000364","checkContent":"To view the currently defined, port, as the DBA (root), run:\n\nSHOW GLOBAL VARIABLES like 'port' ;\n \nIf the currently defined port is deemed prohibited, this is a finding.","fixText":"Modify the MariaDB configuration file located within \"/etc/my.cnf.d/\" and update to an acceptable variable port.\n\nExample: \n[server]\nport = 3306\n\nRestart MariaDB Enterprise Server.","ccis":["CCI-000382","CCI-001762"]},{"vulnId":"V-286190","ruleId":"SV-286190r1291864_rule","severity":"medium","ruleTitle":"MariaDB must uniquely identify and authenticate organizational users (or processes acting on behalf of organizational users).","description":"To ensure accountability and prevent unauthenticated access, organizational users must be identified and authenticated to prevent potential misuse and compromise of the system. \n\nOrganizational 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:\n\n(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 \n(ii) Accesses that occur through authorized use of group authenticators without individual authentication. Organizations may require unique identification of individuals using shared accounts, for detailed accountability of individual activity.","checkContent":"Connect to MariaDB using an administrative account from the operating system shell:\n\nmariadb -u root -p\n\nAfter connecting to the MariaDB client, run:\n\nSELECT user, host FROM mysql.user WHERE is_role='Y';\n\nIf the query returns any unauthorized roles, this is a finding.","fixText":"Configure MariaDB settings to uniquely identify and authenticate all organizational users who log on/connect to the system.\n\nTo create roles, run:\n\nCREATE ROLE app_read_role [options];","ccis":["CCI-000764"]},{"vulnId":"V-286191","ruleId":"SV-286191r1292236_rule","severity":"high","ruleTitle":"If DBMS authentication, using passwords, is employed, MariaDB must enforce the DoW standards for password complexity and lifetime.","description":"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.\n\nThe DoW standard for authentication is DoW-approved PKI certificates. Authentication based on user ID and password may be used only when it is not possible to employ a PKI certificate, and requires AO approval.\n\nIn such cases, the DoW standards for password complexity and lifetime must be implemented. MariaDB 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.\n\nSatisfies: SRG-APP-000164-DB-000401, SRG-APP-000860-DB-000250","checkContent":"Check the \"simple_password_check\" plugin variables to ensure they match the password requirements. \n\nSHOW VARIABLES LIKE 'simple_password_check%';\n\nExample output:\n+-----------------------------------------+-------+\n| Variable_name                           | Value |\n+-----------------------------------------+-------+\n| simple_password_check_digits            | 1     |\n| simple_password_check_letters_same_case | 1     |\n| simple_password_check_minimal_length    | 8     |\n| simple_password_check_other_characters  | 1     |\n+-----------------------------------------+-------+\n\nDetermine whether the following rules are enforced. If they do not meet the following password requirements, this is a finding. \n\nA minimum of 15 characters, including at least one of each of the following character sets:\n- Uppercase.\n- Lowercase.\n- Numeric.\n- Special characters (e.g., ~ ! @ # $ % ^ & * ( ) _ + = - ' [ ] / ? > <).","fixText":"Install the \"simple_password_check\" plugin and configure to meet DoW complexity standards.\n\nFrom the operating system shell, run:\n\nmariadb -u root -p\n\nInstall the password validation plugin:\n\nINSTALL SONAME 'simple_password_check';\n\nVerify the plugin is installed:\n\nSHOW PLUGINS;\n\nVerify password validation settings:\n\nSHOW VARIABLES LIKE 'simple_password_check%';\n\nExample configuration settings may also be added to the MariaDB configuration file under the [mariadb] section:\n\nsimple_password_check=FORCE_PLUS_PERMANENT\nsimple_password_check_minimal_length=15\nsimple_password_check_digits=1\nsimple_password_check_letters_same_case=1\nsimple_password_check_other_characters=1\n\nAfter updating the configuration file, restart the MariaDB service.","ccis":["CCI-004066","CCI-004064"]},{"vulnId":"V-286192","ruleId":"SV-286192r1292187_rule","severity":"high","ruleTitle":"If passwords are used for authentication, MariaDB must transmit only encrypted representations of passwords.","description":"The DoW standard for authentication is DoW-approved PKI certificates.\n\nAuthentication 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.\n\nIn such cases, passwords need to be protected at all times, and encryption is the standard method for protecting passwords during transmission.\n\nDBMS 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.","checkContent":"Verify SSL is in use. \n\nRun the following database command: \n\nMariaDB> STATUS; \n\nVerify the line which starts with \"SSL:\" is as expected. It should return \"cert is OK\".\n\nIf the line returned is \"Not in use\", this is a finding.\n\nUse results of next query to show SSL on for all users:\n\nSELECT user,  host, ssl_type from mysql.user;\n\nIf \"ssl_type\" is blank, this is a finding.\n\nVerify Transport Layer Security (TLS) configuration:\n\nSHOW VARIABLES LIKE 'tls_version';\n\nThe \"tls_version\" variable should show TLSv1.2,TLSv1.3. If not, this is a finding. \n\nSHOW VARIABLES LIKE 'have_ssl';\n\nThe \"have_ssl\" variable should return \"YES\". If not, this is a finding.","fixText":"Configure TLS certificates and restrict the TLS protocol versions.\n\nEdit the \"mariadb-enterprise.cnf\" configuration file located in \"/etc/my.cnf.d/\".\n\nUnder [mariadb], add/edit the following: \n\n[mariadb]\nssl-ca=/etc/my.cnf.d/certs/ca-cert.pem\nssl-cert=/etc/my.cnf.d/certs/server-cert.pem\nssl-key=/etc/my.cnf.d/certs/server-key.pem\ntls_version=TLSv1.2,TLSv1.3\n\nThis configuration enables TLS encryption and restricts connections to TLS 1.2 and TLS 1.3.\n\nRestart the MariaDB server for the configuration changes to take effect:\n\nsystemctl restart mariadb\n\nEnforce encrypted client connections for database users where required by policy:\n\nALTER USER 'username'@'host' REQUIRE SSL;\n\nor, if client certificates are required:\n\nALTER USER 'username'@'host' REQUIRE X509;","ccis":["CCI-000197"]},{"vulnId":"V-286193","ruleId":"SV-286193r1294918_rule","severity":"medium","ruleTitle":"MariaDB, when using PKI-based authentication, must validate certificates by performing RFC 5280-compliant certification path validation.","description":"The DoW standard for authentication is DoW-approved PKI certificates.\n\nA 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.\n\nDatabase 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.","checkContent":"Verify SSL is in use using the following database command: \n\nMariaDB> STATUS; \n\nVerify the line which starts with \"SSL:\" is as expected. It should return \"cert is OK\".\n\nIf the line returned is \"Not in use\", this is a finding.\n\nIf SSL is in use, use the following query to verify the ssl_crlpath:\n\nSHOW GLOBAL VARIABLES LIKE  %ssl% ;\n\nIf \"ssl_crlpath\" is blank, this is a finding.","fixText":"Configure TLS certificates and restrict the TLS protocol versions.\n\nEdit the \"mariadb-enterprise.cnf\" configuration file located in \"/etc/my.cnf.d/\".\n\nUnder [mariadb], add/edit the following: \n\n[mariadb]\nssl-ca=/etc/my.cnf.d/certs/ca-cert.pem\nssl-cert=/etc/my.cnf.d/certs/server-cert.pem\nssl-key=/etc/my.cnf.d/certs/server-key.pem\ntls_version=TLSv1.2,TLSv1.3\n\nThis configuration enables TLS encryption and restricts connections to TLS 1.2 and TLS 1.3.\n\nRestart the MariaDB server for the configuration changes to take effect:\n\nsystemctl restart mariadb","ccis":["CCI-000185"]},{"vulnId":"V-286194","ruleId":"SV-286194r1294920_rule","severity":"high","ruleTitle":"MariaDB must enforce authorized access to all PKI private keys stored/used by the DBMS.","description":"The DoW standard for authentication is DoW-approved PKI certificates. PKI certificate-based authentication is performed by requiring the certificate holder to cryptographically prove possession of the corresponding private key.\n\nIf the private key is stolen, an attacker can use the private key(s) to impersonate the certificate holder. In cases where the MariaDB-stored private keys are used to authenticate MariaDB 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 MariaDB system and its clients.\n\nBoth the holder of a digital certificate and the issuing authority must take careful measures to protect the corresponding private key. Private keys should always be generated and protected in FIPS 140-3-validated cryptographic modules.\n\nAll access to the private key(s) of MariaDB must be restricted to authorized and authenticated users. If unauthorized users have access to one or more of the MariaDB 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.","checkContent":"As the DBA (root), verify the following settings: \n\nSHOW GLOBAL VARIABLES LIKE 'ssl_ca';\nSHOW GLOBAL VARIABLES LIKE 'ssl_cert';\nSHOW GLOBAL VARIABLES LIKE 'ssl_key';\n\nExample location:\n/etc/my.cnf.d/certs/\n\nls -l /etc/my.cnf.d/certs/\n \nIf the \"owner:group\" is not the database owner (mysql:mysql), this is a finding.\n\nIf permissions are not \"600\", this is a finding.","fixText":"Ensure the TLS private key file permissions restrict access to authorized users only.\n\nExample:\nchown mysql:mysql /etc/my.cnf.d/certs/server-key.pem\nchmod 600 /etc/my.cnf.d/certs/server-key.pem","ccis":["CCI-000186"]},{"vulnId":"V-286195","ruleId":"SV-286195r1292144_rule","severity":"medium","ruleTitle":"MariaDB must map a PKI ID to an associated user account.","description":"The DoW standard for authentication is DoW-approved PKI certificates. Once a PKI is validated, it is mapped to the DBMS user account for the authentication identity and then can be used for authorization decisions.","checkContent":"Query all users to confirm the issuer and subject are configured correctly: \n\nMariaDB>SELECT user, host, ssl_type, CAST(x509_issuer AS CHAR) AS issuer, CAST(x509_subject AS CHAR) AS subject FROM mysql.user;\n\nIf users are not mapped correctly, this is a finding.","fixText":"Sample command to create users with proper X509 certificate subject and issuer: \n\nMariaDB>CREATE USER 'janedoe'@'%' IDENTIFIED BY 'Some_Password_Here_$9'\nREQUIRE SUBJECT '/C=US/ST=Ohio/L=Columbus/O=MariaDB Corporation/CN=Jane Doe'\nAND ISSUER '/C=US/ST=Ohio/L=Columbus/O=MariaDB Corporation/CN=MariaDB CA';","ccis":["CCI-000187"]},{"vulnId":"V-286196","ruleId":"SV-286196r1292188_rule","severity":"high","ruleTitle":"MariaDB must obscure feedback of authentication information during the authentication process to protect the information from possible exploitation/use by unauthorized individuals.","description":"The DoW standard for authentication is DoW-approved PKI certificates.\n\nNormally with PKI authentication, the interaction with the user for authentication will be handled by a software component separate from the DBMS, such as ActivIdentity ActivClient. However, in cases where the DBMS controls the interaction, this requirement applies.\n\nTo 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. \n\nObfuscation of user-provided authentication secrets when typed into the system is a method used in addressing this risk. \n\nDisplaying asterisks when a user types in a password or a smart card PIN is an example of obscuring feedback of authentication secrets.\n\nThis calls for review of applications, which will require collaboration with the application developers. It is recognized that in many cases, the DBA is organizationally separate from the application developers, and may have limited, if any, access to source code. 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.","checkContent":"Verify best practices are documented and users trained to use the password command line interface flags appropriately. \n\nFor example, the command line option \"--password\" or \"-p\" prompts for a password to be entered and obscures feedback on the typed in password. \n\nEnsure users are trained to use alternatives to command line password parameters. If they are not, this is a finding.","fixText":"Enable external users' authentication by using the PAM plugin.\n\nIntegrate MariaDB security with an organization-level authentication/access mechanism providing account management for all users, groups, roles, and any other principals.\n\nAs the DBA (root), install and configure the PAM authentication module:\n\nINSTALL SONAME  auth_pam \n\nPAM supports many authentication methods including LDAP, Active Directory, and Kerberos. Each method must be configured properly in \"/etc/pam.d\" and \"/etc/pam.conf\". \n\nWhen connecting to the database, the username and password are sent to the server via the command line interface or other connector interface. Using the command line interface, passing the \"-p\" or \"--password\" flags but not including the password in the command will prompt for the password and not display it on the screen as typed. \n\nExample: \nmariadb -u username -proved \n\nEither transfer this to management by an external mechanism or document the need for it and obtain approval.\n\nALTER USER username@host IDENTIFIED VIA pam USING  method \n\nIf global variables \"have_openssl\" and \"version_ssl_library\" are not set correctly, then download a new MariaDB binary from mariadb.com and reinstall.","ccis":["CCI-000206"]},{"vulnId":"V-286197","ruleId":"SV-286197r1294923_rule","severity":"high","ruleTitle":"MariaDB must use NIST FIPS 140-3-validated cryptographic modules for cryptographic operations.","description":"Use of weak or not validated cryptographic algorithms undermines the purposes of using 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 DBMS.\n\nApplications, including DBMSs, using cryptography are required to use approved NIST FIPS 140-3-validated cryptographic modules that meet the requirements of applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance.\n\nThe security functions validated as part of FIPS 140-3 for cryptographic modules are described in FIPS 140-3 Annex A.\n\nNSA Type-X (where X=1, 2, 3, 4) products are NSA-certified, hardware-based encryption modules.\n\nSatisfies: SRG-APP-000179-DB-000114, SRG-APP-000514-DB-000381, SRG-APP-000514-DB-000382, SRG-APP-000514-DB-000383","checkContent":"MariaDB relies on the underlying OS for FIPS compliance. Verify FIPS is enabled for the OS. Following are example Linux commands:\n\n# sysctl crypto.fips_enabled\ncrypto.fips_enabled = 1\n \nIf crypto.fips_enabled = 0, this is a finding. \n\nOR\n\n$ sudo fips-mode-setup --check\nFIPS mode is enabled.\n\nIf FIPS mode is not enabled, this is a finding.\n\nVerify the server is using OpenSSL:\n\nMariaDB> SHOW GLOBAL VARIABLES LIKE '%have_openssl';\n\nIf the value of \"have_openssl\" is not \"YES\", this is a finding.\n\nMariaDB> SHOW GLOBAL VARIABLES LIKE '%version_ssl_library%';\n\nNote: FIPS-compliant libraries for OpenSSL 1.x.x contain \"fips\" in the version.\n\nIf the value of \"version_ssl_library\" is not FIPS compliant, this is a finding.\n\nIf using OpenSSL 3.x , check the providers: \n\nopenssl list -providers\n\nProviders:\ndefault\nname: OpenSSL Default Provider\nversion: 3.2.2\nstatus: active\n\nfips\n    name: Red Hat Enterprise Linux 9 - OpenSSL FIPS Provider\n    version: 3.2.2-622cc79c634cbbef\n    status: active\n\nIf the response does not list a FIPS provider with a status of \"active\", this is a finding.","fixText":"Configure OpenSSL to meet FIPS compliance following Red Hat documentation.","ccis":["CCI-000803","CCI-002450"]},{"vulnId":"V-286198","ruleId":"SV-286198r1291888_rule","severity":"medium","ruleTitle":"The MariaDB must uniquely identify and authenticate nonorganizational users (or processes acting on behalf of nonorganizational users).","description":"Nonorganizational users include all information system users other than organizational users, which include organizational employees or individuals the organization deems to have equivalent status of employees (e.g., contractors, guest researchers, individuals from allied nations). \n\nNonorganizational users must 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. \n\nAccordingly, a risk assessment is used in determining the authentication needs of the organization. \n\nScalability, 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.\n\nSatisfies: SRG-APP-000180-DB-000115, SRG-APP-000815-DB-000160","checkContent":"Query all users and determine if any are suspected shared accounts. Document any necessary shared accounts. \n\nMariaDB> SELECT user, host FROM mysql.user; \n\nDetermine 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 MariaDB. \n\nAn example of a shared account is the MariaDB root account \"root@localhost\".\n\nIf accounts are determined to be shared, determine if individuals are first individually authenticated. \n\nIf 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. \n\nIf accounts are determined to be shared, determine if they are directly accessible to end users. If so, this is a finding.\n\nIf shared identifiers are found, and not accompanied by individual identifiers, this is a finding.","fixText":"Configure MariaDB Enterprise to require individual user authentication and prohibit direct use of shared accounts.\n\nEnsure all users are assigned unique database accounts:\n\nSELECT User, Host FROM mysql.user;\n\nRemove or disable shared or generic accounts:\n\nDROP USER '<shared_user>'@'<host>';\n\nConfigure authentication to require individual credentials for each user:\n\nALTER USER '<username>'@'<host>' IDENTIFIED BY '<strong_password>';\n\nEnsure anonymous accounts are removed:\n\nDELETE FROM mysql.user WHERE User='';\nFLUSH PRIVILEGES;\n\nConfigure access to shared resources through role-based access control rather than shared credentials:\n\nCREATE ROLE '<role_name>';\nGRANT <privileges> ON <database>.* TO '<role_name>';\nGRANT '<role_name>' TO '<username>'@'<host>';\nSET DEFAULT ROLE '<role_name>' TO '<username>'@'<host>';\n\nConfigure the system to prohibit credential sharing and require users to authenticate with their individually assigned accounts prior to accessing shared databases or resources.","ccis":["CCI-000804","CCI-004045"]},{"vulnId":"V-286199","ruleId":"SV-286199r1292241_rule","severity":"medium","ruleTitle":"MariaDB must separate user functionality (including user interface services) from database management functionality.","description":"Information system management functionality includes functions necessary to administer databases, network components, workstations, or servers and typically requires privileged user access. \n\nThe 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. \n\nAn 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. \n\nThis may include isolating the administrative interface on a different domain and with additional access controls.\n\nIf administrative functionality or information regarding MariaDB management is presented on an interface available for users, information on MariaDB settings may be inadvertently made available to the user.","checkContent":"Check MariaDB settings to verify that administrative functionality is separate from user functionality.\n \nLoop over all the MariaDB users and SHOW GRANTS for each using the command below.  \n\nRun this database query to create the \"SHOW GRANTS\" script for each user: \n\nSELECT DISTINCT CONCAT( 'SHOW GRANTS FOR ', user,'@', host,';') AS grantQuery FROM mysql.user WHERE is_role = 'N';\n\nExample output:\n+----------------------------------------+\n| grantQuery                             |\n+----------------------------------------+\n| SHOW GRANTS FOR mariadb.sys@localhost; |\n| SHOW GRANTS FOR root@localhost;        |\n\nRun each \"SHOW GRANTS\" command for each user.\n\nIf any nonadministrative role has any one of the following privileges, this is a finding. \n\n- Create user.\n- Event.\n- Process.\n- Proxy.\n- Reload.\n- Replication client.\n- Replication slave.\n- Show databases.\n- Shutdown.\n- Super.\n- Usage.\n\nIf administrator and general user functionality are not separated either physically or logically, this is a finding.","fixText":"Configure to separate database administration and general user functionality.\n\nDo not grant the following privileges to users and roles that do not require it:\n\n- Create user.\n- Event.\n- Process.\n- Proxy.\n- Reload.\n- Replication client.\n- Replication slave.\n- Show databases.\n- Shutdown.\n- Super.\n- Create tablespace.\n- Usage.\n\nRevoke privileges from a specific user: \n\nREVOKE SUPER, PROCESS ON *.* FROM   user  @ localhost ;\n\nRevoke privileges from a role:\n\nREVOKE  role  FROM  grantee  [,  grantee2  ... ]","ccis":["CCI-001082"]},{"vulnId":"V-286200","ruleId":"SV-286200r1292147_rule","severity":"medium","ruleTitle":"MariaDB must invalidate session identifiers upon user logout or other session termination.","description":"Captured sessions can be reused in replay attacks. This requirement limits the ability of adversaries to capture and continue to employ previously valid session IDs.\n\nThis requirement focuses on communications protection for the MariaDB session rather than for the network packet. The intent of this control is to establish grounds for confidence at each end of a communications session in the ongoing identity of the other party and in the validity of the information being transmitted. \n\nSession IDs are tokens generated by MariaDB to uniquely identify a user's (or process's) session. MariaDB will make access decisions and execute logic based on the session ID.\n\nUnique session IDs help to reduce predictability of said identifiers. Unique session IDs address man-in-the-middle attacks, including session hijacking or insertion of false information into a session. If the attacker is unable to identify or guess the session information related to pending application traffic, they will have more difficulty in hijacking the session or otherwise manipulating valid sessions. \n\nWhen a user logs out, or when any other session termination event occurs, the DBMS must terminate the user session(s) to minimize the potential for sessions to be hijacked.","checkContent":"As the DBA (root), run:\n \nSHOW GLOBAL VARIABLES LIKE 'tcp_keepalive_interval';\nSHOW GLOBAL VARIABLES LIKE 'tcp_keepalive_probes';\nSHOW GLOBAL VARIABLES LIKE 'tcp_keepalive_time';\nSHOW GLOBAL VARIABLES LIKE 'tcp_nodelay';\nSHOW GLOBAL VARIABLES LIKE 'max_statement_time';\n \nIf these settings are not configured, this is a finding.","fixText":"As the administrator, locate the .cnf file to change. \n\nEdit the \"mariadb-enterprise.cnf\" configuration file located in \"/etc/my.cnf.d/\".\n\nIn the [mariadb] section, add the lines:\n\ntcp_keepalive_interval =number of seconds\ntcp_keepalive_probes =number of probes\ntcp_keepalive_time = number of seconds\ntcp_nodelay =boolean (1 or 0)\nmax_statement_time = number of seconds\n \nRestart MariaDB if required for configuration changes to take effect:\n\nsystemctl restart mariadb\n\nMore information on global system variables can be found at https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables.","ccis":["CCI-001185"]},{"vulnId":"V-286201","ruleId":"SV-286201r1291897_rule","severity":"medium","ruleTitle":"MariaDB must maintain the authenticity of communications sessions by guarding against man-in-the-middle attacks that guess at session ID values.","description":"Unique session IDs help to reduce predictability of said identifiers. Unique session IDs address man-in-the-middle attacks, including session hijacking or insertion of false information into a session. If the attacker is unable to identify or guess the session information related to pending application traffic, they will have more difficulty in hijacking the session or otherwise manipulating valid sessions. \n\nWhen a user logs out, or when any other session termination event occurs, the DBMS must terminate the user session(s) to minimize the potential for sessions to be hijacked.","checkContent":"Determine if MariaDB is configured to require SSL.\n\nMariaDB> SHOW GLOBAL VARIABLES LIKE 'require_secure_transport';\n\nIf \"require_secure_transport\" is not \"ON\", this is a finding.","fixText":"Modify the MariaDB configuration file located within \"/etc/my.cnf.d/\" and set the variable \"require_secure_transport\" to \"ON\" under the server section. \n\nRestart the MariaDB Enterprise Server. \n\nExample: \n[server]\nrequire_secure_transport = ON","ccis":["CCI-001188"]},{"vulnId":"V-286202","ruleId":"SV-286202r1291900_rule","severity":"medium","ruleTitle":"MariaDB must fail to a secure state if system initialization fails, shutdown fails, or aborts fail.","description":"Failure to a known state can address safety or security in accordance with the mission/business needs of the organization. \n\nFailure to a known secure state helps prevent a loss of confidentiality, integrity, or availability in the event of a failure of the information system or a component of the system. \n\nFailure to a known safe state helps prevent systems from failing to a state that may cause loss of data or unauthorized access to system resources. Systems that fail suddenly and with no incorporated failure state planning may leave the hosting system available but with a reduced security protection capability. Preserving information system state data also facilitates system restart and return to the operational mode of the organization with less disruption of mission/business processes. \n\nMariaDB must fail to a known consistent state. Transactions must be successfully completed or rolled back.\n\nIn general, security mechanisms should be designed so that a failure will follow the same execution path as disallowing the operation. For example, application security methods, such as isAuthorized(), isAuthenticated(), and validate(), should all return false if there is an exception during processing. If security controls can throw exceptions, they must be very clear about exactly what that condition means. \n\nAbort refers to stopping a program or function before it has finished naturally. The term abort refers to both requested and unexpected terminations.\n\nMariaDB is a fully functional ACID RDBMS with persistent storage, logs, rollback, recovery, and backup procedures. InnoDB is the default storage engine for MariaDB and all uncommitted transactions are rolled back upon restart from a failure. The process is automatic and all Incomplete transactions will be rolled back to a consistent state to guarantee consistency. Users can also conduct a recovery to a point in time if needed. \n\nSatisfies: SRG-APP-000225-DB-000153, SRG-APP-000226-DB-000147","checkContent":"Verify InnoDB logging is configured.\n\nAs the DBA (root), verify the following settings: \n \nMariaDB> SHOW GLOBAL VARIABLES LIKE 'log_bin';\n\nIf value is \"OFF\", this is a finding.","fixText":"If value of \"log_bin\" is \"OFF\", modify the MariaDB configuration file. This can be found in \"/etc/my.cnf.d/\".\n\nOptionally, specify the location of the binary logs by specifying the full path for the binary logs. Note: If no specific directory given before the filename, the files are stored in DATADIR.\n \n[mariadb]\nlog_bin=mariadb_bin\n\n#optional:\nlog_bin_basename=/var/lib/mysql/mariadb_bin","ccis":["CCI-001190","CCI-001665"]},{"vulnId":"V-286203","ruleId":"SV-286203r1292192_rule","severity":"high","ruleTitle":"MariaDB must protect the confidentiality and integrity of all information at rest.","description":"This control is intended to address the confidentiality and integrity of information at rest in nonmobile devices and covers user information and system information. Information at rest refers to the state of information when it is located on a secondary storage device (e.g., disk drive, tape drive) within an organizational information system. Applications and application users generate information throughout the course of their application use. \n\nUser-generated data and application-specific configuration data must be protected. Organizations may choose to employ different mechanisms to achieve confidentiality and integrity protections, as appropriate. \n\nIf the confidentiality and integrity of application data is not protected, the data will be open to compromise and unauthorized modification.","checkContent":"If the application owner and Authorizing Official (AO) have determined that encryption of data at rest is not required, this is not a finding.\n\nIf full-disk encryption is being used, and the DBA or system administrator (SA) can demonstrate the use of disk-level encryption, this is not a finding.\n\nOne possible way to encrypt data within MariaDB is to use the file key management plugin. To determine if this is installed, check the following variables as the DBA:\n\nSHOW PLUGINS; \n\nConfirm the \"file_key_management.so\" is listed.\n\nSHOW GLOBAL VARIABLES LIKE 'file_key%';\nSHOW GLOBAL VARIABLES LIKE 'aria_en%';\nSHOW GLOBAL VARIABLES LIKE 'innodb_encrypt_tables';\nSHOW GLOBAL VARIABLES LIKE 'innodb_encrypt_log';\nSHOW GLOBAL VARIABLES LIKE 'innodb_tablespace%';\nSHOW GLOBAL VARIABLES LIKE 'encrypt%';\n\nConfirm these are set to \"ON\".\n\nIf this is required and is not found, this is a finding. \n\nIf controls do not exist or are not enabled, this is a finding.","fixText":"MariaDB data-at-rest encryption requires the use of a key management and encryption plugin. These plugins manage encryption keys and perform the encryption and decryption of data.\n\nMariaDB supports the use of multiple encryption keys. Each encryption key uses a 32-bit integer as a key identifier. If the selected plugin supports key rotation, encryption keys may also be rotated, creating a new version of the encryption key.\n\nThe File Key Management plugin included with MariaDB is a key management and encryption plugin that reads encryption keys from a plain-text file. Although the plugin’s shared library is distributed with MariaDB by default, the plugin is not installed by default. The plugin can be installed by specifying the \"--plugin-load\" or \"--plugin-load-add\" options. This may be provided as a command-line argument to \"mysqld\" or specified in a server option group in a configuration file. For example:\n\n[mariadb]\nplugin_load_add = file_key_management\n\nTo encrypt tables using the File Key Management plugin, create a file containing the encryption keys. The file must contain two pieces of information for each encryption key:\n- A 32-bit integer used as the encryption key identifier.\n- The encryption key provided in hex-encoded form.\n\nThese values must be separated by a semicolon. The file format should appear as follows:\n\n<encryption_key_id1>;<hex-encoded_encryption_key1>\n<encryption_key_id2>;<hex-encoded_encryption_key2>\n\nThe key file may optionally be encrypted to reduce accessibility from the file system.\n\nThe File Key Management plugin uses the Advanced Encryption Standard (AES) algorithm and supports 128-bit, 192-bit, and 256-bit encryption keys.\n\nRandom encryption keys can be generated using the \"openssl rand\" command. For example, to generate a random 256-bit (32-byte) encryption key:\n\n$ openssl rand -hex 32\na7addd9adea9978fda19f21e6be987880e68ac92632ca052e5bb42b1a506939a\n\nEncryption keys can be appended to the key file. For example:\n\n$ sudo openssl rand -hex 32 >> /etc/mysql/encryption/keyfile\n$ sudo openssl rand -hex 32 >> /etc/mysql/encryption/keyfile\n$ sudo openssl rand -hex 32 >> /etc/mysql/encryption/keyfile\n\nAfter generating keys, the key file may appear as follows:\n\na7addd9adea9978fda19f21e6be987880e68ac92632ca052e5bb42b1a506939a\n49c16acc2dffe616710c9ba9a10b94944a737de1beccb52dc1560abfdd67388b\n8db1ee74580e7e93ab8cf157f02656d356c2f437d548d5bf16bf2a56932954a3\n\nEach encryption key must include a key identifier at the beginning of the line. Key identifiers do not need to be contiguous. After adding identifiers, the key file may appear as follows:\n\n1;a7addd9adea9978fda19f21e6be987880e68ac92632ca052e5bb42b1a506939a\n2;49c16acc2dffe616710c9ba9a10b94944a737de1beccb52dc1560abfdd67388b\n100;8db1ee74580e7e93ab8cf157f02656d356c2f437d548d5bf16bf2a56932954a3\n\nThe key identifiers provide a method to reference encryption keys from MariaDB. For example, encryption keys may be referenced using identifiers such as 1, 2, or 100 through the \"ENCRYPTION_KEY_ID\" table option or system variables such as \"innodb_default_encryption_key_id\". The encryption key with identifier 1 is the only mandatory encryption key.\n\nOnce the File Key Management plugin is enabled, encrypted tables may be created using the following statement:\n\nCREATE TABLE t (i INT) ENGINE=InnoDB ENCRYPTED=YES;\n\nThen, the table is encrypted using the encryption key specified in the key file.","ccis":["CCI-001199"]},{"vulnId":"V-286204","ruleId":"SV-286204r1292149_rule","severity":"medium","ruleTitle":"Database contents must be protected from unauthorized and unintended information transfer by enforcement of a data transfer policy.","description":"Applications, including MariaDB, must prevent unauthorized and unintended information transfer via shared system resources. \n\nData 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.\n\nCopies of sensitive data must not be misplaced or left in a temporary location without the proper controls.\n\nSatisfies: SRG-APP-000243-DB-000128, SRG-APP-000243-DB-000373","checkContent":"Review the procedures for the refreshing of development/test data from production.\n\nReview 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.\n\nVerify that copies of production data are not left in unprotected locations. \n\nIf 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.","fixText":"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.","ccis":["CCI-001090"]},{"vulnId":"V-286205","ruleId":"SV-286205r1292195_rule","severity":"medium","ruleTitle":"Access to database files must be limited to relevant processes and to authorized, administrative users.","description":"Applications, including MariaDB, must prevent unauthorized and unintended information transfer via shared system resources. Permitting only MariaDB 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.","checkContent":"By default, all the MariaDB database files, log files, and backup files are located in the \"/var/lib/mysql\".\n\nTo find the location of the datadir, run the command:\n\nSHOW GLOBAL VARIABLES LIKE 'datadir';\n\nCheck the \"/etc/my.cnf\" file for the following variables to determine if any of these files have a nondefault location configured. Only variables that specify a directory different from datadir will be in a different directory. If the variable only specifies a file name, that file will still be in the default directory.\n\nerror_log\ninnodb_log_group_home_dir\ninnodb_temp_data_file_path\ninnodb_tmpdir\ninnodb_undo_directory\nlog_bin_basename\nlog_error\nrelay_log_basename\nrelay_log_file_info\nsql_error_log_filename\ntmpdir\n\nVerify file system permissions for database files, database log files, and database backup files to ensure they are properly restricted.\n\nTo verify file ownership and permissions, run the following commands as the DBA (root):\n\nsudo su - root\nls -lR $DATADIR\n\nIf any configuration variables specify directories outside of \"$DATADIR\", review those directories:\n\nls -lR <directory_path>\n\nIf backup tools such as \"mysqldump\" or other backup utilities are used, review the directory where backup files are stored and verify permissions using the same command.\n\nDatabase files, log files, and backup files must be owned by the DBA account and must not permit unauthorized users to read, write, or execute these files.\n\nIf any files are not owned by the DBA, or if file permissions allow access by unauthorized users, this is a finding.\n\nIf any user, role, or account other than an authorized system administrator (SA), authorized DBA, or required system service account is permitted to read or view database files, log files, or backup files, this is a finding.","fixText":"By default, all of the MariaDB database files, log files, and backup files are located in the \"/var/lib/mysql\".\n\nReview the \"/etc/my.cnf\" configuration file to determine whether any files are configured to use a nondefault directory. Only variables that explicitly define a directory different from \"$DATADIR\" will place files outside the default data directory. If the variable specifies only a file name, the file remains within \"$DATADIR\".\n\nCheck the following configuration variables:\n\nerror_log\ninnodb_log_group_home_dir\ninnodb_temp_data_file_path\ninnodb_tmpdir\ninnodb_undo_directory\nlog_bin_basename\nlog_error\nrelay_log_basename\nrelay_log_file_info\nsql_error_log_filename\ntmpdir\n\nVerify that the operating system permissions on database files, database log files, and database backup files restrict access so that only required system accounts, authorized system administrators, and DBAs with a legitimate need can read or modify them.\n\nAny files created within \"$DATADIR\", or within any alternate directory defined by the variables above, must be owned by the database owner account (typically mysql) and should have permissions limited to the owner for read, write, and execute access.","ccis":["CCI-001090"]},{"vulnId":"V-286206","ruleId":"SV-286206r1292196_rule","severity":"medium","ruleTitle":"MariaDB must check the validity of all data inputs except those specifically identified by the organization.","description":"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.\n\nWith 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.\n\nEven 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.\n\nThis calls for inspection of application source code, which will require collaboration with the application developers. It is recognized that in many cases, the 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.","checkContent":"Review MariaDB code (trigger procedures, functions), application code, settings, column and field definitions, and constraints to determine whether the database is protected against invalid input.\n\nIf code exists that allows invalid data to be acted upon or input into the database, this is a finding.\n\nIf column/field definitions do not exist in the database, this is a finding.\n\nIf columns/fields do not contain constraints and validity checking where required, this is a finding.\n\nCheck application code that interacts with MariaDB for the use of prepared statements. If prepared statements are not used, this is a finding.\n\nWhere 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.\n\nWhere 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.","fixText":"Modify database code to properly validate data before it is put into the database or acted upon by the database.\n\nModify the database to contain constraints and validity checking on database columns and tables that require them for data integrity.\n\nUse prepared statements when taking user input.\n\nDo not allow general users direct console access to MariaDB.","ccis":["CCI-001310"]},{"vulnId":"V-286207","ruleId":"SV-286207r1292152_rule","severity":"medium","ruleTitle":"MariaDB and associated applications must reserve the use of dynamic code execution for situations that require it.","description":"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.\n\nThe principal protection against code injection is not to use dynamic execution except where it provides necessary functionality that cannot be used otherwise. Use strongly typed data items rather than general-purpose strings as input parameters to task-specific, pre-compiled stored procedures and functions (and triggers).\n\nThis calls for inspection of application source code, which will require collaboration with the application developers. It is recognized that in many cases, the 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.","checkContent":"Review MariaDB source code (stored procedures, functions, triggers) and application source code, to identify cases of dynamic code execution. \n \nLog in to MariaDB as the DBA and run the following for each database: \n\nSHOW FUNCTION STATUS;\nSHOW PROCEDURE STATUS;\nSHOW TRIGGERS FROM <database_name>;\n\nAny user input should be handled through prepared statements.\n\nIf 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.","fixText":"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.","ccis":["CCI-001310"]},{"vulnId":"V-286208","ruleId":"SV-286208r1292199_rule","severity":"medium","ruleTitle":"MariaDB must reveal detailed error messages only to the information system security officer (ISSO), information system security manager (ISSM), system administrator (SA), and database administrator (DBA).","description":"If MariaDB provides too much information in error logs and administrative messages to the screen, this could lead to compromise. The structure and content of error messages need to be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements. \n\nSome default MariaDB error messages can contain information that could aid an attacker in, among other things, identifying the database type, host address, or state of the database. Custom errors may contain sensitive customer information. \n\nIt is important that detailed error messages be visible only to those who are authorized to view them; that general users receive only generalized acknowledgment that errors have occurred; and that these generalized messages appear only when relevant to the user s task. For example, a message such as \"An error has occurred. Unable to save changes. If this problem persists, contact the help desk\" would be relevant. A message such as \"Warning: the transaction generated a large number of page splits\" would likely not be relevant. \n\nAdministrative users authorized to review detailed error messages typically are the ISSO, ISSM, SA, and DBA. Other individuals or roles may be specified according to organization-specific needs, with appropriate approval.\n\nThis calls for inspection of application source code, which will require collaboration with the application developers. It is recognized that in many cases, the 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.","checkContent":"Log in to MariaDB Enterprise Server as the DBA.\n\nDetermine the location of the MariaDB error log:\n\nSHOW GLOBAL VARIABLES LIKE 'log_error';\n\nVerify that the \"log_error\" variable is configured.\n\nIf \"log_error\" is empty or disabled, this is a finding.\n\nIdentify the directory containing the log file if the returned value is an absolute path.\n\nThe log file is located in the MariaDB data directory if the returned value is only a file name.\n\nVerify the ownership and permissions of the log directory as the SA:\n\nls -ld <log_directory>\n\nVerify the ownership and permissions of the error log file:\n\nls -l <log_file>\n\nVerify the following:\n\n- The log directory is owned by mysql:mysql.\n- The log directory permissions are no more permissive than 750.\n- The error log file is owned by mysql:mysql.\n- The error log file permissions are no more permissive than 640.\n\nVerify that detailed database error messages are not exposed directly to users who are not authorized to view them.\n\nIf any of these conditions are not met, this is a finding.","fixText":"Log in as the DBA.\n\nConfigure the location of the MariaDB error log by setting the \"log_error\" server option.\n\nExample:\n\n[mariadb]\nlog_error=/var/log/mariadb/mariadb.err\n\nRestart MariaDB Enterprise Server, if required, for the configuration change to take effect.\n\nConfigure the ownership of the log directory and log file as the SA:\n\nchown mysql:mysql /var/log/mariadb\nchown mysql:mysql /var/log/mariadb/mariadb.err\n\nConfigure the directory permissions:\n\nchmod 750 /var/log/mariadb\n\nConfigure the log file permissions:\n\nchmod 640 /var/log/mariadb/mariadb.err\n\nVerify the configuration:\n\nSHOW GLOBAL VARIABLES LIKE 'log_error';\n\nVerify the error log directory and log file have the required ownership and permissions, and that detailed database error information is not disclosed to unauthorized users.","ccis":["CCI-001314"]},{"vulnId":"V-286209","ruleId":"SV-286209r1292154_rule","severity":"medium","ruleTitle":"MariaDB must automatically terminate a user session after organization-defined conditions or trigger events requiring session disconnect.","description":"This addresses the termination of user-initiated logical sessions in contrast to the termination of network connections that are 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. \n\nSession 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. \n\nConditions 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.\n\nThis capability is typically reserved for specific cases where the system owner, data owner, or organization requires additional assurance.","checkContent":"Log in to MariaDB and run as the DBA:\n\nSHOW GLOBAL VARIABLES LIKE 'interactive_timeout';\nSHOW GLOBAL VARIABLES LIKE 'wait_timeout';\n\nReview the configured timeout values.\n\nIf granular timeout controls for idle transactions are required, run:\n\nSHOW GLOBAL VARIABLES LIKE 'idle_transaction_timeout';\nSHOW GLOBAL VARIABLES LIKE 'idle_write_transaction_timeout';\nSHOW GLOBAL VARIABLES LIKE 'idle_readonly_transaction_timeout';\n\nIf idle session termination is required and the timeout values exceed the approved inactivity threshold or are disabled, this is a finding.","fixText":"Configure MariaDB to automatically terminate user sessions based on organization-defined security procedures regarding conditions or trigger events that require session termination.\n\nSession termination behavior can be controlled through timeout configuration variables. Review the current timeout configuration values using the following command:\n\nSHOW GLOBAL VARIABLES LIKE '%timeout%';\n\nThe following timeout variables may be configured to enforce automatic termination of inactive sessions or transactions:\n\ninteractive_timeout\nwait_timeout\nidle_transaction_timeout\nidle_write_transaction_timeout\nidle_readonly_transaction_timeout\n \nTo modify these values, run the appropriate command as the DBA. Locate the MariaDB Enterprise Server configuration file to change. For CentOS, Red Hat, and similar distributions, this will be in \"/etc/my.cnf.d/\".\n\nIn the [mariadb] section, add the lines:\n\ninteractive_timeout = value\nwait_timeout = value\nidle_transaction_timeout = value\nidle_write_transaction_timeout = value\nidle_readonly_transaction_timeout = value\n\nSession-specific timeout values may also be set within application code or database sessions. For example:\n\nSET SESSION idle_transaction_timeout = 2;\n\nExample test sequence:\nBEGIN;\nSELECT * FROM t;\n(wait several seconds)\nSELECT * FROM t;\n\nIf the configured timeout is exceeded, the session will terminate and return an error indicating the connection has been closed.\n\nFor more information refer to https://mariadb.com/kb/en/library/transaction-timeouts/.","ccis":["CCI-002361"]},{"vulnId":"V-286211","ruleId":"SV-286211r1292156_rule","severity":"medium","ruleTitle":"MariaDB must associate organization-defined types of security labels having organization-defined security label values with information in process, transit, or storage.","description":"Without the association of security labels to information, there is no basis for MariaDB to make security-related access-control decisions.\n\nSecurity labels are abstractions representing the basic properties or characteristics of an entity (e.g., subjects and objects) with respect to safeguarding information. \n\nThese 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. \n\nOne example includes marking data as classified or CUI. These security labels may be assigned manually or during data processing, but, either way, it is imperative these assignments are maintained while the data is in storage. If the security labels are lost when the data is stored, there is the risk of a data compromise.\n\nThe mechanism used to support security labeling may be a feature of the DBMS product, a third-party product, or custom application code.\n\nSatisfies: SRG-APP-000311-DB-000308, SRG-APP-000313-DB-000309, SRG-APP-000314-DB-000310","checkContent":"If security labeling is not required, this is not a finding.\n\nIf security labeling requirements have been specified, but neither a third-party solution nor a MariaDB Row-Level security solution is implemented that reliably maintains labels on information, this is a finding.","fixText":"Add custom data structures, data elements, and application code to provide reliable security labeling of information in transmission.\n\nFor more information, refer to https://mariadb.com/resources/blog/protect-your-data-row-level-security-in-mariadb-10-0/.","ccis":["CCI-002262","CCI-002263","CCI-002264"]},{"vulnId":"V-286212","ruleId":"SV-286212r1292243_rule","severity":"medium","ruleTitle":"MariaDB must enforce discretionary access control (DAC) policies, as defined by the data owner, over defined subjects and objects.","description":"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 because 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.\n\nWhen DAC policies are implemented, subjects are not constrained regarding 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. \n\nA subject that is constrained in its operation by mandatory access control (MAC) policies is still able to operate under the less rigorous constraints of this requirement. Thus, while MAC imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. \n\nThe policy is bound by the information system boundary. Once the information is passed outside of the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of DAC require identity-based access control, that limitation is not required for this use of DAC.","checkContent":"Review system documentation to identify the required DAC.\n\nReview the security configuration of the database and MariaDB. If applicable, review the security configuration of the application(s) using the database.\n\nIf the DAC defined in the documentation is not implemented in the security configuration, this is a finding.\n \nTo check the permissions granted to a user use the following queries:\n \nSHOW PRIVILEGES;\n\nRun this database query to create the \"SHOW GRANTS\" script for each user: \n\nSELECT DISTINCT CONCAT( 'SHOW GRANTS FOR ', user,'@', host,';') AS grantQuery FROM mysql.user WHERE is_role = 'N';\nExample output:\n+----------------------------------------+\n| grantQuery                             |\n+----------------------------------------+\n| SHOW GRANTS FOR mariadb.sys@localhost; |\n| SHOW GRANTS FOR root@localhost;        |\n\nRun each \"SHOW GRANTS\" command for each user.\n\nVerify that all users have the correct privileges, if they do not, this is a finding. \n\nRun the following database query to create the \"SHOW GRANTS\" script for each role. Use the results to show grants on for all roles:\n\nSELECT DISTINCT CONCAT( 'SHOW GRANTS FOR ', user,'@', host,';') AS grantQuery FROM mysql.user WHERE is_role = 'Y';\nExample output:\n+----------------------------------------+\n| grantQuery                             |\n+----------------------------------------+\n| SHOW GRANTS FOR admin@; |\n| SHOW GRANTS FOR app_writer@;        |\n\nRun each \"SHOW GRANTS\" command for each role.\n\nSELECT * FROM information_schema.APPLICABLE_ROLES;\n**To find out if a role has admin_option (Whether the role can be granted by a particular user)\n SELECT * from mysql.roles_mapping;c\n\nVerify that all roles have the correct privileges, if they do not, this is a finding.","fixText":"Implement the organization's DAC policy in the security configuration of the database and DBMS, and, if applicable, the security configuration of the application(s) using the database.\n \nTo grant and revoke privileges as the DBA (root), use the following SQL syntax:\n\nTo grant user and role privileges:\n \nGRANT  privilege  ON  database . table  TO  user|role ;\n \nTo revoke user and role privileges:\n \nREVOKE  privilege_type  ON   database . table  FROM  user|role ;","ccis":["CCI-002165"]},{"vulnId":"V-286213","ruleId":"SV-286213r1291933_rule","severity":"medium","ruleTitle":"MariaDB must prevent nonprivileged users from executing privileged functions, to include disabling, circumventing, or altering implemented security safeguards/countermeasures.","description":"Preventing nonprivileged users from executing privileged functions mitigates the risk that unauthorized individuals or processes may gain unnecessary access to information or privileges. \n\nSystem documentation should include a definition of the functionality considered privileged.\n\nDepending 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 nonprivileged users.\n\nA privileged function in MariaDB/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 an SQL environment, it encompasses but is not necessarily limited to: \nCREATE\nALTER\nDROP\nGRANT\nREVOKE\n\nThere may also be Data Manipulation Language (DML) statements that, subject to context, should be regarded as privileged. Possible examples include:\n\nTRUNCATE TABLE;\nDELETE, or\nDELETE affecting more than n rows, for some n, or\nDELETE without a WHERE clause;\n\nUPDATE or\nUPDATE affecting more than n rows, for some n, or\nUPDATE without a WHERE clause;\n\nany SELECT, INSERT, UPDATE, or DELETE to an application-defined security table executed by other than a security principal.\n\nDepending 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.","checkContent":"Review the system documentation to obtain the definition of the database/MariaDB functionality considered privileged in the context of the system in question.\n\nReview the MariaDB security configuration and/or other means used to protect privileged functionality from unauthorized use.\n\nIf the configuration does not protect all of the actions defined as privileged, this is a finding.","fixText":"Configure MariaDB security to protect all privileged functionality.","ccis":["CCI-002235"]},{"vulnId":"V-286214","ruleId":"SV-286214r1292245_rule","severity":"medium","ruleTitle":"Execution of software modules (to include stored procedures, functions, and triggers) with elevated privileges must be restricted to necessary cases only.","description":"In certain situations to provide required functionality, MariaDB 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.\n\nPrivilege elevation must be used only where necessary and protected from misuse.\n\nThis calls for inspection of application source code, which will require collaboration with the application developers. It is recognized that in many cases, the 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.","checkContent":"Functions and procedures in MariaDB all have \"DEFINER\" and \"SECURITY_TYPE\" options.\n\nIf \"SECURITY_TYPE\" is equal to \"DEFINER\", then the function/procedure is run using the privileges of the \"DEFINER\" account.\n\nIf \"SECURITY_TYPE\" is equal to \"INVOKER\", then the function/procedure is run using the privileges of the user invoking the function or procedure.\n\nTo list the values of the \"DEFINER\" and \"SECURITY_TYPE\" in functions and procedures, as the DBA (shown here as root), log in to the database (mariadb -u root -p) and run:\n\nSELECT ROUTINE_NAME, ROUTINE_SCHEMA, ROUTINE_TYPE, DEFINER, SECURITY_TYPE FROM information_schema.routines;\n\nTriggers in MariaDB have a \"DEFINER\" option.\n\nFor triggers, the value of the \"DEFINER\" determines the privileges to be used at the time of trigger activation.\n\nTo list the values of the \"DEFINER\" in triggers, as the DBA (shown here as root), run the following SQL:\n\nSELECT trigger_schema, trigger_name, action_statement, definer from information_schema.triggers;\n\nIf elevation of MariaDB privileges is used but not documented, this is a finding.\n\nIf elevation of MariaDB privileges is documented but not implemented as described in the documentation, this is a finding.\n\nIf the privilege-elevation logic can be invoked in ways/contexts other than intended, or by subjects/principals other than intended, this is a finding.","fixText":"Determine where, when, how, and by which principals or subjects elevated privileges are required.\n\nMariaDB functions and stored procedures support the \"SQL SECURITY\" attribute, which determines whether a routine executes using the privileges of the invoker or the definer.\n\nTo modify the \"SECURITY_TYPE\" of a function or stored procedure, run:\n\nALTER FUNCTION function_name SQL SECURITY INVOKER;\nor\nALTER FUNCTION function_name SQL SECURITY DEFINER;\n\nFor stored procedures, run:\n\nALTER PROCEDURE procedure_name SQL SECURITY INVOKER;\nor\nALTER PROCEDURE procedure_name SQL SECURITY DEFINER;\n\n\"SQL SECURITY INVOKER\" causes the routine to execute using the privileges of the user invoking the routine. \"SQL SECURITY DEFINER\" causes the routine to execute using the privileges of the account defined as the definer of the routine.\n\nTo review the current definition of a function or procedure, execute the following command as a DBA:\n\nSHOW CREATE FUNCTION function_name;\nor\nSHOW CREATE PROCEDURE procedure_name;\n\nIf the definer account must be changed, the function or procedure must be recreated with the appropriate definer account.\n\nRemove the existing routine if modification of the definer, if required:\n\nDROP FUNCTION function_name;\nDROP PROCEDURE procedure_name;\n\nRecreate the function or procedure using the definition returned by the \"SHOW CREATE\" statement, specifying the appropriate \"DEFINER\" account in the \"CREATE\" statement. This ensures that elevated privileges are granted only where required and are executed under the appropriate security context.","ccis":["CCI-002233"]},{"vulnId":"V-286215","ruleId":"SV-286215r1292159_rule","severity":"medium","ruleTitle":"MariaDB must allocate audit record storage capacity in accordance with organization-defined audit record storage requirements.","description":"To ensure sufficient storage capacity for the audit logs, MariaDB 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.\n\nThe task of allocating audit record storage capacity is usually performed during initial installation of MariaDB and is closely associated with the DBA and system administrator (SA) roles. The DBA or SA 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.\n\nIn 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 MariaDB s ability to reuse the space formerly occupied by off-loaded records.","checkContent":"Investigate whether there have been any incidents where MariaDB ran out of audit file log disk space since the last time the space was allocated or other corrective measures were taken.\n\nIf there have been incidents where MariaDB ran out of audit log file disk space, this is a finding.\n\nMariaDB can be configured to use syslog or any OS system file to store audit records to designated disk directories.\n\nCheck the log file location. As the DBA (shown here as root), run:\n\nSHOW GLOBAL VARIABLES like  'server_audit%' ;\n\nIf using system logs (syslog), run: \n\n     From the query above verify the value of:\n       server_audit_output_type=SYSLOG\n\nIf written to \"SYSLOG\", follow the procedure for storage in the corresponding OS STIG.\n\nIf using an OS file, run:\n\n     From the query above verify the value of:\n       server_audit_output_type=FILE\n\nIf written to \"FILE\", check the remaining storage on the disk. If it does not meet organizationally defined audit record storage requirements, this is a finding.","fixText":"MariaDB audit log file location can be configured for either the syslog (if logging is set to \"SYSLOG\") or is controlled by the \"server_audit_file_path\" (FILE) in the \"mariadb-enterprise.cnf\" configuration file located in \"/etc/my.cnf.d/\" directory.\n\nIf the audit log file directory does not have enough disk space available, then increase the disk space available for the audit log file directory or move the audit log file directory to another location that has more disk space available.\n\nAllocate sufficient audit file space to support peak demand.\n \nIf \"server_audit_output_type=FILE\", set the directory in \"mariadb-enterprise.cnf\" to one that is managed by the centralized management system.\n\n[mariadb]\nserver_audit_file_path=  mydir / mylogfilename .log \n\nRestart the server with the new configuration: \n\n        $ systemctl restart mysqld\n \nAllocate sufficient audit file space to support peak demand for the log files.","ccis":["CCI-001849"]},{"vulnId":"V-286216","ruleId":"SV-286216r1292205_rule","severity":"medium","ruleTitle":"MariaDB must provide a warning to appropriate support staff when allocated audit record storage volume reaches 75 percent of maximum audit record storage capacity.","description":"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 cause an issue. However, space will still be required on the MariaDB 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.\n\nIf support personnel are not notified immediately upon storage volume utilization reaching 75 percent, they are unable to plan for storage capacity expansion. \n\nThe appropriate support staff include, at a minimum, the information system security officer (ISSO) and the database administrator (DBA)/system administrator (SA).","checkContent":"Check the log file location. As the DBA (shown here as root), run:\n\nSHOW GLOBAL VARIABLES LIKE 'server_audit_output_type';\n\nIf using system logs (syslog), run:\n\n     From the query above verify the value of:\n       server_audit_output_type=SYSLOG\n\nIf written to SYSLOG, follow the procedure for storage in the corresponding OS STIG.\n\nIf using an OS file, run:\n\n     From the query above verify the value of:\n       server_audit_output_type=FILE\n\nIf appropriate support staff are not notified immediately upon storage volume utilization reaching 75 percent, this is a finding.","fixText":"Configure the system to notify appropriate support staff immediately upon storage volume utilization reaching 75 percent.\n\nMariaDB does not monitor storage; however, it is possible to monitor storage with a script.\n\n##### Example Monitoring Script:\n\n#!/bin/bash\n\nDATADIR=/var/lib/psql/mysql\nCURRENT=$(df ${DATADIR?} | grep / | awk '{ print $5}' | sed 's/%//g')\nTHRESHOLD=75\n\nif [ \"$CURRENT\" -gt \"$THRESHOLD\" ] ; then\nmail -s 'Disk Space Alert' mail@support.com << EOF\nThe data directory volume is almost full. Used: $CURRENT\n%EOF\nfi\n\nSchedule this script in cron to run nonstop.","ccis":["CCI-001855"]},{"vulnId":"V-286217","ruleId":"SV-286217r1292207_rule","severity":"medium","ruleTitle":"MariaDB must record time stamps, in audit records and application data, that can be mapped to Coordinated Universal Time (UTC).","description":"If time stamps are not consistently applied and there is no common time reference, it is difficult to perform forensic analysis.\n\nTime stamps generated by MariaDB must include date and time. Time is commonly expressed in UTC, a modern continuation of Greenwich Mean Time (GMT), or local time with an offset from UTC. \n\nSome DBMS products offer a data type called TIMESTAMP that is not a representation of date and time. Rather, it is a database state counter and does not correspond to calendar and clock time. This requirement does not refer to that meaning of TIMESTAMP.","checkContent":"Check the current time zone value by running the following command as the administrator user (shown here as root):\n \nSHOW GLOBAL VARIABLES LIKE '%zone%';\n\n+-------------------------------+---------------+\n| Variable_name              | Value          |\n+-------------------------------+---------------+\n| system_time_zone       | UTC             |\n| time_zone                      | SYSTEM      |\n+--I----------------------------+---------------+\n \nIf \"time_zone = SYSTEM\", and \"system_time_zone\" is not equal to UTC, this is a finding.\n \nIf \"time_zone\" is not \"SYSTEM\" and is not UTC, this is a finding.","fixText":"On the OS command line run the following command to get the time zone the system is in:\n\n$ date | awk  {print $5; }  \n\nIf the system is in UTC, to set the time zone for timestamps to UTC, modify the MariaDB configuration file located within \"/etc/my.cnf.d/\" and set the variable \"time_zone\" to \"SYSTEM\" under the server section. Then, restart MariaDB Enterprise Server. \n\nExample: \n\n[server]\nTimezone  = SYSTEM\n\nSet the time zone for timestamps to UTC:\n\n[server]\nTimezone  = UTC","ccis":["CCI-001890"]},{"vulnId":"V-286218","ruleId":"SV-286218r1291948_rule","severity":"medium","ruleTitle":"MariaDB must enforce access restrictions associated with changes to the configuration of MariaDB or database(s).","description":"Failure to provide logical access restrictions associated with changes to configuration may have significant effects on the overall security of the system. \n\nWhen 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. \n\nAccordingly, only qualified and authorized individuals should be allowed to obtain access to system components for the purposes of initiating changes, including upgrades and modifications.\n\nSatisfies: SRG-APP-000380-DB-000360, SRG-APP-000378-DB-000365","checkContent":"If MariaDB supports only software development, experimentation, and/or developer-level testing (excluding production systems, integration testing, stress testing, and user acceptance testing), this is not a finding.\n\nReview MariaDB and database security settings with respect to nonadministrative users' ability to create, alter, or replace logic modules, to include stored procedures, functions, triggers, and views.\n\n1. List the privileges for all users on all tables and schemas, as the DBA (shown here as root).\n\nLoop over all the MariaDB users and \"SHOW GRANTS\" for each using the command below. \"SHOW GRANTS\" list the privileges granted to the account.\n\nRun the following to create the \"SHOW GRANTS\" script for each user: \n\nSELECT DISTINCT CONCAT( 'SHOW GRANTS FOR ', user,'@', host,';') AS grantQuery FROM mysql.user WHERE is_role = 'N';\nExample output:\n+----------------------------------------+\n| grantQuery                             |\n+----------------------------------------+\n| SHOW GRANTS FOR mariadb.sys@localhost; |\n| SHOW GRANTS FOR root@localhost;        |\n\nRun each \"SHOW GRANTS\" command for each user.\n \n2. Only \"DEFINERS\" of routines (functions and procedures) can change routines. To view the \"DEFINERS\" of all functions and procedures, run:\n \nSELECT * from mysql.proc \\G;\n \n3. Only \"DEFINERS\" of triggers can change triggers. To view all triggers and their \"DEFINERS:\" run: \n\nSELECT * from information_schema.triggers \\G;\n \n4. Views: At view definition time, the view creator must have the privileges needed to use the top-level objects accessed by the view. For example, if the view definition refers to table columns, the creator must have privileges for the columns. If the definition refers to a stored function, only the privileges needed to invoke the function can be checked. The privileges required when the function runs can be checked only as it executes. For different invocations of the function, different execution paths within the function can be taken.\n\nIf any such permissions exist and are not documented and approved, this is a finding.\n\nIf any database or schema has update or create privileges and should not, this is a finding.","fixText":"Document and obtain approval for any nonadministrative users who require the ability to create, alter or replace logic modules.\n\nCheck the security guide to implement the approved permissions. Revoke any unapproved permissions.\n\nConfigure MariaDB to enforce access restrictions associated with changes to the configuration of MariaDB or database(s). \n \n1. Use \"REVOKE\" to revoke privileges or roles on objects from users:\n \nREVOKE  privileges  ON  object  FROM  user ;\n \n2. Use \"REVOKE\" to remove a role from a user or another role that it has previously been assigned to:\n \nREVOKE  role  FROM  grantee or role ;","ccis":["CCI-001813","CCI-003980"]},{"vulnId":"V-286219","ruleId":"SV-286219r1292247_rule","severity":"medium","ruleTitle":"MariaDB must produce audit records of its enforcement of access restrictions associated with changes to the configuration of the DBMS or database(s).","description":"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. \n\nEnforcement 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.","checkContent":"To verify that system denies are logged when unprivileged users attempt to change database configuration, run the following commands using the DBA (shown here as root), and a newly created user shown here as \"test_user\": \n\nCREATE USER 'test_user'@'localhost' IDENTIFIED BY 'TEst_Password!2';\nCREATE DATABASE myapp;\nCREATE TABLE myapp.mytable (a int, b char(10));\n\nAs the \"test_user\", alter the table:\n \n$ mariadb -u test_user -p\n\nEnter password:\n\nMariaDB> ALTER TABLE myapp.mytable ADD COLUMN (c int);\n\nCheck the latest log to determine if the denial is logged. For example: \n\n$ tail -f /var/lib/mysql/server_audit.log\n \n20260610 16:35:19,localhost.localdomain,test_user,localhost,9,0,CONNECT,,,0\n20260610 16:35:19,localhost.localdomain,test_user,localhost,9,34,QUERY,,'select @@version_comment limit 1',0\n20260610 16:35:39,localhost.localdomain,test_user,localhost,10,38,QUERY,,'ALTER TABLE myapp.mytable ADD COLUMN (c int)',1142\n20260610 16:36:55,localhost.localdomain,test_user,localhost,9,0,DISCONNECT,,,0\n\nIf the denial is not produced, this is a finding.\n\nBy default, MariaDB configuration files are owned by the OS administrator user (root) and cannot be edited by nonprivileged users:\n\n$ ls -la /etc | grep my.cnf\n-rw-r--r--.   1 root root      301 Mar 25 12:45 my.cnf\n\nIf \"my.cnf\" is not owned by the OS administrator (root) and does not have read and write permissions for the owner, this is a finding.","fixText":"Verify that audit logging is enabled and properly configured using the MariaDB Audit Plugin.\n\nThe MariaDB Audit Plugin provides several configuration options and system variables that control audit logging behavior. After installation, review the current configuration by displaying the relevant system variables.\n\nAs the DBA, run:\n\nSHOW GLOBAL VARIABLES LIKE '%server_audit%';\n\nAudit events recorded by the MariaDB Audit Plugin are grouped into several event categories, including connect, query, and table events.\n\nConfigure MariaDB Enterprise Server 11.8 to generate audit records containing the required audit event information. Ensure the MariaDB Enterprise Audit Plugin is installed and enabled.\n\nEdit the \"mariadb-enterprise.cnf\" configuration file located in \"/etc/my.cnf.d/\".\n\n[mariadb]\nserver_audit_events=CONNECT,QUERY\n\nBy default, audit logging is disabled. To enable audit logging, set the \"server_audit_logging\" variable to \"ON\".\n\nUnder [mariadb], add/edit the following: \n\n[mariadb]\nserver_audit_logging=ON\n\nIf the query cache is enabled and a query result is returned from the cache, \"TABLE\" events may not appear in the audit log because the server does not access the underlying tables. In environments where accurate auditing of table access is required, disabling query caching may be appropriate.\n\nIf query-related event types are enabled, such as \"QUERY\", \"QUERY_DDL\", \"QUERY_DML\", \"QUERY_DML_NO_SELECT\", or \"QUERY_DCL\", the executed SQL statements will be recorded in the audit log exactly as they are executed.\n\nBecause queries are recorded in plain text, audit log files must be protected with appropriate file system permissions. Access to audit log files should be restricted to authorized administrators and stored in a protected directory.\n\nAlternatively, the \"TABLE\" event type may be used instead of query-related event types to reduce exposure of sensitive query content.\n\nQueries that fail to execute, including queries with syntax errors or insufficient privileges, will also be recorded in the audit log. These events can be identified using the error codes recorded in the audit log entry.\n\nEnsure that the \"server_audit_events\" configuration includes \"QUERY\", \"TABLE\", and any additional events required by the organization.\n\nserver_audit_events=QUERY,TABLE","ccis":["CCI-003938"]},{"vulnId":"V-286220","ruleId":"SV-286220r1291954_rule","severity":"medium","ruleTitle":"MariaDB must require users to reauthenticate when organization-defined circumstances or situations require reauthentication.","description":"The DoW standard for authentication of an interactive user is the presentation of a common access card (CAC) or other physical token bearing a valid, current, DoW-issued Public Key Infrastructure (PKI) certificate, coupled with a Personal Identification Number (PIN) to be entered by the user at the beginning of each session and whenever re-authentication is required.\n\nWithout re-authentication, users may access resources or perform tasks for which they do not have authorization. \n\nWhen applications provide the capability to change security roles or escalate the functional capability of the application, it is critical the user re-authenticate.\n\nIn addition to the re-authentication requirements associated with session locks, organizations may require re-authentication of individuals and/or devices in other situations, including (but not limited to) the following circumstances:\n\n(i) When authenticators change; \n(ii) When roles change; \n(iii) When security categories of information systems change; \n(iv) When the execution of privileged functions occurs; \n(v) After a fixed period of time; or\n(vi) Periodically.\n\nWithin the DoW, the minimum circumstances requiring re-authentication are privilege escalation and role changes.","checkContent":"Review the system documentation and the configuration of the DBMS and related applications and tools.\n\nIf there are any circumstances under which a user is not required to re-authenticate when changing role or escalating privileges, this is a finding.\n\nIf the information owner has identified additional cases where re-authentication is needed, but there are circumstances where the system does not ask the user to re-authenticate when those cases occur, this is a finding.\n \nDetermine all situations where a user must re-authenticate. Check if the mechanisms that handle such situations. To make a single user re-authenticate, the following must be present:\n\nKILL < ID >\n\nwhere ID is the process ID of the connection.\n \nTo generate a script to make all users re-authenticate, run the following as the DBA:\n\nSELECT CONCAT( 'KILL CONNECTION ' ,id, ';') AS KillQuery FROM information_schema.processlist where time = 0;","fixText":"Modify and/or configure MariaDB and related applications and tools so that users are always required to re-authenticate when changing role or escalating privileges.\n \nTo make a single user re-authenticate, the following must be present:\n\nKILL ID \n\nwhere ID is the process ID of the connection.\n \nTo generate a script to make all users re-authenticate, run the following as the DBA:\n\nSELECT CONCAT( 'KILL CONNECTION ' ,id, ';') AS KillQuery FROM information_schema.processlist where time = 0;\n\nModify and/or configure MariaDB and related applications and tools so that users are always required to re-authenticate when the specified cases needing reauthorization occur.","ccis":["CCI-002038"]},{"vulnId":"V-286221","ruleId":"SV-286221r1292210_rule","severity":"medium","ruleTitle":"MariaDB must prohibit the use of cached authenticators after an organization-defined time period.","description":"If cached authentication information is out of date, the validity of the authentication information may be questionable.","checkContent":"Each connection to the MariaDB database requires the authentication of the user. The authentication remains in place for the connection until the connection is closed or the connection times out due to inactivity. The system parameter \"idle_transaction_timeout\" specifies in seconds when a connection will be terminated due to inactivity. After a connection is terminated, and new request to the database must be preceded by an authentication which is not cached within the database.\n\nVerify that the \"idle_transaction_timeout\" is set to a value other than \"0\" or is set to the value needed by the administrator. \n\nThe value of \"idle_transaction_timeout\" can be validated by issuing \"SHOW VARIABLES\". \n\nSHOW GLOBAL VARIABLES LIKE 'idle_transaction_timeout ';\n\nIf variable is set to a value other than \"0\" or is set to the value needed, this is a finding.","fixText":"Verify that the \"idle_transaction_timeout\" is set to a value other than \"0\" or is set to the value needed by the administrator. \n\nTo modify these values, locate the MariaDB Enterprise Server configuration file to change. For Centos, RedHat, and similar distributions, this will be located in \"/etc/my.cnf.d/\".\n\nIn the [mariadb] section, add the lines:\n\nidle_transaction_timeout = value","ccis":["CCI-002007"]},{"vulnId":"V-286222","ruleId":"SV-286222r1292249_rule","severity":"high","ruleTitle":"MariaDB must use NSA-approved cryptography to protect classified information in accordance with the data owner's requirements.","description":"Use of weak or untested encryption algorithms undermines the purposes of using 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.\n\nIt 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.\n\nNSA-approved cryptography for classified networks is hardware based. This requirement addresses the compatibility of MariaDB with the encryption devices.","checkContent":"Run the following SQL as a DBA:\n\nSHOW GLOBAL VARIABLES LIKE 'have_ssl';\n\nExpected result:\nhave_ssl | YES\n\nIf the value is not \"YES\", this is a finding.\n\nVerify that TLS is enabled for the server.\n\nSHOW GLOBAL VARIABLES LIKE 'ssl_%';\n\nConfirm that the following variables are populated with valid certificate paths:\n\nssl_ca\nssl_cert\nssl_key\n\nIf these variables are empty or TLS is not configured, this is a finding.\n\nVerify that client connections are capable of using SSL/TLS:\n\nSHOW GLOBAL VARIABLES LIKE 'require_secure_transport';\n\nIf secure transport is not enabled or TLS is not enforced for connections that require protection, this is a finding.\n\nFor environments processing classified information, consult network administration personnel to determine whether the database server is protected by NSA-approved cryptographic devices or solutions in accordance with applicable federal regulations and security policies.\n\nIf the server or network path is not protected by NSA-approved cryptographic mechanisms where required, this is a finding.","fixText":"Enable TLS support in the MariaDB configuration file.\n\nEdit the \"mariadb-enterprise.cnf \"configuration file located in \"/etc/my.cnf.d/\".\n\nUnder [mariadb], add/edit the following: \n\n[mariadb]\nssl-ca=/etc/my.cnf.d/certs/ca-cert.pem\nssl-cert=/etc/my.cnf.d/certs/server-cert.pem\nssl-key=/etc/my.cnf.d/certs/server-key.pem\n\nRestart the MariaDB service for the configuration changes to take effect.\n\nVerify TLS support is enabled:\n\nSHOW GLOBAL VARIABLES LIKE 'have_ssl';\nSHOW GLOBAL VARIABLES LIKE 'ssl_%';\n\nEnforce encrypted connections, where required:\n\nSET GLOBAL require_secure_transport=ON;\n\nEnsure that database users requiring encrypted connections are configured accordingly:\n\nALTER USER 'username'@'host' REQUIRE SSL;\nor\nALTER USER 'username'@'host' REQUIRE X509;\n\nIn classified environments, ensure the database server or network communications are protected using NSA-approved cryptographic mechanisms in accordance with applicable federal laws, directives, and security policies.","ccis":["CCI-002450"]},{"vulnId":"V-286223","ruleId":"SV-286223r1291963_rule","severity":"medium","ruleTitle":"MariaDB must only accept end entity certificates issued by DoW Public Key Infrastructure (PKI) or DoW-approved PKI Certification Authorities (CAs) for the establishment of all encrypted sessions.","description":"Only DoW-approved external PKIs have been evaluated to ensure that they have security controls and identity vetting procedures in place which are sufficient for DoW systems to rely on the identity asserted in the certificate. PKIs lacking sufficient security controls and identity vetting procedures risk being compromised and issuing certificates that enable adversaries to impersonate legitimate users. \n\nThe authoritative list of DoW-approved PKIs is published at https://dl.dod.cyber.mil/wp-content/uploads/pki-pke/pdf/unclass-ss_using_commercial_pki_certificates.pdf.\n\nThis requirement focuses on communications protection for the MariaDB session rather than for the network packet.","checkContent":"Verify whether MariaDB Enterprise Edition is in use.\n\nExecute the following SQL query to review version information:\n\nSELECT VARIABLE_NAME, VARIABLE_VALUE\nFROM information_schema.GLOBAL_VARIABLES\nWHERE VARIABLE_NAME IN ('version','version_comment','version_suffix');\n\nIn MariaDB Enterprise Edition, the version string typically contains the suffix \"-enterprise\". Enterprise deployments may also include additional enterprise-specific plugins or variables such as enterprise encryption or backup-related functionality. The version string is the definitive indicator of the edition in use.\n\nAfter confirming the edition, verify that SSL certificate configuration is present in the MariaDB configuration.\n\nExecute the following commands as a DBA to review the configured SSL certificate parameters:\n\nSHOW GLOBAL VARIABLES LIKE 'ssl_ca';\nSHOW GLOBAL VARIABLES LIKE 'ssl_cert';\n\nThe \"Value\" column returned by these commands displays the fully qualified file paths of the configured \"ssl_ca\" and \"ssl_cert\" files.\n\nUse the following commands to identify the certificate issuer:\n\nopenssl x509 -in <fully-qualified-path-to-ssl_ca> -noout -issuer\nopenssl x509 -in <fully-qualified-path-to-ssl_cert> -noout -issuer\n\nVerify that the certificate issuer corresponds to a DoW-approved PKI authority.\n\nThe authoritative list of DoW-approved PKI providers is published at https://dl.dod.cyber.mil/wp-content/uploads/pki-pke/pdf/unclass-ss_using_commercial_pki_certificates.pdf.\n\nIf the database management system accepts end-entity certificates issued by non-DoW-approved PKI authorities, this is a finding.","fixText":"Revoke trust in any certificates not issued by a DoW-approved certificate authority.\n \nConfigure MariaDB to accept only DoW and DoW-approved PKI end-entity certificates.","ccis":["CCI-002470"]},{"vulnId":"V-286224","ruleId":"SV-286224r1292212_rule","severity":"high","ruleTitle":"MariaDB must implement cryptographic mechanisms to prevent unauthorized modification of organization-defined information at rest (to include, at a minimum, Personally Identifiable Information [PII] and classified information) on organization-defined information system components.","description":"MariaDB 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 MariaDB or implemented via additional software or operating system/file system settings, as appropriate to the situation.\n\nSelection 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). \n\nThe 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.\n\nSatisfies: SRG-APP-000428-DB-000386, SRG-APP-000429-DB-000387","checkContent":"Review the security guide to determine whether the organization has defined the information at rest that is to be protected from disclosure, which must include, at a minimum, PII and classified information.\n\nIf the documentation indicates no information requires such protections, this is not a finding.\n\nReview the configuration of MariaDB, operating system/file system, and additional software as relevant.\n \nOne possible way to encrypt data within MariaDB is to use the file key management plugin. To determine if this is installed, check the following variables as the DBA:\n\nSHOW PLUGINS; \n\nConfirm the \"file_key_management.so\" is listed.\n\nSHOW GLOBAL VARIABLES LIKE 'file_key%';\nSHOW GLOBAL VARIABLES LIKE 'aria_en%';\nSHOW GLOBAL VARIABLES LIKE 'innodb_encrypt_tables';\nSHOW GLOBAL VARIABLES LIKE 'innodb_encrypt_log';\nSHOW GLOBAL VARIABLES LIKE 'innodb_tablespace%';\nSHOW GLOBAL VARIABLES LIKE 'encrypt%';\n\nConfirm these are \"ON\".\n\nIf this is required and is not found, this is a finding. \n\nIf any of the information defined as requiring protection is not encrypted in a manner that provides the required level of protection and is not physically secured to the required level, this is a finding.","fixText":"Configure MariaDB, the operating system/file system, and any supporting software to provide the required level of cryptographic protection.\n\nMariaDB data-at-rest encryption can be implemented using a key management and encryption plugin such as the File Key Management Plugin.\n\nAfter the File Key Management Plugin has been enabled and configured, encrypted tables may be created using the \"ENCRYPTED\" table option.\n\nExample:\n\nCREATE TABLE t (i INT) ENGINE=InnoDB ENCRYPTED=YES;\n\nWhen a table is created with the \"ENCRYPTED\" option enabled, the table data is encrypted using the encryption key defined in the configured key management file.\n\nEnsure that the encryption key file is stored in a protected location with appropriate operating system permissions and that only authorized administrators have access to the key material.","ccis":["CCI-002475","CCI-002476"]},{"vulnId":"V-286225","ruleId":"SV-286225r1291969_rule","severity":"medium","ruleTitle":"MariaDB must maintain the confidentiality and integrity of information during preparation for transmission or reception.","description":"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.\n\nUse 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. \n\nWhen transmitting or receiving data MariaDB, associated applications, and infrastructure must leverage transmission protection mechanisms.\n\nSatisfies: SRG-APP-000441-DB-000378, SRG-APP-000442-DB-000379","checkContent":"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.\n \nAs the DBA (shown here as root), verify the following settings: \n\nSHOW GLOBAL VARIABLES LIKE 'ssl_ca';\nSHOW GLOBAL VARIABLES LIKE 'ssl_cert';\nSHOW GLOBAL VARIABLES LIKE 'ssl_key'; \n\nIf SSL is not enabled, this is a finding.\n\nIf MariaDB does not employ protective measures against unauthorized disclosure and modification during preparation for transmission, this is a finding.","fixText":"Implement protective measures against unauthorized disclosure and modification of information during transmission or reception.\n\nConfigure MariaDB to use SSL/TLS to protect database connections.\n\n1. Install the MariaDB server and client packages.\n\napt-get update -y\napt-get install mariadb-server mariadb-client -y\n\n2. Create a directory to store SSL certificates and keys.\n\nmkdir /etc/mysql/certs\ncd /etc/mysql/certs\n\n3. Generate the Certificate Authority (CA) private key and certificate.\n\nopenssl genrsa 2048 > ca-key.pem\nopenssl req -new -x509 -nodes -days 3650 -key ca-key.pem -out ca-cert.pem\n\n4. Generate the server private key and certificate.\n\nopenssl req -newkey rsa:2048 -nodes -keyout server-key.pem -out server-req.pem\nopenssl rsa -in server-key.pem -out server-key.pem\nopenssl x509 -req -in server-req.pem -days 365 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem\n\n5. Configure MariaDB to use SSL by editing the MariaDB configuration file (for example, \"/etc/mysql/mariadb.conf.d/50-server.cnf\") and adding the following lines in the [mariadb] section:\n\nssl-ca=/etc/mysql/certs/ca-cert.pem\nssl-cert=/etc/mysql/certs/server-cert.pem\nssl-key=/etc/mysql/certs/server-key.pem\n\n6. Restart the MariaDB service to apply the configuration.\n\nsystemctl restart mariadb\n\n7. Verify that SSL is enabled.\n\nSHOW VARIABLES LIKE '%ssl%';\n\n8. Configure users to require SSL connections.\n\nGRANT ALL PRIVILEGES ON *.* TO 'client'@'client_ip_address' IDENTIFIED BY 'password' REQUIRE SSL;\nFLUSH PRIVILEGES;\n\n9. Verify the SSL connection.\n\nmariadb -u client -h server_ip_address -p\nstatus","ccis":["CCI-002420","CCI-002422"]},{"vulnId":"V-286226","ruleId":"SV-286226r1292161_rule","severity":"medium","ruleTitle":"When invalid inputs are received, MariaDB must behave in a predictable and documented manner that reflects organizational and system objectives.","description":"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.\n\nThe 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.\n\nThis calls for inspection of application source code, which will require collaboration with the application developers. It is recognized that in many cases, the 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.\n\nSatisfies: SRG-APP-000251-DB-000392, SRG-APP-000447-DB-000393","checkContent":"As the DBA (shown here as root), generate a SQL syntax error by running the following command:\n\nCREAT TABLE incorrect_syntax(id INT);\n\nERROR 1064 (42000): An error in SQL syntax is returned. The message indicates the syntax error near 'CREAT TABLE incorrect_syntax(id INT)'.\n\nVerify the syntax error was logged (adjust the log file name and path as appropriate for the environment):\n\n$ sudo su - root\n$ cat $DATADIR/sql_errors.log\n\nExample log entry:\n\nYYYY-MM-DD HH:MM:SS root[root] @ localhost [] ERROR 1064: An error in SQL syntax near 'CREAT TABLE incorrect_syntax(id INT)' at line 1\n\nReview the security guidance to determine how input errors from applications to MariaDB are required to be handled and whether special handling is defined for specific circumstances.\n\nIf the system does not implement the documented behavior, this is a finding.","fixText":"Verify the current SQL mode configuration:\n\nSHOW VARIABLES LIKE 'sql_mode';\n\nEnsure that strict SQL modes are enabled to enforce predictable error handling. At a minimum, the following modes should be included:\n\nSTRICT_TRANS_TABLES or STRICT_ALL_TABLES\nNO_ZERO_DATE\nNO_ZERO_IN_DATE\nERROR_FOR_DIVISION_BY_ZERO\n\nIf required modes are not enabled, edit the \"mariadb-enterprise.cnf\" configuration file located in \"/etc/my.cnf.d/\".\n\n[mariadb]\nsql_mode=STRICT_TRANS_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO\n\nRestart the MariaDB service to apply changes:\n\nsystemctl restart mariadb\n\nValidate that applications interacting with the database implement proper input validation and error handling consistent with organizational policies.","ccis":["CCI-001310","CCI-002754"]},{"vulnId":"V-286227","ruleId":"SV-286227r1292251_rule","severity":"medium","ruleTitle":"When updates are applied to the MariaDB software, any software components that have been replaced or made unnecessary must be removed.","description":"Previous versions of MariaDB components that are not removed from the information system after updates have been installed may be exploited by adversaries. \n\nMariaDB may remove older versions of software automatically from the information system. In other cases, manual review and removal will be required. In planning installations and upgrades, organizations must include steps (automated, manual, or both) to identify and remove the outdated modules.\n\nA transition period may be necessary when both the old and the new software are required.","checkContent":"As a DBA, review installed MariaDB packages on the host operating system.\n\nFor RPM-based Linux distributions (e.g., RHEL, CentOS, Fedora), run:\n\nrpm -qa | grep -i mariadb\n\nFor DEB-based Linux distributions (e.g., Debian, Ubuntu), run:\n\ndpkg -l | grep -i mariadb\n\nReview the output and verify that only the currently required MariaDB packages and versions are installed.\n\nConfirm that the following have been removed following the upgrade:\n- Outdated MariaDB packages.\n- Superseded MariaDB versions.\n- Unused MariaDB client libraries or components.\n\nIf any obsolete, superseded, or unnecessary MariaDB components remain installed on the system, this is a finding.","fixText":"Remove any unnecessary packages using the OS package manager for each outdated, deprecated, or unused component. Examples:\n\nFor RPM-based systems, run:\n\nsudo yum remove <component_name>\n\nFor DEB-based systems, run:\n\nsudo apt-get remove <package_name>","ccis":["CCI-002617"]},{"vulnId":"V-286228","ruleId":"SV-286228r1292253_rule","severity":"medium","ruleTitle":"Security-relevant software updates to MariaDB must be installed within the time period directed by an authoritative source (e.g. IAVM, CTOs, DTMs, and STIGs).","description":"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. \n\nOrganization-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). \n\nThis requirement will apply to software patch management solutions that are used to install patches across the enclave and also to applications themselves that are not part of that patch management solution. For example, many browsers today provide the capability to install their own patch software. Patch criticality, as well as system criticality, will vary. Therefore, the tactical situations regarding the patch management process will also vary. This means that the time period used must be a configurable parameter. Time frames for application of security-relevant software updates may be dependent upon the IAVM process.\n\nThe 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).","checkContent":"If new packages are available for MariaDB, they can be reviewed in the package manager appropriate for the server operating system. \n\nTo list the version of MariaDB; as the DBA (shown here as root), run the following Linux commands:\n\nSELECT @@version\n\nFrom the OS shell, check the list of installed packages:\n\nsudo yum list installed | grep -i mariadb\n\nAll versions of MariaDB are listed on https://mariadb.com/downloads/#mariadb_platform-mariadb_server.\n \nAll security-relevant software updates for MariaDB are listed on https://mariadb.com/kb/en/library/security/.\n\nIf MariaDB is not at the latest version, this is a finding.\n\nIf MariaDB is not at the latest version and the evaluated version has CVEs (IAVAs), this is a CAT I finding.","fixText":"Institute and adhere to policies and procedures to ensure patches are consistently applied to MariaDB within the time allowed.","ccis":["CCI-002605"]},{"vulnId":"V-286229","ruleId":"SV-286229r1291981_rule","severity":"high","ruleTitle":"MariaDB products must be a version supported by the vendor. Only MariaDB Enterprise is supported.","description":"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.\n\nSystems 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 MariaDB software is no longer considered supported and should be upgraded or decommissioned.","checkContent":"Review the version and release information and check if a suitable enterprise edition is in use: \n\nMariaDB> SELECT VARIABLE_NAME, VARIABLE_VALUE\n FROM information_schema.GLOBAL_VARIABLES\n WHERE VARIABLE_NAME IN ('version', 'version_comment', 'version_suffix');\n\nAn example output for Enterprise 11.8 would be:\n\n+-----------------------------+\n| 11.8.2-MariaDB-enterprise |\n+-----------------------------+\n\nIn Enterprise, the version field itself will contain \"-enterprise\", and sometimes additional enterprise-specific variables/plugins appear (e.g., enterprise encryption or backup-related variables), but the version string is the definitive indicator. In Community, the version field is usually empty or generic and has no enterprise indicators.\n\nAccess the MariaDB Enterprise download page and check supported releases: https://mariadb.com/downloads/enterprise/enterprise-server/\n\nPick the corresponding operating system such as Ubuntu, Red Hat, Rocky, or another from the drop-down list.\n\nIf MariaDB Community Software or an older MariaDB Enterprise version that has reached end-of-life (EOL) is in use, this is a finding.","fixText":"Remove or decommission all unsupported software products. Upgrade MariaDB or unsupported components to a supported version of the product.","ccis":["CCI-003376"]},{"vulnId":"V-286230","ruleId":"SV-286230r1292218_rule","severity":"medium","ruleTitle":"MariaDB 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 standalone systems.","description":"Information stored in one location is vulnerable to accidental or incidental deletion or alteration.\n\nOff-loading is a common process in information systems with limited audit storage capacity. \n\nMariaDB writes audit records 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.\n\nSatisfies: SRG-APP-000515-DB-000318, SRG-APP-000745-DB-000120","checkContent":"MariaDB can be configured to use syslog or any OS system file to store audit records to designated disk directories.\n\nCheck the MariaDB Plugin configuration. Check the log file location. As the DBA (root), run the following SQL:\n\nSHOW GLOBAL VARIABLES like  'server_audit%; \n\nVerify the server_audit_logging is set to \"ON\".\n\n##To use system logs (syslog): \n     From the query above verify the value of:\n       server_audit_output_type=SYSLOG\n\n##To use an OS file:\n     From the query above verify the value of:\n       server_audit_output_type=FILE\n \nCheck the following values:\n\nserver_audit_file_rotate_now = ON \nserver_audit_file_rotate_size x*1024. This is the size of the file (in bytes) that will cause file rotation.\nserver_ audit_file_rotations =x   This is the number of rotations to save.\n\nCheck with the security guide to verify that the central management system is using the correct directories.\n\nIf MariaDB audit records are not written directly to or systematically transferred to the centralized log management system in the security guide, this is a finding.\n\nIf the DBMS has a continuous network connection to the centralized log management system, but the DBMS audit records are not written directly to the centralized log management system or transferred in near-real-time, this is a finding.\n\nIf the DBMS does not have a continuous network connection to the centralized log management system, and the DBMS audit records are not transferred to the centralized log management system weekly or more often, this is a finding.","fixText":"Configure MariaDB or deploy and configure software tools to transfer audit records to a centralized log management system, continuously and in near-real time where a continuous network connection to the log management system exists, or at least weekly in the absence of such a connection.\n \nIf \"server_audit_output_type\" equals \"FILE\", set the directory in \"/etc/my.cnf\" to one that is managed by the centralized management system:\n\n[mariadb]\nserver_audit_file_path=  mydir / mylogfilename .log \n\nRestart the server with the new configuration: \n\n        $ systemctl restart mysqld\n \nIf \"server_audit_output_type\" equals \"SYSLOG\", refer to the security guide to set the correct syslog location.","ccis":["CCI-001851","CCI-003821"]},{"vulnId":"V-286231","ruleId":"SV-286231r1291987_rule","severity":"medium","ruleTitle":"MariaDB must disable accounts when accounts have expired.","description":"MariaDB needs to allow for disabling expired, inactive, or otherwise anomalous accounts supports the concept of least privilege and least functionality, which reduce the attack surface of the system.","checkContent":"Identify accounts configured with password expiration. Run the following SQL as a DBA:\n\nSELECT user, host, password_expired \nFROM mysql.user;\n\nAccounts with \"password_expired\" equal to \"Y\" have expired passwords.\n\nIf expired accounts are present and are still able to authenticate without resetting their password, this is a finding.\n\nVerify password expiration settings for users by running:\n\nSHOW CREATE USER 'username'@'host';\n\nReview the output for password expiration configuration such as:\n\nPASSWORD EXPIRE\nPASSWORD EXPIRE INTERVAL N DAY\n\nIf user accounts are not configured according to the organization's password expiration policy, this is a finding.\n\nVerify that expired accounts cannot authenticate without changing their password.\n\nAttempt to connect using an account with an expired password. MariaDB should require the password to be reset before access is granted.\n\nIf expired accounts are allowed to authenticate and execute queries without resetting the password, this is a finding.\n\nVerify global password expiration policy if required by the organization by running:\n\nSHOW VARIABLES LIKE 'default_password_lifetime';\n\nIf the system does not enforce the organization's password expiration policy where required, this is a finding.","fixText":"Configure password expiration to require periodic password changes:\n\nALTER USER 'someusername'@'localhost' PASSWORD EXPIRE INTERVAL 60 DAY;\n\nTo view information about a user's password expiration settings, run:\n\nSHOW CREATE USER 'foo4'@'test';\n\nAccount-Specific Policy: Password expiration can be configured for individual accounts using \"ALTER USER\" or \"CREATE USER\" with the \"PASSWORD EXPIRE\" option.\n\nIf a user's password expires and it is not changed, server behavior depends on the \"disconnect_on_expired_password\" system variable and whether the client supports expired passwords. In this case, the account is placed in a restricted mode allowing only password reset operations.\n\nUser accounts can also be manually disabled using the account lock command:\n\nALTER USER 'inactive_user'@'localhost' ACCOUNT LOCK;\n\nMariaDB also provides an audit plugin that can log user activity such as logins, executed queries, and database modifications. This can assist administrators in identifying inactive accounts.\n\nIf an account is determined to be inactive, lock the account:\n\nALTER USER 'inactive_user'@'localhost' ACCOUNT LOCK;","ccis":["CCI-003627"]},{"vulnId":"V-286232","ruleId":"SV-286232r1292176_rule","severity":"medium","ruleTitle":"MariaDB must disable accounts when the accounts are no longer associated to a user.","description":"MariaDB must be able to disabling expired, inactive, or otherwise anomalous accounts supports the concepts of least privilege and least functionality, which reduce the attack surface of the system.","checkContent":"Log in to MariaDB Enterprise Server as the database administrator.\n\nList all database accounts:\n\nSELECT User, Host\nFROM mysql.global_priv;\n\nReview the returned accounts and compare them with the organization's authorized user records.\n\nVerify that each database account is associated with a currently-authorized user or approved service account.\n\nIf a database account exists for a user who is no longer authorized to access the system and the account has not been disabled or removed in accordance with organizational account management procedures, this is a finding.","fixText":"Remove the account if it is no longer required:\n\nDROP USER 'user'@'host';\n\nIf organizational policy requires the account to be retained, disable the account.\n\nVerify that only authorized user and service accounts remain:\n\nSELECT User, Host\nFROM mysql.global_priv;","ccis":["CCI-003628"]},{"vulnId":"V-286233","ruleId":"SV-286233r1291993_rule","severity":"medium","ruleTitle":"MariaDB must, for password-based authentication, maintain a list of commonly used, expected, or compromised passwords on an organization-defined frequency.","description":"Password-based authentication applies to passwords regardless of whether they are used in single-factor or multifactor authentication. Long passwords or passphrases are preferable over shorter passwords. Enforced composition rules provide marginal security benefits while decreasing usability. However, organizations may choose to establish certain rules for password generation (e.g., minimum character length for long passwords) under certain circumstances and can enforce this requirement in IA-5(1)(h). Account recovery can occur, for example, in situations when a password is forgotten. Cryptographically protected passwords include salted one-way cryptographic hashes of passwords. The list of commonly used, compromised, or expected passwords includes passwords obtained from previous breach corpuses, dictionary words, and repetitive or sequential characters. The list includes context-specific words, such as the name of the service, username, and derivatives thereof.","checkContent":"Verify a password validation plugin that supports detection of commonly used or compromised passwords is installed and active:\n\nSHOW PLUGINS;\n\nVerify \"cracklib_password_check\" or an organization-approved equivalent plugin is listed with Status = ACTIVE.\n\nIf no password validation plugin capable of checking commonly used or compromised passwords is installed and active, this is a finding.\n\nVerify the password validation plugin is configured to use a dictionary file:\n\nSHOW VARIABLES LIKE 'cracklib_password_check_dictionary';\n\nIf no dictionary file is configured, this is a finding.\n\nVerify the configured dictionary file exists on the system:\n\nls -l <dictionary_path>\n\nIf the dictionary file does not exist, this is a finding.\n\nVerify the dictionary file is maintained and updated in accordance with organization-defined frequency.\n\nIf the dictionary file is not updated per organizational policy, this is a finding.\n\nVerify password validation is enforced by attempting to create a user with a commonly used password:\n\nCREATE USER 'test_user'@'localhost' IDENTIFIED BY 'password';\n\nIf the system allows creation of a user with a commonly used or compromised password, this is a finding.\n\nVerify password validation configuration aligns with organizational policy:\n\nSHOW VARIABLES LIKE 'cracklib_password_check%';\n\nIf password validation settings are not configured in accordance with organization-defined requirements, this is a finding.","fixText":"Configure MariaDB to prevent the use of commonly used, expected, or compromised passwords by implementing the Cracklib Password Check plugin.\n\nInstall the Cracklib password check plugin:\n\nINSTALL SONAME 'cracklib_password_check';\n\nDepending on the operating system, the Cracklib package may need to be installed prior to enabling the plugin (for example, \"mariadb-plugin-cracklib-password-check\").\n\nConfigure the plugin.\n\nSpecify a dictionary. The Cracklib Password Check plugin validates passwords against a dictionary. A systemwide dictionary or a custom dictionary can be used.\n\nSet the dictionary path using the \"cracklib_password_check_dictionary\" variable to define the dictionary file location.\n\nAdditional password validation mechanisms may also be implemented.\n\nSimple Password Check: Enforces minimum password length and character type requirements such as digits, letters, and special characters.\n\nPassword Reuse Check: Prevents users from reusing previously used passwords.\n\nPassword policies should also include the following controls:\n- Implement password expiration policies (for example requiring users to change passwords every 90 days).\n- Set minimum password length and complexity requirements including uppercase letters, lowercase letters, numbers, and special characters.\n- Implement account lockout mechanisms after a defined number of failed login attempts to reduce the risk of brute force attacks.","ccis":["CCI-004058"]},{"vulnId":"V-286234","ruleId":"SV-286234r1291996_rule","severity":"medium","ruleTitle":"MariaDB must, for password-based authentication, require immediate selection of a new password upon account recovery.","description":"Password-based authentication applies to passwords regardless of whether they are used in single-factor or multifactor authentication. Long passwords or passphrases are preferable over shorter passwords. Enforced composition rules provide marginal security benefits while decreasing usability. However, organizations may choose to establish certain rules for password generation (e.g., minimum character length for long passwords) under certain circumstances and can enforce this requirement in IA-5(1)(h). Account recovery can occur, for example, in situations when a password is forgotten. Cryptographically protected passwords include salted one-way cryptographic hashes of passwords. The list of commonly used, compromised, or expected passwords includes passwords obtained from previous breach corpuses, dictionary words, and repetitive or sequential characters. The list includes context-specific words, such as the name of the service, username, and derivatives thereof.","checkContent":"Identify the account recovery procedure used for database accounts (administrative password reset). Verify that recovered accounts are marked as expired and require an immediate password change at next login.\n\nVerify the user is configured to require a password change after recovery. As the DBA, run: \n\nSHOW CREATE USER 'username'@'host';\n\nConfirm the account is configured with password expiration behavior consistent with the recovery process (e.g., \"PASSWORD EXPIRE\").\n\nVerify enforcement using a functional test.\n\nAs a DBA, perform a simulated recovery by resetting the password and expiring it:\n\nALTER USER 'test_user'@'localhost' IDENTIFIED BY 'TempPass#123' PASSWORD EXPIRE;\n\nAttempt to log in as \"test_user\" using the temporary password. Verify the session is required to change the password before normal access is granted (i.e., the account cannot continue normal operations without setting a new password).\n\nIf recovered accounts can authenticate and continue normal use without being forced to immediately change the password, this is a finding.","fixText":"Configure MariaDB Enterprise to require users to change their password upon account recovery by enforcing password expiration.\n\nSet password lifetime to enforce expiration:\n\nEdit the mariadb-enterprise.cnf configuration file located in \"/etc/my.cnf.d/\".\n\nUnder [mariadb], add/edit the following: \n\n[mariadb]\n\ndefault_password_lifetime = <organization-defined-value>;\n\nConfigure recovered or reset accounts to require immediate password change:\n\nALTER USER '<username>'@'<host>' PASSWORD EXPIRE;\n\nEnsure administrative password reset procedures include setting the account to expired status:\n\nALTER USER '<username>'@'<host>' IDENTIFIED BY '<temporary_password>' PASSWORD EXPIRE;\n\nVerify that accounts require password change upon next authentication:\n\nSELECT User, Host, password_expired FROM mysql.user;\n\nEnsure all password-based accounts subject to recovery processes are configured to require immediate password change upon first login following password reset.","ccis":["CCI-004063"]},{"vulnId":"V-286235","ruleId":"SV-286235r1292255_rule","severity":"medium","ruleTitle":"MariaDB must, for public key-based authentication, implement a local cache of revocation data to support path discovery and validation.","description":"Public key cryptography is a valid authentication mechanism for individuals, machines, and devices. For Public Key Infrastructure (PKI) solutions, status information for certification paths includes certificate revocation lists or certificate status protocol responses. For Personal Identity Verification (PIV) cards, certificate validation involves the construction and verification of a certification path to the Common Policy Root trust anchor, which includes certificate policy processing. Implementing a local cache of revocation data to support path discovery and validation also supports system availability in situations where organizations are unable to access revocation information via the network.","checkContent":"Verify that TLS is enabled and certificates are configured. As a DBA, run: \n\nSHOW GLOBAL VARIABLES LIKE 'ssl_%';\n\nConfirm that certificate paths are configured (for example):\n- ssl_ca.\n- ssl_cert.\n- ssl_key.\n\nIf TLS certificates are not configured when public key-based authentication is required, this is a finding.\n\nVerify that a Certificate Revocation List (CRL) file or CRL directory is configured by running: \n\nSHOW GLOBAL VARIABLES LIKE 'ssl_crl%';\n\nExpected variables include \"ssl_crl\" and \"ssl_crlpath\".\n\nIf both variables are empty when public key authentication is used, this is a finding.\n\nVerify that the CRL file or directory exists on the system.\n\nExample:\nls -l /etc/my.cnf.d/certs/\n\nConfirm the CRL file or CRL directory referenced by \"ssl_crl\" or \"ssl_crlpath\" exists and is readable by the MariaDB server process.\n\nIf the CRL file or directory does not exist or is not accessible, this is a finding.","fixText":"Configure MariaDB to implement a local cache of certificate revocation data to support certificate path discovery and validation.\n\nUse a CRL provided by the issuing Certificate Authority (CA).\n\nObtain the CRL file from the CA (for example: example.crl.pem) and place it in a secure location on the MariaDB server such as \"/etc/pki/tls/certs/\".\n\nConfigure MariaDB to reference the CRL by updating the configuration file (for example \"/etc/my.cnf\" or a file under it):\n\n[mariadb]\nssl_crl=/etc/pki/tls/certs/example.crl.pem\n\nRestart the MariaDB service to apply the configuration:\n\nsystemctl restart mariadb\n\nEnsure TLS certificates are properly configured for MariaDB so revocation checks can occur during client authentication:\n\n[mariadb]\nssl_key=/etc/pki/tls/private/server.example.com.key.pem\nssl_cert=/etc/pki/tls/certs/server.example.com.crt.pem\nssl_ca=/etc/pki/tls/certs/ca.crt.pem","ccis":["CCI-004068"]},{"vulnId":"V-286236","ruleId":"SV-286236r1292221_rule","severity":"medium","ruleTitle":"MariaDB must protect nonlocal maintenance sessions by separating the maintenance session from other network sessions with the system by logically separated communications paths.","description":"Nonlocal maintenance and diagnostic activities are conducted by individuals who communicate through either an external or internal network. Communications paths can be logically separated using encryption.","checkContent":"Verify which network interface MariaDB is listening on. As a DBA, run:\n\nSHOW GLOBAL VARIABLES LIKE 'bind_address';\n\nConfirm MariaDB is bound to a specific interface or management network address and not to all interfaces (0.0.0.0) unless network controls enforce separation.\n\nIf MariaDB listens on all interfaces without network-level separation controls, this is a finding.\n\nVerify remote administrative access restrictions. Check configured accounts that can access MariaDB remotely:\n\nSELECT user, host FROM mysql.user;\n\nConfirm administrative accounts (e.g., root, DBAs) are restricted to localhost, management network ranges, and bastion or administrative hosts.\n\nIf administrative accounts allow unrestricted remote access (e.g., %), this is a finding.\n\nVerify secure transport is enforced for remote maintenance sessions by running:\n\nSHOW GLOBAL VARIABLES LIKE 'require_secure_transport';\n\nExpected result:\nrequire_secure_transport = ON\n\nIf secure transport is not required for remote connections, this is a finding.\n\nVerify network architecture documentation confirms that database administration occurs through a logically separated management network or administrative access path (e.g., bastion host, VPN, management VLAN, or private network).\n\nIf administrative access shares the same communication path as general application traffic without logical separation, this is a finding.","fixText":"Configure MariaDB to protect nonlocal maintenance sessions by separating the maintenance session from other network sessions with the system by logically separated communications paths. Protecting nonlocal MariaDB maintenance sessions involves separating them from other network sessions, ensuring enhanced security. This separation can be achieved through either physically or logically separated communication paths, coupled with robust authentication.\n\n1. Implement multi-factor authentication (MFA) or Public Key Infrastructure (PKI) with certificates protected by passwords, passphrases, or biometrics. \n\n2. Use separate network interfaces on the MariaDB server for maintenance traffic, routing it through a distinct physical network segment or VLAN.\n\nImplement a dedicated, isolated network specifically for maintenance and administrative tasks, ensuring no other application traffic traverses this network.\n\nLogically Separated Communications Paths:\na. Establish secure VPN tunnels for remote maintenance sessions, encrypting all traffic and isolating it from the general network.\n\nb. Configure MariaDB to enforce SSL/TLS encryption for all maintenance connections, ensuring data confidentiality and integrity. Enable SSL in the MariaDB configuration file (\"my.cnf or my.ini\") and configure client applications to use SSL.\n\nc. Implement strict firewall rules on the MariaDB server and network infrastructure to restrict access to the MariaDB port (default 3306) only from authorized maintenance hosts or subnets. This limits the attack surface for unauthorized connections.\n\nd. Define specific roles with limited privileges for maintenance tasks, granting only the necessary permissions to perform maintenance activities and preventing over-privileging of user accounts.\n\nTo verify if MariaDB has implemented Role-Based Access Control (RBAC), check for Active Roles for a current user: \n\nSELECT CURRENT_ROLE();\n\nTo view the grants associated with a specific user: \n\nSHOW GRANTS FOR 'username'@'host';\n\nTo view the grants associated with a specific role: \n\nSHOW GRANTS FOR 'rolename';\n\nThe output of these \"SHOW GRANTS\" commands will reveal if privileges are directly assigned or if they are granted through roles, indicating RBAC implementation.\n\nWhen roles are used, they often need to be activated. If users are explicitly setting roles upon connection or within sessions using \"SET ROLE\", it signifies the use of RBAC.","ccis":["CCI-004192"]},{"vulnId":"V-286237","ruleId":"SV-286237r1292162_rule","severity":"medium","ruleTitle":"MariaDB must include only approved trust anchors in trust stores or certificate stores managed by the organization.","description":"Public key infrastructure (PKI) certificates are certificates with visibility external to organizational systems and certificates related to the internal operations of systems, such as application-specific time services. In cryptographic systems with a hierarchical structure, a trust anchor is an authoritative source (i.e., a certificate authority) for which trust is assumed and not derived. A root certificate for a PKI system is an example of a trust anchor. A trust store or certificate store maintains a list of trusted root certificates.","checkContent":"Verify the certificate authority (CA) trust store configured for MariaDB. As the DBA, run:\n\nSHOW GLOBAL VARIABLES LIKE 'ssl_ca';\n\nIf the \"ssl_ca\" variable is empty and TLS client certificate authentication is required, this is a finding.\n\nVerify the CA file referenced by \"ssl_ca\" exists and is managed by the organization.\n\nExample:\nls -l /etc/my.cnf.d/certs/ca-cert.pem\n\nConfirm the file exists and is owned by the system administrator (SA) or DBA.\n\nIf the file does not exist or is not managed by the organization, this is a finding.\n\nReview the contents of the CA trust store to verify only approved trust anchors are present.\n\nExample:\nopenssl x509 -in /etc/my.cnf.d/certs/ca-cert.pem -text -noout\n\nor, if multiple certificates exist:\n\ngrep \"BEGIN CERTIFICATE\" -n /etc/my.cnf.d/certs/ca-cert.pem\n\nVerify the certificate authorities present match those approved by the organization.\n\nIf unapproved trust anchors are present, this is a finding.","fixText":"Configure MariaDB to include only approved trust anchors in trust stores or certificate stores managed by the organization.\n\nTo configure MariaDB to use only approved trust anchors, identify the CA certificates trusted by the organization and place them in the designated trust store directory (for example \"/etc/pki/ca-trust/source/anchors/\" on Linux). \n\nUpdate the system CA trust store using the appropriate system command.\n\nExample:\nupdate-ca-trust\n\nThis ensures that MariaDB and other applications trust only connections validated by the approved CA certificates.\n\nTo verify SSL/TLS CA certificates are configured in MariaDB, run:\n\nSHOW VARIABLES LIKE '%ssl%';\n\nAdditionally, review the MariaDB configuration or startup file to verify that the \"ssl-ca\" parameter points to the approved CA certificate file.","ccis":["CCI-004909"]},{"vulnId":"V-286238","ruleId":"SV-286238r1292008_rule","severity":"medium","ruleTitle":"MariaDB must provide protected storage for cryptographic keys with organization-defined safeguards and/or hardware protected key store.","description":"A Trusted Platform Module (TPM) is an example of a hardware-protected data store that can be used to protect cryptographic keys.","checkContent":"Verify MariaDB is configured to provide protected storage for cryptographic keys with organization-defined safeguards and/or hardware protected key store.\n\nIf MariaDB is not configured to provide protected storage for cryptographic keys with organization-defined safeguards and/or hardware protected key store, this is a finding.","fixText":"Store TLS private keys and certificate files in a secure directory accessible only to the MariaDB server process.\n\nExample secure directory:\n/etc/my.cnf.d/certs/\n\nSet restrictive ownership and permissions:\n\nchown mysql:mysql /etc/my.cnf.d/certs/*\nchmod 600 /etc/my.cnf.d/certs/*\n\nOnly the MariaDB service account should have read access to private keys.\n\nConfigure MariaDB to use the protected key files in the MariaDB configuration file (\"/etc/my.cnf\" or \"/etc/mysql/my.cnf\").\n\nExample configuration:\n\n[mariadb]\nssl-ca=/etc/my.cnf.d/certs/ca-cert.pem\nssl-cert=/etc/my.cnf.d/certs/server-cert.pem\nssl-key=/etc/my.cnf.d/certs/server-key.pem\nrequire_secure_transport=ON\n\nRestart MariaDB after configuration changes:\n\nsystemctl restart mariadb\n\nIf database encryption is used (for example InnoDB tablespace encryption), configure a secure key management plugin such as the MariaDB File Key Management plugin or an external key management service.\n\nExample configuration for file-based key management:\n\n[mariadb]\nplugin_load_add=file_key_management\nfile_key_management_filename=/etc/mysql/encryption/keyfile\nfile_key_management_filekey=FILE:/etc/mysql/encryption/keyfile.key\nfile_key_management_encryption_algorithm=AES_CTR\n\nProtect the key management files:\n\nchown mysql:mysql /etc/mysql/encryption/*\nchmod 600 /etc/mysql/encryption/*\n\nIf organizational policy requires hardware-protected key storage, configure MariaDB to integrate with an external key management system (for example a hardware security module [HSM] or enterprise key management service) supported by the environment.\n\nVerify that cryptographic key files and key management files are protected using operating system access controls and accessible only to authorized administrators and the MariaDB service account.","ccis":["CCI-004910"]},{"vulnId":"V-286239","ruleId":"SV-286239r1292011_rule","severity":"medium","ruleTitle":"MariaDB must synchronize system clocks within and between systems or system components.","description":"Time synchronization of system clocks is essential for the correct execution of many system services, including identification and authentication processes that involve certificates and time-of-day restrictions as part of access control. Denial of service or failure to deny expired credentials may result without properly synchronized clocks within and between systems and system components. Time is commonly expressed in Coordinated Universal Time (UTC), a modern continuation of Greenwich Mean Time (GMT), or local time with an offset from UTC. The granularity of time measurements refers to the degree of synchronization between system clocks and reference clocks, such as clocks synchronizing within hundreds of milliseconds or tens of milliseconds. Organizations may define different time granularities for system components. Time service can be critical to other security capabilities such as access control and identification and authentication depending on the nature of the mechanisms used to support the capabilities.","checkContent":"Verify the system time synchronization service is active.\n\nOn systems using systemd, run:\n\ntimedatectl status\n\nVerify the following:\n- NTP service: active \nor \n- System clock synchronized: yes\n\nIf the system clock is not synchronized, this is a finding.\n\nIf the system uses chrony, verify the service is running:\n\nsystemctl status chronyd\n\nVerify the service status is active (running).\n\nVerify the system is synchronizing with a time source:\n\nchronyc tracking\n\nIf the system is not synchronized with an external time source, this is a finding.\n\nIf the system uses ntpd, verify the service is running:\n\nsystemctl status ntpd\n\nVerify synchronization peers:\n\nntpq -p\n\nIf no valid synchronization peers are configured, this is a finding.\n\nVerify MariaDB is using the host system time by running:\n\nSELECT NOW();\n\nConfirm the database time aligns with the host system time.\n\nIf MariaDB system time differs significantly from the host system clock, this is a finding.","fixText":"Configure MariaDB to synchronize system clocks within and between systems or system components.\n\nMariaDB does not directly synchronize system clocks. It relies on the underlying operating system for time synchronization. Therefore, verification focuses on ensuring the operating system clock is synchronized with a trusted Network Time Protocol (NTP) source.\n\nCheck system time synchronization status:\n\ntimedatectl status\n\nVerify that the output includes:\n- System clock synchronized: yes\n- NTP service: active\n\nVerify synchronization for systems using ntpd with:\n\nntpstat\n\nA return code of \"0\" indicates the system clock is synchronized.\n\nVerify synchronization for systems using chrony with:\n\nchronyc tracking\n\nConfirm the output indicates synchronization with a reference time source. Values such as \"System time\" and \"Last offset\" should be close to zero, and \"Leap status\" should be \"Normal\".\n\nMariaDB uses the system clock for timestamps, logs, and internal processes. If the operating system clock is synchronized, MariaDB will automatically use the synchronized time.\n\nEnable NTP synchronization if it is not already enabled:\n\nsudo timedatectl set-ntp true\n\nVerify the configuration again:\n\ntimedatectl status\n\nEnsure the system clock is synchronized and the NTP service is active.\n\nAlternatively, configure NTP services such as ntpd or chrony.\n\nExample installation:\nsudo apt install ntp\nsudo systemctl enable --now ntp\n\nEnsure the service is configured with appropriate NTP servers in configuration files such as \"/etc/chrony/chrony.conf\" or \"/etc/ntp.conf\".\n\nVerify the system time zone configuration:\n\nsudo timedatectl set-timezone Region/City\n\nMariaDB normally uses the system time zone. Verify the MariaDB time zone configuration:\n\nSELECT @@global.time_zone, @@session.time_zone;\n\nIf the value is \"SYSTEM\", MariaDB is using the system time zone.\n\nIf required, configure MariaDB to use the system time zone in the configuration file:\n\n[mariadb]\ndefault-time-zone='SYSTEM'\n\nRestart MariaDB after making configuration changes:\n\nsudo systemctl restart mariadb","ccis":["CCI-004922"]}]}