STIGQter STIGQter: STIG Summary: Oracle MySQL 8.0 Security Technical Implementation Guide Version: 1 Release: 1 Benchmark Date: 28 Jan 2021:

The MySQL Database Server 8.0 must enforce approved authorizations for logical access to information and system resources in accordance with applicable access control policies.

DISA Rule

SV-235141r638812_rule

Vulnerability Number

V-235141

Group Title

SRG-APP-000033-DB-000084

Rule Version

MYS8-00-005400

Severity

CAT I

CCI(s)

Weight

10

Fix Recommendation

Configure the MySQL Database Server 8.0 settings and access controls to permit user access only to objects and data that the user is authorized to view or interact with, and to prevent access to all other objects and data.

Use GRANT, REVOKE, ALTER statements to add and remove permissions on server-level securables, bringing them into line with the documented requirements.

Check Contents

Check MySQL settings to determine whether users are restricted from accessing objects and data they are not authorized to access.
Review the system documentation to determine the required levels of protection for DBMS server securables, by type of login.

Review the permissions actually in place on the server.

If the actual permissions do not match the documented requirements, this is a finding.

The following tables contain access control data. Run these scripts:

For information about database-level privileges:
The server uses the user and db tables in the mysql database at both the first and second stages of access control.
SELECT * FROM mysql.db;
SELECT * FROM mysql.user;

During the second stage of access control, the server performs request verification to ensure each client has sufficient privileges for each request it issues.

These provide finer privilege control at the table and column levels.
SELECT * FROM mysql.tables_priv;
SELECT * FROM mysql.columns_priv;

For verification of requests that involve stored routines.
SELECT * FROM mysql.procs_priv;
Information about proxy accounts
SELECT * from mysql.proxies_priv;

Lists current assignments of dynamic global privileges to user accounts.
SELECT * from mysql.global_grants;
Lists default user roles
SELECT * FROM mysql.default_roles;

Lists edges for role subgraphs, showing roles assigned to other roles hierarchy.
SELECT * FROM mysql.role_edges;

To inspect permissions on specific table(s):
WITH
tableprivs AS (SELECT user, host, 'mysql.tables_priv' as PRIV_SOURCE , DB as _db, Table_Name as _obj , ' ' as _col FROM mysql.tables_priv where Table_name like '%' ),
colprivs AS (SELECT User, Host, 'mysql.columns_priv' as PRIV_SOURCE , DB as _db, table_name as _obj , column_name as _col FROM mysql.columns_priv WHERE Table_name like '%' )
SELECT user,host, PRIV_SOURCE , _db as _db, _obj, _col FROM
(
SELECT user,host, PRIV_SOURCE, _db, _obj, _col FROM colprivs UNION
SELECT user,host, PRIV_SOURCE, _db, _obj, _col FROM tableprivs) as tt group by user, host, PRIV_SOURCE, _db, _obj, _col;

To inspect specific user, role or user using role:
Example
User or role
SHOW GRANTS FOR 'app_developer'@'%';
User with Role
SHOW GRANTS FOR 'u1'@'localhost' USING 'r1';

If appropriate access controls are not implemented to restrict access to authorized users and to restrict the access of those users to objects and data they are authorized to see, this is a finding.

Vulnerability Number

V-235141

Documentable

False

Rule Version

MYS8-00-005400

Severity Override Guidance

Check MySQL settings to determine whether users are restricted from accessing objects and data they are not authorized to access.
Review the system documentation to determine the required levels of protection for DBMS server securables, by type of login.

Review the permissions actually in place on the server.

If the actual permissions do not match the documented requirements, this is a finding.

The following tables contain access control data. Run these scripts:

For information about database-level privileges:
The server uses the user and db tables in the mysql database at both the first and second stages of access control.
SELECT * FROM mysql.db;
SELECT * FROM mysql.user;

During the second stage of access control, the server performs request verification to ensure each client has sufficient privileges for each request it issues.

These provide finer privilege control at the table and column levels.
SELECT * FROM mysql.tables_priv;
SELECT * FROM mysql.columns_priv;

For verification of requests that involve stored routines.
SELECT * FROM mysql.procs_priv;
Information about proxy accounts
SELECT * from mysql.proxies_priv;

Lists current assignments of dynamic global privileges to user accounts.
SELECT * from mysql.global_grants;
Lists default user roles
SELECT * FROM mysql.default_roles;

Lists edges for role subgraphs, showing roles assigned to other roles hierarchy.
SELECT * FROM mysql.role_edges;

To inspect permissions on specific table(s):
WITH
tableprivs AS (SELECT user, host, 'mysql.tables_priv' as PRIV_SOURCE , DB as _db, Table_Name as _obj , ' ' as _col FROM mysql.tables_priv where Table_name like '%' ),
colprivs AS (SELECT User, Host, 'mysql.columns_priv' as PRIV_SOURCE , DB as _db, table_name as _obj , column_name as _col FROM mysql.columns_priv WHERE Table_name like '%' )
SELECT user,host, PRIV_SOURCE , _db as _db, _obj, _col FROM
(
SELECT user,host, PRIV_SOURCE, _db, _obj, _col FROM colprivs UNION
SELECT user,host, PRIV_SOURCE, _db, _obj, _col FROM tableprivs) as tt group by user, host, PRIV_SOURCE, _db, _obj, _col;

To inspect specific user, role or user using role:
Example
User or role
SHOW GRANTS FOR 'app_developer'@'%';
User with Role
SHOW GRANTS FOR 'u1'@'localhost' USING 'r1';

If appropriate access controls are not implemented to restrict access to authorized users and to restrict the access of those users to objects and data they are authorized to see, this is a finding.

Check Content Reference

M

Target Key

5277

Comments