Check: MADB-10-002900
MariaDB Enterprise 10.x STIG:
MADB-10-002900
(in versions v1 r3 through v1 r2)
Title
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. (Cat II impact)
Discussion
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 definers 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. Conversely, if critical tables or other objects rely on unauthorized owner accounts, these objects may be lost when an account is removed.
Check Content
Review system documentation to identify accounts authorized to have privileges against database objects. Review account privileges on objects in the database(s). To show the list of system privileges that the MariaDB server supports, run: MariaDB> SHOW PRIVILEGES; Gather a list of SHOW GRANTS commands. SHOW GRANTS will list the privileges granted to the account. Run this database query 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. MariaDB> SHOW GRANTS FOR 'user'@'host'; Verify that all users have the correct privileges, if they do not, this is a finding. 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 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 If any database users are found to have unauthorized privileges on database objects, this is a finding.
Fix Text
Assign ownership of authorized objects to authorized object owner accounts.
Additional Identifiers
Rule ID: SV-253688r879586_rule
Vulnerability ID: V-253688
Group Title: SRG-APP-000133-DB-000200
Expert Comments
CCIs
Number | Definition |
---|---|
CCI-001499 |
The organization limits privileges to change software resident within software libraries. |
Controls
Number | Title |
---|---|
CM-5 (6) |
Limit Library Privileges |