[MDEV-20226] Make plugin activation options into dynamic global system variables Created: 2019-07-31  Updated: 2019-08-03  Resolved: 2019-08-03

Status: Closed
Project: MariaDB Server
Component/s: Configuration, Plugins, Variables
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 1
Labels: None

Issue Links:
Relates
relates to MDEV-19625 Ambiguity between named_pipe system v... Open
relates to MDEV-19636 Usage message for plugin activation o... Closed
relates to MDEV-20236 Add audit plugin API functions to dis... Closed

 Description   

MariaDB Server currently dynamically constructs "plugin activation options", so that plugins can be unloaded at startup, or they can be prevented from being uninstalled, etc.

https://mariadb.com/kb/en/library/plugin-overview/#configuring-plugin-activation-at-server-startup

See here:

https://github.com/MariaDB/server/blob/mariadb-10.4.7/sql/sql_plugin.cc#L3726

Some users would like these options to be fully-fledged global system variables that can be changed dynamically, so you could do things like this:

-- Unload the server_audit plugin dynamically,
-- but don't use UNINSTALL PLUGIN/UNINSTALL SONAME,
-- since that would remove the plugin's entry from mysql.plugins,
-- and prevent it from being reloaded when the server restarts.
SET GLOBAL server_audit=OFF;
 
-- Unload the cracklib_password_check plugin dynamically, 
-- but don't use UNINSTALL PLUGIN/UNINSTALL SONAME,
-- since that would remove the plugin's entry from mysql.plugins,
-- and prevent it from being reloaded when the server restarts.
SET GLOBAL cracklib_password_check=OFF;
 
-- Unload the unix_socket plugin dynamically.
-- In MariaDB 10.4 and later, it is statically linked into
-- the server, so UNINSTALL PLUGIN/UNINSTALL SONAME wouldn't work.
SET GLOBAL unix_socket=OFF;
 
-- Load the server_audit plugin dynamically,
-- and prevent it from being uninstalled.
SET GLOBAL server_audit='FORCE_PLUS_PERMANENT';
 
-- Load the pam plugin dynamically,
-- and prevent it from being uninstalled.
SET GLOBAL pam='FORCE_PLUS_PERMANENT';

The users who requested this also requested that if a plugin gets unloaded dynamically, then the server should remember the plugin's existing system variable values, and it should re-use those values if the plugin is later dynamically reloaded.

However, I am unsure if changing these plugin activation options to dynamic global system variables would actually add value, or if it would actually create more problems.

For example, one potential problem is that it might make 'FORCE_PLUS_PERMANENT' less secure. If a plugin is set to 'FORCE_PLUS_PERMANENT', then a DBA could just dynamically change it to OFF, and then they could uninstall the plugin anyway. i.e. they could do something like this:

SET GLOBAL server_audit='FORCE_PLUS_PERMANENT';
SET GLOBAL server_audit=OFF;
UNINSTALL PLUGIN server_audit;



 Comments   
Comment by Sergei Golubchik [ 2019-08-03 ]

If you want to disable a plugin permanently, use UNINSTALL PLUGIN.
If you want to disable a plugin temporarily, use UNINSTALL PLUGIN to disable and INSTALL PLUGIN to enable.

Generated at Thu Feb 08 08:57:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.