[MDEV-20236] Add audit plugin API functions to disable/enable specific audit plugins Created: 2019-08-02 Updated: 2023-04-24 Resolved: 2023-04-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Plugin - Audit, Plugins |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Sergei Golubchik |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
When server_audit_logging=OFF is set, MariaDB Server's Audit Plugin API hooks still call the server_audit plugin's callback functions. This caused performance issues in To prevent issues like this, maybe it would make sense to add a couple audit plugin API functions that can be used to disable/enable specific audit plugins. For example:
That way, if the user sets server_audit_logging=OFF, then the server_audit plugin can tell the audit plugin API to disable its callback functions. And then if the user sets server_audit_logging=ON, then the plugin can tell the audit plugin API to enable its callback functions again. |
| Comments |
| Comment by Sergei Golubchik [ 2019-08-05 ] |
|
I don't think there should be a way to disable auditing at all. Not even server_audit_logging=OFF. |
| Comment by Geoff Montee (Inactive) [ 2019-08-05 ] |
|
Hi serg,
I think the bug is fixed. I heard positive feedback about the test builds that contained the fix, and I haven't heard any complaints yet about last week's releases which also contained the fix. The reason that I created this Jira issue was that I discussed the bug with claudio.nanni and wagnerbianchi, and they were surprised that the plugin still seemed to be doing work when server_audit_logging=OFF was set. They seemed to have the opinion that the plugin shouldn't do anything in this scenario. They thought that you should be able to stop the plugin from doing work without being forced to uninstall it. In my opinion, the current design is probably fine, as long as the plugin's callback functions are designed to have minimal overhead when server_audit_logging=OFF is set. I think that may be true now that
Oh, you think that allowing the option to disable audit logging with server_audit_logging=OFF was bad design to begin with? I checked the documentation for the MySQL Enterprise Audit plugin, and it doesn't look like that plugin have this capability, so MySQL's engineering team might agree with you. https://dev.mysql.com/doc/refman/8.0/en/audit-log-installation.html https://dev.mysql.com/doc/refman/8.0/en/audit-log-logging-configuration.html https://dev.mysql.com/doc/refman/8.0/en/audit-log-reference.html#audit-log-option-variable-reference It doesn't looks like Percona's audit plugin has this capability either. https://www.percona.com/doc/percona-server/8.0/management/audit_log_plugin.html
Good point. Would you consider that a bug? |
| Comment by Claudio Nanni [ 2019-08-06 ] |
|
I think this is the main point to me:
As reported by Wagner in such situation the plugin was doing a lot of work so much that he had to uninstall it to avoid impact on the server. So at that point I have supposed that `server_audit_logging=OFF` was meant to stop writing to log but not stop the background audit job, while it seems after all that's not the case (it should actually stop audit activity) and the background work was consequence of some bugs. In general I think it's good to be able to disable a plugin, and apparently Sergei suggests that it's the job of `UNINSTALL. |
| Comment by Geoff Montee (Inactive) [ 2019-08-06 ] |
|
Hi wagnerbianchi,
When the server_audit option is set to OFF at startup, it prevents the plugin from being loaded. If this option were somehow made into a system variable (as requested by It sounds like what you actually want is for the plugin to have minimal overhead when server_audit_logging=OFF is set. That should be the case now that |