Rule ID
SV-286186r1291852_rule
Version
V1R1
CCIs
Information systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions). It is detrimental for software products to provide, or install by default, functionality exceeding requirements or mission objectives. Examples include, but are not limited to, installing advertising software, demonstrations, or browser plugins not related to requirements or providing a wide array of functionality, not required for every mission, that cannot be disabled. DBMSs must adhere to the principles of least functionality by providing only essential capabilities. Demonstration and sample database objects and applications present publicly known attack points for malicious users. These demonstration and sample objects are meant to provide simple examples of coding specific functions and are not developed to prevent vulnerabilities from being introduced to the DBMS and host system.
As the DBA (shown here as root) run:
mariadb -u root -p
List all databases present on the server:
SHOW DATABASES;
Review 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:
test
sample
demo
If any demonstration or sample databases are present and not required by the organization, this is a finding.
Review the contents of remaining databases for demonstration or sample objects:
SELECT TABLE_SCHEMA, TABLE_NAME
FROM information_schema.tables
WHERE TABLE_SCHEMA NOT IN ('mysql','information_schema','performance_schema','sys');
Verify that no demonstration or sample tables, procedures, or objects remain.
If demonstration or sample objects are identified and not required by the organization, this is a finding.
Verify that the default test database is not accessible to unauthorized users:
SELECT host, db, user
FROM mysql.db
WHERE db='test';
If the test database exists or privileges are granted for it, this is a finding.
Verify 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.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. $ mysql_secure_installation Reply "Y" when prompted to set a root password if one is not already configured. Reply "Y" when prompted to remove anonymous users. Reply "Y" when prompted to disallow root login remotely. Reply "Y" when prompted to remove the test database and access to it. Reply "Y" when prompted to reload the privilege tables. This ensures that all changes take effect immediately. Note: 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.