Skip to content

aws/audit-plugin-for-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Audit Plugin for MySQL Server

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.

Based on the MariaDB Audit Plugin

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.

Compatibility

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.

Compilation

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/

Installation

  1. Place the file server_audit.so in the plugin directory. You can run SHOW VARIABLES LIKE 'plugin_dir'; to find the correct path.
  2. Activate the plugin by adding plugin_load_add = server_audit to my.cnf or by running INSTALL PLUGIN server_audit SONAME ‘server_audit.so’; once.

Usage

For details on usage, refer to the MariaDB Server documentation:

Contributing

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.