Installing KOVAE
KOVAE can be loaded to the MySQL service by modifying the my.cnf configuration file or running the install plugin statement on the MySQL client. The method of modifying the configuration file needs to restart the database for the modifications to take effect.
Procedure
- Obtain the KOVAE package BoostKit_Kovae_1.1.0.zip and decompress it to obtain the ha_kovae.so file.
For details about the download link, see Table 2.
- Log in to the MySQL service through the MySQL client.
- On the MySQL client, send a statement to query the path where the MySQL plugin plugin_dir is stored:
show variables like "%plugin_dir%";
The following information is displayed, in which /usr/local/mysql-8.0.25/lib/plugin/ indicates the path for storing plugin_dir.
+---------------+--------------------------------+ | Variable_name | Value | +---------------+--------------------------------+ | plugin_dir | /usr/local/mysql-8.0.25/lib/plugin/ | +---------------+--------------------------------+ 1 row in set (0.00 sec)
- Copy the ha_kovae.so file to the path for storing the MySQL plugin.
- Use SFTP or SCP to copy ha_kovae.so to the path where plugin_dir is stored. In this example, the path is /usr/local/mysql-8.0.25/lib/plugin/.
- After copying the file, use a terminal tool such as SSH to log in to the server.
- On the SSH terminal, run the following command to check ha_kovae.so in the path for storing plugin_dir:
ls /usr/local/mysql-8.0.25/lib/plugin/ha_kovae.so
The ha_kovae.so file information is returned as follows:
/usr/local/mysql-8.0.25/lib/plugin/ha_kovae.so
- Grant the execute permission on ha_kovae.so:
chmod 755 /usr/local/mysql-8.0.25/lib/plugin/ha_kovae.so
Check the configured permission on ha_kovae.so:
ll /usr/local/mysql-8.0.25/lib/plugin/ha_kovae.so
The following information is displayed, indicating that the permission on ha_kovae.so is set to -rwxr-xr-x:
-rwxr-xr-x 1 root root 1839816 May 16 17:00 /usr/local/mysql-8.0.25/lib/plugin/ha_kovae.so
- Load the ha_kovae.so plugin to the MySQL service.
Install the KOVAE plugin in either of the following ways.
To prevent buffer overflow attacks, you are advised to use the address space layout randomization (ASLR) technology to randomize the layout of linear areas such as the heap, stack, and shared library mapping to make it more difficult for attackers to predict target addresses and locate code. This technology can be applied to heaps, stacks, and memory mapping areas (mmap base addresses, shared libraries, and vDSO pages).
Run the following command to enable ASLR:
echo 2 > /proc/sys/kernel/randomize_va_space
- Method 1: Automatically load and install the plugin. Add a configuration line under the [mysqld] section in the my.cnf file. Restart the database to make the configuration take effect. For example:
1plugin-load-add=ha_kovae.so - Method 2: Manually load and install the plugin.
- Log in to the MySQL service through the MySQL client.
- Install the ha_kovae.so plugin.
install plugin kovae soname "ha_kovae.so";
If the following information is displayed, the installation is successful:
Query OK, 0 rows affected (0.01 sec)
- Method 1: Automatically load and install the plugin. Add a configuration line under the [mysqld] section in the my.cnf file. Restart the database to make the configuration take effect. For example: