Check: MADB-10-007800
MariaDB Enterprise 10.x STIG:
MADB-10-007800
(in versions v1 r3 through v1 r2)
Title
MariaDB must prohibit user installation of logic modules (stored procedures, functions, triggers, views, etc.) without explicit privileged status. (Cat II impact)
Discussion
Allowing regular users to install software, without explicit privileges, creates the risk that untested or potentially malicious software will be installed on the system. Explicit privileges (escalated or administrative privileges) provide the regular user with explicit capabilities and control that exceed the rights of a regular user. DBMS functionality and the nature and requirements of databases will vary; so while users are not permitted to install unapproved software, there may be instances where the organization allows the user to install approved software packages such as from an approved software repository. The requirements for production servers will be more restrictive than those used for development and research. The DBMS must enforce software installation by users based upon what types of software installations are permitted (e.g., updates and security patches to existing software) and what types of installations are prohibited (e.g., software whose pedigree with regard to being potentially malicious is unknown or suspect by the organization). In the case of a database management system, this requirement covers stored procedures, functions, triggers, views, etc.
Check Content
If MariaDB supports only software development, experimentation and/or developer-level testing (that is, excluding production systems, integration testing, stress testing, and user acceptance testing), this is not a finding. Review MariaDB and database security settings with respect to nonadministrative users ability to create, alter, or replace logic modules, to include but not necessarily only stored procedures, functions, triggers, and views. 1. To list the privileges for all users on all tables and schemas, as the database administrator, run the following: Gather a list of SHOW GRANTS commands. SHOW GRANTS will list the privileges granted to the account. Run this script to create the SHOW GRANTS script for each user: MariaDB> SELECT DISTINCT CONCAT( 'SHOW GRANTS FOR ', user,'@', host,';') AS grantQuery FROM mysql.user WHERE is_role = 'N'; Run each SHOW GRANTS command for each user. 2. Only DEFINERS of routines (functions and procedures) can change routines. To view the DEFINERS of all functions and procedures, as database administrator run the following SQL: MariaDB> SELECT * FROM mysql.proc \G 3. Only DEFINERS of triggers can change triggers. To view all triggers and their DEFINERS, as database administrator run the following SQL: MariaDB> SELECT * FROM information_schema.triggers \G 4. 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, as described previously. 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 might be taken. If any such permissions exist and are not documented and approved, this is a finding.
Fix Text
Document and obtain approval for any nonadministrative users who require the ability to create, alter, or replace logic modules. Check the security guide to implement the approved permissions. Revoke any unapproved permissions.
Additional Identifiers
Rule ID: SV-253731r879751_rule
Vulnerability ID: V-253731
Group Title: SRG-APP-000378-DB-000365
Expert Comments
CCIs
Number | Definition |
---|---|
CCI-001812 |
The information system prohibits user installation of software without explicit privileged status. |
Controls
Number | Title |
---|---|
CM-11 (2) |
Prohibit Installation Without Privileged Status |