The MariaDB Audit Plugin is included in the MariaDB distribution kit starting with versions 5.5.37 and 10.0.10.
To configure MariaDB event export using the MariaDB Audit Plugin:
mysql -u
<username>
-p
SHOW GLOBAL VARIABLES LIKE 'plugin_dir'
ll
<directory obtained by the previous command>
| grep server_audit.so
If the command output is empty and the plugin is not present in the directory, you can either copy the MariaDB Audit Plugin to that directory or use a newer version of MariaDB.
install plugin server_audit soname 'server_audit.so'
[mysqld]
section, add the following lines:server_audit_logging=1
server_audit_events=connect,table,query_ddl,query_dml,query_dcl
server_audit_output_type=SYSLOG
server_audit_syslog_facility=LOG_SYSLOG
If you want to disable event export for certain audit event groups, remove some of the values from the server_audit_events
setting. Descriptions of settings are available on the MariaDB Audit Plugin vendor's website.
systemctl restart mariadb
for a system with systemd initialization.service mariadb restart
for a system with init initialization.MariaDB Audit Plugin for MariaDB is configured. If necessary, you can run the following commands on the MariaDB command line:
show plugins
to check the list of current plugins.SHOW GLOBAL VARIABLES LIKE 'server_audit%'
to check the current audit settings.