MADB-10-011900 - MariaDB must generate audit records when unsuccessful accesses to objects occur.

Information

Without tracking all or selected types of access to all or selected objects (tables, views, procedures, functions, etc.), it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.

In an SQL environment, types of access include, but are not necessarily limited to:
SELECT
INSERT
UPDATE
DELETE
EXECUTE

To aid in diagnosis, it is necessary to keep track of failed attempts in addition to the successful ones.

NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance.

Solution

If the MariaDB Enterprise Audit plugin is not active, enable it in one of the two following ways.

1. Config file (requires restart):

[mariadb]
server_audit_logging = ON

2. SQL (does not require restart):

MariaDB> SET GLOBAL server_audit_logging=ON;

Once the MariaDB Enterprise Audit plugin is loaded, verify the MariaDB Enterprise Audit plugin is loaded and actively logging:

MariaDB> SHOW GLOBAL STATUS LIKE 'Server_audit_active';

If the necessary auditing is not in place for all or specific users, modify the filters.

To modify the default filter, delete and recreate:

MariaDB> DELETE FROM mysql.server_audit_filters WHERE filtername = 'default';

MariaDB> INSERT INTO mysql.server_audit_filters (filtername, rule)
VALUES ('default',
JSON_COMPACT(
'{
'logging':'ON',
'connect_event':'ALL',
'query_event':'ALL',
'table_event':'ALL'
}'
));

Specific objects can be added to filters with inclusion or exclusion.

ignore_databases: Do not log actions on these databases.
ignore_tables: Do not log actions on these tables.
databases: Log actions on these databases.
tables: Log actions on these tables.

Example:

MariaDB> INSERT INTO mysql.server_audit_filters (filtername, rule)
VALUES (
'reporting',
JSON_COMPACT(
'{
'tables': [
'production.*',
'reporting.*',
{
'table_event': [
'WRITE',
'CREATE',
'DROP',
'RENAME',
'ALTER'
],
'query_event': [
'DML',
'DDL',
{
'ignore_tables': [
'production.customer_profiles',
'production.customer_addresses'
]
}
]
}
]
}'
)
);

See Also

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

Item Details

Category: AUDIT AND ACCOUNTABILITY

References: 800-53|AU-12c., CAT|II, CCI|CCI-000172, Rule-ID|SV-253771r961836_rule, STIG-ID|MADB-10-011900, Vuln-ID|V-253771

Plugin: MySQLDB

Control ID: 1a2e44604b52ffd361240134e6ea852ba64025defe91457cc9b94c874fe06bd7