Rule ID
SV-286184r1292231_rule
Version
V1R1
CCIs
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. Conversely, if critical tables or other objects rely on unauthorized owner accounts, these objects may be lost when an account is removed.
Review system documentation to identify accounts authorized to have privileges against database objects. Review accounts privileges on objects in the database(s). Show the list of system privileges that the MariaDB server supports: SHOW PRIVILEGES; Run this database query to create the "SHOW GRANTS" script for each user: SELECT DISTINCT CONCAT( 'SHOW GRANTS FOR ', user,'@', host,';') AS grantQuery FROM mysql.user WHERE is_role = 'N'; Example output: +----------------------------------------+ | grantQuery | +----------------------------------------+ | SHOW GRANTS FOR mariadb.sys@localhost; | | SHOW GRANTS FOR root@localhost; | Run each "SHOW GRANTS" command for each user. 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 DBA, run: SELECT * from mysql.proc \G Only DEFINERS of triggers can change triggers. To view all triggers and their DEFINERS as DBA, run: SELECT * from information_schema.triggers \G If any database users are found to have unauthorized privileges on database objects, this is a finding.
Assign ownership of authorized objects to authorized object owner accounts.