SV-253731r1018601_rule
V-253731
SRG-APP-000378-DB-000365
MADB-10-007800
CAT II
10
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.
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, do 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.
V-253731
False
MADB-10-007800
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, do 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.
M
5475