TMAegis
Plus de règles pour mariadb

TMA-MARIADB-6.4

Ensure Audit Logging Is Enabled

ÉlevéeNiveau 2Automatiséemariadb

Description

Enabling audit logging is an important consideration for a production environment, and MariaDB plugin exist to help with this. Enable audit logging for ; Connect events ; Query and Table events (optional) Requires the server_audit plugin with server_audit_logging=ON and CONNECT events audited (an empty server_audit_events audits everything). Runs mariadb -NBe with the client defaults: as root on the server the unix_socket plugin usually authenticates; otherwise put an administrative account in ~/.my.cnf (mode 0600), not MYSQL_PWD (see 1.4/1.6).

Méthode de vérification

Méthode d'audit: Requête SQL

sql_query
out=$(mariadb -NBe "SELECT IF((SELECT VARIABLE_VALUE FROM information_schema.GLOBAL_VARIABLES WHERE LOWER(VARIABLE_NAME) = 'server_audit_logging') = 'ON' AND ((SELECT VARIABLE_VALUE FROM information_schema.GLOBAL_VARIABLES WHERE LOWER(VARIABLE_NAME) = 'server_audit_events') = '' OR FIND_IN_SET('CONNECT', (SELECT VARIABLE_VALUE FROM information_schema.GLOBAL_VARIABLES WHERE LOWER(VARIABLE_NAME) = 'server_audit_events')) > 0), 'compliant', 'noncompliant')" 2>/dev/null) || exit 1; printf '%s\n' "$out"
Sortie attendue
compliant

Méthode de correction

Méthode de correction: Recommandation ou correctif d'infrastructure

Under [mariadbd] add plugin_load_add = server_audit, server_audit_logging=ON and server_audit_events=CONNECT (optionally QUERY_DDL,QUERY_DCL,TABLE), then restart MariaDB.

Propriétés

Systèmes d'exploitation
Tous
Étiquettes
mariadbdatabaseloggingaudit
Référence
CIS MariaDB 10.11 Benchmark v1.0.0 - 6.4 Ensure Audit Logging Is Enabled

Vérifier cet hôte

Exécutez cette commande sur une machine que vous êtes autorisé à auditer. L'analyse est en lecture seule.

shell
tmaegis scan --target mariadb --level 2