The Audit Plugin for MySQL Server is used by Amazon RDS for MySQL to enable logging of server activity, typically for security and compliance purposes.
The plugin source code is published openly on Github as a service to the community of MySQL and MariaDB users. Amazon Web Services does not offer any warranties or support for the plugin. The intended audience is software developers with C++ skills who are able to independently compile and use the plugin.
This plugin is not official and not associated with MySQL. MySQL is a registered trademark of Oracle and/or its affiliates.
This plugin is based on the MariaDB Audit Plugin.
In MySQL 5.6, the plugin API was compatible with the MariaDB Audit Plugin. In MySQL 5.7 and 8.0, the plugin APIs have however diverged significantly. So, Amazon RDS for MariaDB created a modified version that is compatible with MySQL 5.7 and 8.0.
This version maintains the functionality of the original audit plugin where possible, but adapts the plugin to use the MySQL 8.0 plugin API.
To view the MySQL 5.7 compatible version, see the branch mysql-5.7
in this
repository.
This plugin has been tested and verified on Amazon Linux OS https://aws.amazon.com/amazon-linux-2. It has not been tested on other operating systems and does not support Windows OS.
Copy the plugin source code on top of the sources of MySQL using the following command so it compiles as part of the MySQL build:
rsync -av plugin/ <mysqlSourceFolder>/plugin/
mysql-test is optional unless you want to run MTR tests:
rsync -av mysql-test/ <mysqlSourceFolder>/mysql-test/
- Place the file
server_audit.so
in the plugin directory. You can runSHOW VARIABLES LIKE 'plugin_dir';
to find the correct path. - Activate the plugin by adding
plugin_load_add = server_audit
tomy.cnf
or by runningINSTALL PLUGIN server_audit SONAME ‘server_audit.so’;
once.
For details on usage, refer to the MariaDB Server documentation:
There are no plans to add any major features to this plugin. If you have modifications to improve the auditing in MySQL/MariaDB, we recommend contributing to the MariaDB Server project, where the whole server and the original audit plugin is developed in a large and active open source community.
This Audit Plugin for MySQL does accept contributions, but the goal of the project is mainly to be stable and bug free. Notes for developers can be found in DEVELOP.md.