MADB-10-000300 - MariaDB must enforce approved authorizations for logical access to information and system resources in accordance with applicable access control policies.

Information

Authentication with a DoD-approved PKI certificate does not necessarily imply authorization to access MariaDB. To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DoD-approved PKIs, all DoD systems, including databases, must be properly configured to implement access control policies.

Successful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement.

Access control policies include identity-based policies, role-based policies, and attribute-based policies. Access enforcement mechanisms include access control lists, access control matrices, and cryptography. These policies and mechanisms must be employed by the application to control access between users (or processes acting on behalf of users) and objects (e.g., devices, files, records, processes, programs, and domains) in the information system.

This requirement is applicable to access control enforcement applications, a category that includes database management systems. If MariaDB does not follow applicable policy when approving access, it may be in conflict with networks or other applications in the information system. This may result in users either gaining or being denied access inappropriately and in conflict with applicable policy.

NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance.

Solution

Create and/or maintain documentation of each group roles appropriate permissions on database objects.

Implement these permissions in the database and remove any permissions that exceed those documented.

The following are examples of how to use role privileges in MariaDB to enforce access controls. Run these as the database administrator.
For a complete list of privileges, see the official documentation: https://mariadb.com/kb/en/grant/

#### Roles Example 1
The following example demonstrates how to create an admin role with SHUTDOWN privileges.

As the database administrator, run the following SQL:

MariaDB> CREATE ROLE admin;
MariaDB> GRANT SHUTDOWN ON *.* TO admin;

#### Roles Example 2
The following example demonstrates how to create a user make the user a member of the admin role.

As the database administrator, run the following SQL:

MariaDB> CREATE USER 'admin_user'@'host' IDENTIFIED VIA PAM;
MariaDB> GRANT admin TO 'admin_user'@'%';

#### Roles Example 3
The following demonstrates how to revoke privileges from a role using REVOKE.

As the database administrator, run the following SQL:

MariaDB> REVOKE admin FROM 'admin_user'@'host';

#### Roles Example 4
The following demonstrates how to modify privileges for a role using GRANT.

As the database administrator, run the following SQL:

MariaDB> GRANT PROCESS ON *.* TO admin;

The following are examples of how to use grant privileges in MariaDB to enforce access controls on objects.

#### Grant Example 1
The following example demonstrates how to grant INSERT on a table to a role.

As the database administrator, run the following SQL:

MariaDB> GRANT INSERT ON test.t1 TO admin;

#### Grant Example 2
The following example demonstrates how to grant ALL PRIVILEGES on a table to a role.

As the database administrator, run the following SQL:

MariaDB> GRANT ALL PRIVILEGES ON test.t1 TO admin;

#### Grant Example 3
The following example demonstrates how to grant a role to a role.

As the database administrator, run the following SQL:

MariaDB> CREATE ROLE admin_master;
MariaDB> GRANT admin TO admin_master;

#### Revoke Example 1
The following example demonstrates how to revoke access from a role.

As the database administrator, run the following SQL:

MariaDB> REVOKE PROCESS ON *.* FROM admin;

To change authentication requirements for the database, as the OS administrator, review the configuration files /etc/pam.d and /etc/pam.conf.

After changes to the configuration files /etc/pam.d and /etc/pam.conf, reload the server:
# SYSTEMD SERVER ONLY
$ sudo systemctl reload mariadb
# INITD SERVER ONLY
$ sudo service mariadb reload

See Also

https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_MariaDB_Enterprise_10-x_V2R1_STIG.zip

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-3, CAT|I, CCI|CCI-000213, Rule-ID|SV-253668r960792_rule, STIG-ID|MADB-10-000300, Vuln-ID|V-253668

Plugin: MySQLDB

Control ID: 1750f166609e9207b4e1551a1bbcd19ad29737eb791bd9326f1959a60994cad9