<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>MySQL Forums - Security</title>
        <description>Forum for MySQL Security.</description>
        <link>https://forums.mysql.com/list.php?30</link>
        <lastBuildDate>Fri, 10 Apr 2026 17:27:31 +0000</lastBuildDate>
        <generator>Phorum 5.2.23</generator>
        <item>
            <guid>https://forums.mysql.com/read.php?30,741421,741421#msg-741421</guid>
            <title>Encryption can&#039;t find master key, please check the keyring is loaded (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,741421,741421#msg-741421</link>
            <description><![CDATA[ Hello everyone,<br />
After upgrading MySQL Enterprise from 8.0.32 to 8.4.7 on Red Hat Enterprise Linux 8, I’m now getting the following error whenever I try to access encrypted InnoDB tables:<br />
<br />
ERROR 3185 (HY000): Encryption can&#039;t find master key, please check the keyring is loaded<br />
<br />
The mysqld service starts without issues, but any query against tables that use tablespace encryption (TDE) fails with the error above.What I have already checked:The same keyring plugin that worked on 8.0.32 is configured (keyring_file, keyring_encrypted_file, or keyring_oci – same as before)<br />
The keyring file is present in the expected location with correct ownership/permissions (owned by mysql:mysql, 660)<br />
early-plugin-load is correctly set in my.cnf<br />
No errors related to the keyring appear in the MySQL error log during startup<br />
<br />
Is there any change in master key handling or keyring migration procedure between MySQL 8.0 and 8.4 that I might have missed when TDE is enabled? Do I need to rotate or re-import the master encryption key after this kind of major version upgrade?Any help or pointers would be greatly appreciated!<br />
<br />
Thank you in advance!]]></description>
            <dc:creator>Stefano Pisani</dc:creator>
            <category>Security</category>
            <pubDate>Tue, 25 Nov 2025 16:32:16 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,741152,741152#msg-741152</guid>
            <title>Encryption information in datafile can&#039;t be decrypted, confirm that keyring is loaded (2 replies)</title>
            <link>https://forums.mysql.com/read.php?30,741152,741152#msg-741152</link>
            <description><![CDATA[ Hello Team,<br />
<br />
I am currently working on enabling Transparent Data Encryption (TDE) on MySQL using KMIP-managed keys. I have successfully configured the keyring_okv plugin and was able to encrypt tables using keys stored on the KMIP server.<br />
<br />
From the KMIP server logs, it is evident that Locate requests are being initiated by the MySQL client, however the server shows the following error:<br />
kmip.server.engine - ERROR - &#039;NoneType&#039; object has no                                                                                                                                                                                                               attribute &#039;applies_to_object_types<br />
<br />
This suggests that the KMIP server is unable to properly process the Locate request, possibly due to missing or malformed key objects.<br />
<br />
Could this issue be related to the keyring_okv plugin configuration or its interaction with the KMIP server?<br />
<br />
Thanks,<br />
Imaan Ahmad]]></description>
            <dc:creator>Imaan Ahmad</dc:creator>
            <category>Security</category>
            <pubDate>Wed, 03 Sep 2025 11:56:11 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,741082,741082#msg-741082</guid>
            <title>Unable to access data after securring the database (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,741082,741082#msg-741082</link>
            <description><![CDATA[ If we use the following setting in the config file, we are able to access the data in the database.<br />
<br />
&lt;add key=&quot;app&quot; value=&quot;server=server001;port=3306;database=db;uid=readonly;pwd=readonly;&quot; /&gt;<br />
<br />
This gets flagged in a Fortify scan. We can connect to the DB via an SSL certificate in Workbench. We change the value string in the above to the below, and suddenly we can&#039;t get the data to come up in our site.<br />
<br />
&lt;add key=&quot;app&quot; value=&quot;server=server001;port=3306;database=db;uid=readonly;pwd=readonly;Encrypt=yes;TrustServerCertificate=yes&quot; /&gt;]]></description>
            <dc:creator>Matt Brown</dc:creator>
            <category>Security</category>
            <pubDate>Thu, 14 Aug 2025 19:56:08 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,741044,741044#msg-741044</guid>
            <title>Error encountered while generating keys using the keyring_okv plugin (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,741044,741044#msg-741044</link>
            <description><![CDATA[ We’ve installed the MySQL Enterprise edition (Trial version) on a Windows client and configured the keyring_okv.dll plugin to connect to our KMIP server. The MySQL server appears to be connecting to the KMIP server successfully (I have also tested the connection from the windows server to the KMIP server)<br />
<br />
However, when we attempt to generate a key using the keyring_key_generate function, we encounter the following error:<br />
<br />
Function &#039;keyring_key_generate&#039; failed because underlying keyring service returned an error. Please check if a keyring is installed and that provided arguments are valid for the keyring you are using.<br />
[Server] Plugin keyring_okv reported: &#039;Could not add attribute, attribute_name=x-key-id attribute value=Key1&#039;<br />
[Server] Plugin keyring_okv reported: &#039;Could not flush keys to keyring&#039;.<br />
<br />
Has anyone faced a similar issue or can provide help with what might cause the x-key-id attribute error?<br />
<br />
Any help or pointers would be greatly appreciated.]]></description>
            <dc:creator>Imaan Ahmad</dc:creator>
            <category>Security</category>
            <pubDate>Mon, 04 Aug 2025 17:05:03 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,740631,740631#msg-740631</guid>
            <title>management of mysql-keyring file (5 replies)</title>
            <link>https://forums.mysql.com/read.php?30,740631,740631#msg-740631</link>
            <description><![CDATA[ Hi,<br />
I&#039;m trying to implement my own keyring file management mechanism on Linux OS.<br />
I searched documentation and I didn&#039;t find any information when exactly MySQL accesses mysql-keyring file. <br />
<br />
Would you like to confirm if it&#039;s safe to move keyring file (to other safe place) after MySQL starts? <br />
When exactly I need provide mysql-keyring file to proper component directory pointed in configuration?<br />
<br />
I found only that for migration purpose it should be on place before key rotation and during startup of mysqld. Anything else? <br />
<br />
If it&#039;s somewhere described, I would be happy to read more about access file mechanism.]]></description>
            <dc:creator>Krzysztof Wróblewski</dc:creator>
            <category>Security</category>
            <pubDate>Mon, 06 Apr 2026 14:17:08 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,740521,740521#msg-740521</guid>
            <title>SSL connection error: error:0A000086:SSL routines::certificate verify failed (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,740521,740521#msg-740521</link>
            <description><![CDATA[ Hello, <br />
<br />
I&#039;m dealing with a problem that&#039;s taking up far too much of my time. I must have spent around 30 hours on the subject and I&#039;m starting to overdose.<br />
<br />
Let me explain what I&#039;m dealing with: I want to use MySQL to replicate 2 databases. Everything was working fine, I was able to replicate correctly.<br />
<br />
But then I got a message telling me that it&#039;s not safe to let the password show through, so I need to use the SSL/TLS protocol to make things more secure<br />
and not have the password in clear text on the network (even though I&#039;m on a LAN). <br />
To do this, I used the .pem files created automatically during installation with MySQL, i.e. my ca.pem - client-cert.pem - client-key.pem files that I sent to my 2nd server (the slave). Once the rights had been given, as well as the correct group, I initialised the connection between my slave and my master. except that I came up against the following error: <br />
<br />
‘Last_IO_Error: Error connecting to source ‘replication@192.168.1.10:3306’. This was attempt 16162/86400, with a delay of 20 seconds between attempts. Message: SSL connection error: error:0A000086:SSL routines::certificate verify failed’<br />
<br />
I&#039;ve spent countless hours trying to find out why this error is appearing, and I can&#039;t figure it out. I&#039;ve looked everywhere (maybe not enough?) but I just don&#039;t get it, and I&#039;d welcome any help.<br />
<br />
I&#039;d also like to point out that I originally thought it was the fault of the certificate generated by MySQL that wasn&#039;t working, but I finally regenerated all the certificates with openssl to see if that was the cause.<br />
to see if it was coming from there, but apparently not, I have the same problem. (I generated the ca.pem - ca-key.pem - client-cert.pem - client-key.pem - server-cert.pem - server-key.pem.<br />
I also signed the certificates with the ca.pem and normally I have my certificates set to CA=True and not false on my client and server, but that doesn&#039;t seem to have a<br />
change. I should also point out that I have changed the following parameter: SOURCE_SSL_VERIFY_SERVER_CERT=1 to ‘0’ and the connection works again, which I suppose is logical because of course<br />
I also tested a command line connection with the certificates, but I don&#039;t think this proves anything about the validity of my certificates ?<br />
mysql -h 192.168.1.10 -u replication -p --ssl-ca=ca.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem / This command works and I connect.<br />
<br />
Here are all my configurations for the first server, the master (the one with the server certificates)<br />
<br />
1/ Configuration my.cnf :<br />
<br />
[mysqld]<br />
log-bin=master1<br />
server-id=1<br />
binlog-format=mixed<br />
relay-log=relay-log-master1<br />
bind-address=0.0.0.0<br />
ssl-ca=ca.pem<br />
ssl-cert=server-cert.pem<br />
ssl-key=server-key.pem<br />
require_secure_transport=ON<br />
<br />
2/ MySQL parameters :<br />
mysql&gt; SHOW VARIABLES LIKE &#039;%ssl%&#039;;<br />
+-------------------------------------+-----------------+<br />
| Variable_name                       | Value           |<br />
+-------------------------------------+-----------------+<br />
| admin_ssl_ca                        |                 |<br />
| admin_ssl_capath                    |                 |<br />
| admin_ssl_cert                      |                 |<br />
| admin_ssl_cipher                    |                 |<br />
| admin_ssl_crl                       |                 |<br />
| admin_ssl_crlpath                   |                 |<br />
| admin_ssl_key                       |                 |<br />
| have_openssl                        | YES             |<br />
| have_ssl                            | YES             |<br />
| mysqlx_ssl_ca                       |                 |<br />
| mysqlx_ssl_capath                   |                 |<br />
| mysqlx_ssl_cert                     |                 |<br />
| mysqlx_ssl_cipher                   |                 |<br />
| mysqlx_ssl_crl                      |                 |<br />
| mysqlx_ssl_crlpath                  |                 |<br />
| mysqlx_ssl_key                      |                 |<br />
| performance_schema_show_processlist | OFF             |<br />
| ssl_ca                              | ca.pem          |<br />
| ssl_capath                          |                 |<br />
| ssl_cert                            | server-cert.pem |<br />
| ssl_cipher                          |                 |<br />
| ssl_crl                             |                 |<br />
| ssl_crlpath                         |                 |<br />
| ssl_fips_mode                       | OFF             |<br />
| ssl_key                             | server-key.pem  |<br />
| ssl_session_cache_mode              | ON              |<br />
| ssl_session_cache_timeout           | 300             |<br />
+-------------------------------------+-----------------+<br />
<br />
3/File in /var/lib/MySQL : <br />
<br />
-rw------- 1 mysql mysql 1,7K mars  28 14:14  server-key.pem<br />
-rw-r--r-- 1 mysql mysql 1,4K mars  28 14:14  server-cert.pem<br />
-rw------- 1 mysql mysql 1,7K mars  28 14:14  client-key.pem<br />
-rw-r--r-- 1 mysql mysql 1,3K mars  28 14:14  ca.pem<br />
-rw------- 1 mysql mysql 1,7K mars  28 14:14  ca-key.pem<br />
-rw-r--r-- 1 mysql mysql 1,4K mars  28 14:14  client-cert.pem<br />
<br />
openssl verify -CAfile /var/lib/mysql/ca.pem /var/lib/mysql/server-cert.pem<br />
/var/lib/mysql/server-cert.pem: OK<br />
<br />
<br />
<br />
Slave side (customer) :<br />
<br />
[mysqld]<br />
log-bin=slave1<br />
server-id=2<br />
binlog-format=mixed<br />
relay-log=relay-log-slave1<br />
<br />
2/ Configuration file in /var/lib/MySQL :<br />
-rw-r--r-- 1 mysql mysql 1,3K mars  28 14:46  ca.pem<br />
-rw------- 1 mysql mysql 1,7K mars  28 14:46  client-key.pem<br />
-rw-r--r-- 1 mysql mysql 1,4K mars  28 14:46  client-cert.pem<br />
<br />
3/ Replica configuration :<br />
CHANGE REPLICATION SOURCE TO<br />
  SOURCE_HOST=&#039;192.168.1.10&#039;,<br />
  SOURCE_USER=&#039;replication&#039;,<br />
  SOURCE_PASSWORD=&#039;password&#039;,<br />
  SOURCE_PORT=3306,<br />
  SOURCE_LOG_FILE=&#039;master1.000011&#039;,<br />
  SOURCE_LOG_POS=157,<br />
  SOURCE_CONNECT_RETRY=20,<br />
  SOURCE_SSL_CA=&#039;/var/lib/mysql/ca.pem&#039;,<br />
  SOURCE_SSL_CERT=&#039;/var/lib/mysql/client-cert.pem&#039;,<br />
  SOURCE_SSL_KEY=&#039;/var/lib/mysql/client-key.pem&#039;,<br />
  SOURCE_SSL_VERIFY_SERVER_CERT=1, <br />
  GET_SOURCE_PUBLIC_KEY=1,<br />
  SOURCE_SSL=1;]]></description>
            <dc:creator>Boisseau Nicolas</dc:creator>
            <category>Security</category>
            <pubDate>Tue, 01 Apr 2025 11:52:18 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,740158,740158#msg-740158</guid>
            <title>Problem with caching_sha2_password and proxy/proxied user (3 replies)</title>
            <link>https://forums.mysql.com/read.php?30,740158,740158#msg-740158</link>
            <description><![CDATA[ Hi,<br />
<br />
I am currently setting up a completely new MySQL 8.4 server in order to migrate an old server to it.<br />
In the course of the work, all users are to be newly created with caching_sha2_password passwords.<br />
Furthermore, users should be given their rights with the help of proxy/proxied user roles.<br />
The creation of users and subsequent login works without any problems.<br />
However, problems occur when I assign rights to the users via grant proxy.<br />
The rights are not transferred to the users.<br />
<br />
However, if I change the hashing procedure from caching_sha2_ppassword to sha256_password, the assignment of rights works (same user only a change of the password module).<br />
For security reasons and for testing I created 2 users, same result,<br />
test_user_6 is working, test_user-7 isn&#039;t working:<br />
<br />
| test_user_6                     | sha256_password       |<br />
| test_user_7                     | caching_sha2_password |<br />
<br />
mysql&gt; show grants for &#039;test_user_6&#039;@&#039;10.234.16.0/255.255.255.0&#039;;<br />
+---------------------------------------------------------------------------------------+<br />
| Grants for <a href="mailto:&#116;&#101;&#115;&#116;&#95;&#117;&#115;&#101;&#114;&#95;&#54;&#64;&#49;&#48;&#46;&#50;&#51;&#52;&#46;&#49;&#54;">&#116;&#101;&#115;&#116;&#95;&#117;&#115;&#101;&#114;&#95;&#54;&#64;&#49;&#48;&#46;&#50;&#51;&#52;&#46;&#49;&#54;</a>.0/255.255.255.0                                      |<br />
+---------------------------------------------------------------------------------------+<br />
| GRANT USAGE ON *.* TO `test_user_6`@`10.234.16.0/255.255.255.0`                       |<br />
| GRANT PROXY ON `bc_monitoring_proxy`@`%` TO `test_user_6`@`10.234.16.0/255.255.255.0` |<br />
+---------------------------------------------------------------------------------------+<br />
2 rows in set (0,00 sec)<br />
<br />
mysql&gt; show grants for &#039;test_user_7&#039;@&#039;10.234.16.0/255.255.255.0&#039;;<br />
+---------------------------------------------------------------------------------------+<br />
| Grants for <a href="mailto:&#116;&#101;&#115;&#116;&#95;&#117;&#115;&#101;&#114;&#95;&#55;&#64;&#49;&#48;&#46;&#50;&#51;&#52;&#46;&#49;&#54;">&#116;&#101;&#115;&#116;&#95;&#117;&#115;&#101;&#114;&#95;&#55;&#64;&#49;&#48;&#46;&#50;&#51;&#52;&#46;&#49;&#54;</a>.0/255.255.255.0                                      |<br />
+---------------------------------------------------------------------------------------+<br />
| GRANT USAGE ON *.* TO `test_user_7`@`10.234.16.0/255.255.255.0`                       |<br />
| GRANT PROXY ON `bc_monitoring_proxy`@`%` TO `test_user_7`@`10.234.16.0/255.255.255.0` |<br />
+---------------------------------------------------------------------------------------+<br />
2 rows in set (0,00 sec)<br />
<br />
<br />
Does caching_sha2 not yet support the assignment of proxy rights?<br />
I can&#039;t find anything about restrictions in this regard and also the documentation: <br />
<a href="https://dev.mysql.com/doc/refman/8.4/en/proxy-users.html"  rel="nofollow">https://dev.mysql.com/doc/refman/8.4/en/proxy-users.html</a><br />
does not indicate any problems with the module.<br />
<br />
The proxy rules under [mysqld] currently look like this:<br />
check_proxy_users=ON<br />
sha256_password_proxy_users=ON<br />
<br />
I would be very grateful for any advice<br />
<br />
Best<br />
<br />
Silvio]]></description>
            <dc:creator>Silvio Schloeffel</dc:creator>
            <category>Security</category>
            <pubDate>Thu, 30 Jan 2025 10:32:27 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,730004,730004#msg-730004</guid>
            <title>MySQL FLUSH_PRIVILEGES: A new dynamic privilege to execute FLUSH PRIVILEGES (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,730004,730004#msg-730004</link>
            <description><![CDATA[ <a href="https://blogs.oracle.com/mysql/post/flushprivileges-a-new-dynamic-privilege-to-execute-flush-privileges"  rel="nofollow">https://blogs.oracle.com/mysql/post/flushprivileges-a-new-dynamic-privilege-to-execute-flush-privileges</a>]]></description>
            <dc:creator>Edwin Desouza</dc:creator>
            <category>Security</category>
            <pubDate>Mon, 28 Oct 2024 23:40:28 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,729999,729999#msg-729999</guid>
            <title>How to use passkeys to authenticate to MySQL (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,729999,729999#msg-729999</link>
            <description><![CDATA[ <a href="https://blogs.oracle.com/mysql/post/how-to-use-passkeys-to-authenticate-to-mysql"  rel="nofollow">https://blogs.oracle.com/mysql/post/how-to-use-passkeys-to-authenticate-to-mysql</a>]]></description>
            <dc:creator>Edwin Desouza</dc:creator>
            <category>Security</category>
            <pubDate>Mon, 28 Oct 2024 22:47:14 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,728062,728062#msg-728062</guid>
            <title>MySQL:  OpenID Connect (Oauth2 - JWT) Authentication (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,728062,728062#msg-728062</link>
            <description><![CDATA[ MySQL:  OpenID Connect (Oauth2 - JWT) Authentication<br />
- <a href="https://blogs.oracle.com/mysql/post/openid-connect-oauth2-jwt-authentication-support-in-mysql"  rel="nofollow">https://blogs.oracle.com/mysql/post/openid-connect-oauth2-jwt-authentication-support-in-mysql</a>]]></description>
            <dc:creator>Edwin Desouza</dc:creator>
            <category>Security</category>
            <pubDate>Tue, 22 Oct 2024 15:16:22 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,726874,726874#msg-726874</guid>
            <title>mysql_native_password deprecation plans (2 replies)</title>
            <link>https://forums.mysql.com/read.php?30,726874,726874#msg-726874</link>
            <description><![CDATA[ Hi,<br />
We see that the default authentication plugin has changed from mysql_native_password to caching_sha2_password.<br />
<br />
We know we have to (and are in the process of) migrating over to caching_sha2_password.<br />
<br />
Our question: will mysql_native_password actually be REMOVED from mysql? Will it stop working any time (soon-ish) or is it just a default that has changed?<br />
<br />
Thanks!]]></description>
            <dc:creator>Mou Rik</dc:creator>
            <category>Security</category>
            <pubDate>Thu, 10 Oct 2024 19:07:13 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,725763,725763#msg-725763</guid>
            <title>question on &quot;--ssl-ca&quot; flag during ssl connection (1 reply)</title>
            <link>https://forums.mysql.com/read.php?30,725763,725763#msg-725763</link>
            <description><![CDATA[ I&#039;ve a mysql server running on redhat8 and enabled it for TLS/SSL one way authentication.<br />
<br />
my question is about the significance of using &quot;--ssl-ca&quot; to validate the server certificate , given that there are instances where  mysql client/shell (probably version 8 or older)  getting connected successfully to the server without providing --ssl-ca as a part of connection.<br />
<br />
I thought it was an expected behavior. in the above case i assume connections are  still secure its just that,  server certificate were not validated from the client side.<br />
<br />
i assume its the responsibility of the connecting client or application to validate/verify that the certificate from their end .<br />
<br />
if my assumption was wrong , Does server can act as a gate keeper or does have  any setting on the server side which could dictate incoming client connections to validate its certificate and restrict the connection if its not.<br />
<br />
request your valuable input on the matter.<br />
<br />
Thanks,<br />
Sri]]></description>
            <dc:creator>sridhar subramanya</dc:creator>
            <category>Security</category>
            <pubDate>Thu, 29 Aug 2024 07:57:12 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,725573,725573#msg-725573</guid>
            <title>FIPS mode help! (2 replies)</title>
            <link>https://forums.mysql.com/read.php?30,725573,725573#msg-725573</link>
            <description><![CDATA[ I installed MySQL 8.0.38 Community Server on my Windows machine, but when I try to turn on FIPS mode, I get an error:<br />
<br />
ERROR] [MY-011272] [Server] SSL fips mode error: error:12800067:DSO support routines::could not load the shared library<br />
<br />
<br />
I believe running this running this query<br />
mysql&gt; show status like &#039;%Tls_library_version%&#039;;<br />
OpenSSL 3.0.13 30 Jan 2024<br />
<br />
shows that MySQL was build with that version of OpenSSL.<br />
<br />
<br />
Reading OpenSSL documentation, the last FIPS compliant version is actually 3.0.9.  so I downloaded the OpenSSL 3.0.9 source and built it with the FIPS flag and installed it on the machine (I do see various DLLs related to FIPS being installed)<br />
<br />
Am I able to have MySQL link in the the OpenSSL DLLs that I compiled (if so, how do I do this?) or do I have to download the MySQL Source and compile that on my Windows machine?<br />
<br />
<br />
Any guidance would be greatly appreciated.]]></description>
            <dc:creator>B W</dc:creator>
            <category>Security</category>
            <pubDate>Mon, 09 Sep 2024 07:58:43 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,725255,725255#msg-725255</guid>
            <title>Copy password from one user to another (3 replies)</title>
            <link>https://forums.mysql.com/read.php?30,725255,725255#msg-725255</link>
            <description><![CDATA[ With mysql5.5 we used to copy passwords from one user to another with the following sql<br />
<br />
update mysql.user set password = ((select pass from (select password as pass from mysql.user where mysql.user.user=&#039;nla_jim&#039; and mysql.user.host=&#039;localhost&#039;) as c)) where mysql.user.user =&#039;abc_jim&#039;;<br />
<br />
Is there a way to do this same thing on mysql8? We are using native passwords.]]></description>
            <dc:creator>Noel Abela</dc:creator>
            <category>Security</category>
            <pubDate>Thu, 08 Aug 2024 11:12:04 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,725099,725099#msg-725099</guid>
            <title>Unable to login mysql after keyring plugin install (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,725099,725099#msg-725099</link>
            <description><![CDATA[ I&#039;m unable to log in after enabling the keyring plugin in mysql.<br />
<br />
Request you to assist]]></description>
            <dc:creator>Santosh Nag Narasimha Dadhirao</dc:creator>
            <category>Security</category>
            <pubDate>Wed, 10 Jul 2024 10:59:12 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,724926,724926#msg-724926</guid>
            <title>Component Key ring file (1 reply)</title>
            <link>https://forums.mysql.com/read.php?30,724926,724926#msg-724926</link>
            <description><![CDATA[ Hi everyone,<br />
<br />
I was trying to work on component key ring file installation and after performing all the steps am not able to encrypt a table. Am I missing something? Can someone guide me on this?<br />
<br />
Added manifest file under /usr/sbin<br />
<br />
cat mysqld.my<br />
{<br />
  &quot;components&quot;: &quot;file://component_keyring_file&quot;<br />
}<br />
<br />
Added configuration file under  /usr/lib64/mysql/plugin/<br />
<br />
 cat component_keyring_file.cnf<br />
{<br />
  &quot;path&quot;: &quot;/usr/lib64/mysql/plugin/component_keyring_file&quot;,<br />
  &quot;read_only&quot;: false<br />
}<br />
<br />
created a zero bytes file under /usr/lib64/mysql/plugin/component_keyring_file<br />
<br />
Its showing as active in mysql prompt but when am trying to encrypt a table it is not working.<br />
<br />
mysql&gt; SELECT * FROM performance_schema.keyring_component_status;<br />
+---------------------+------------------------------------------------+<br />
| STATUS_KEY          | STATUS_VALUE                                   |<br />
+---------------------+------------------------------------------------+<br />
| Component_name      | component_keyring_file                         |<br />
| Author              | Oracle Corporation                             |<br />
| License             | GPL                                            |<br />
| Implementation_name | component_keyring_file                         |<br />
| Version             | 1.0                                            |<br />
| Component_status    | Active                                         |<br />
| Data_file           | /usr/lib64/mysql/plugin/component_keyring_file |<br />
| Read_only           | No                                             |<br />
+---------------------+------------------------------------------------+<br />
8 rows in set (0.00 sec)<br />
<br />
<br />
mysql&gt; alter table emp encryption=&#039;Y&#039;;<br />
ERROR 3185 (HY000): Can&#039;t find master key from keyring, please check in the server log if a keyring is loaded and initialized successfully.]]></description>
            <dc:creator>Pradeep Kumar Bojja</dc:creator>
            <category>Security</category>
            <pubDate>Thu, 27 Jun 2024 07:35:46 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,724005,724005#msg-724005</guid>
            <title>MySQL:  Keyring components (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,724005,724005#msg-724005</link>
            <description><![CDATA[ Introducing Keyring Components in MySQL<br />
<br />
— <a href="https://blogs.oracle.com/mysql/post/keyring-components"  rel="nofollow">https://blogs.oracle.com/mysql/post/keyring-components</a><br />
— <a href="https://blogs.oracle.com/mysql/post/component-keyring-file"  rel="nofollow">https://blogs.oracle.com/mysql/post/component-keyring-file</a><br />
— <a href="https://blogs.oracle.com/mysql/post/keyring-component-to-plugin-migration"  rel="nofollow">https://blogs.oracle.com/mysql/post/keyring-component-to-plugin-migration</a><br />
— <a href="https://blogs.oracle.com/mysql/post/component-keyring-oci"  rel="nofollow">https://blogs.oracle.com/mysql/post/component-keyring-oci</a>]]></description>
            <dc:creator>Edwin Desouza</dc:creator>
            <category>Security</category>
            <pubDate>Fri, 03 May 2024 01:37:24 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,723892,723892#msg-723892</guid>
            <title>Configuring keyring component (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,723892,723892#msg-723892</link>
            <description><![CDATA[ Gents,I an trying to configure component keyring on RHEL 8. I placed a global file in /sbin per the instructions. I placed a second file in /usr/lib64/mysql/plugin and verified library was there. Restarted mysqld but no go<br />
<br />
Global config is as follows:<br />
[root@rhel8 plugin]# ls -l /sbin/mysqld.my <br />
-rw-r-----. 1 mysql mysql 52 Apr 25 17:38 /sbin/mysqld.my<br />
<br />
[root@rhel8 vagrant]# more /sbin/mysqld.my <br />
{<br />
  &quot;components&quot;: &quot;file://component_keyring_file&quot;<br />
}<br />
[root@rhel8 plugin]# ls -l component_keyring_file.cnf <br />
-r--r-----. 1 mysql mysql 68 Apr 25 20:16 component_keyring_file.cnf<br />
<br />
[root@rhel8 plugin]# more component_keyring_file.cnf <br />
{<br />
  &quot;path&quot;: &quot;/usr/local/mysql/keyring/app&quot;,<br />
  &quot;read_only&quot;: false<br />
}<br />
<br />
It seems setup right. Cannot figure out why it is not working.]]></description>
            <dc:creator>John Carver</dc:creator>
            <category>Security</category>
            <pubDate>Fri, 26 Apr 2024 12:33:23 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,723658,723658#msg-723658</guid>
            <title>How to change the login plugin from mysql_native_password to caching_sha2_password (2 replies)</title>
            <link>https://forums.mysql.com/read.php?30,723658,723658#msg-723658</link>
            <description><![CDATA[ Hi, <br />
   Most of our environments are mysql5.7 and we are trying MySQL8 recently. One difference between 5.7.x and 8.0 is  that  the default login plugin is changed from mysql_native_password to caching_sha2_password.<br />
   For now, we know that we can upgrade the existing 5.7 environments to 8.0 by specifying the plugin to mysql_native_password. But mysql_native_password will be deprecated anyway. So we wonder that how to change login plugin of existing users from mysql_native_password to caching_sha2_password in case that we want to plan upgrade 5.7 to latest 8.0+. We know how to change the login plugin for any user manually created by us.<br />
  But we don&#039;t know how to migrate for system users, e.g. mysql.sys, mysql.session and the internal users created by mysqlrouter, I suspect the login plugin of mysqlrouter user maybe related to plugin type of system user.<br />
   <br />
| mysql_router1_9dpfyggnr7bg  | %         | mysql_native_password |<br />
| mysql_router1_r2dvd2ouvpsh  | %         | mysql_native_password |<br />
| mysql_router8_nnuisdqf5bgi  | %         | mysql_native_password |<br />
| mysql_router8_q67c850fzp1p  | %         | mysql_native_password |<br />
| replication_user            | %         | caching_sha2_password |<br />
| root                        | %         | caching_sha2_password |<br />
| mysql.infoschema            | localhost | caching_sha2_password |<br />
| mysql.session               | localhost | mysql_native_password |<br />
| mysql.sys                   | localhost | mysql_native_password |<br />
<br />
Please share some knowledge, thanks a lot.]]></description>
            <dc:creator>Liang Cheng</dc:creator>
            <category>Security</category>
            <pubDate>Wed, 24 Jul 2024 00:07:56 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,712028,712028#msg-712028</guid>
            <title>Keyring_OKV integration with external KMS for TDE (1 reply)</title>
            <link>https://forums.mysql.com/read.php?30,712028,712028#msg-712028</link>
            <description><![CDATA[ Hi there, <br />
<br />
I&#039;m trying to configure MySQL db to use the keyring_okv to communicate using KMIP with my external KMS when doing TDE. I have the MEK in my KMS but I get multiple errors from MySQL during the setup. <br />
<br />
I&#039;m using Ubuntu 20.04 and I&#039;ve tried 22.04 aswell. I&#039;ve installed the V1038776-01 package on Ubuntu 20.04 and V1038777-01 on 22.04. <br />
<br />
After running through all the configuration steps online, in the /var/log/mysql/error.log I get:<br />
<br />
2023-12-11T12:28:56.448105Z 0 [Warning] [MY-010918] [Server] &#039;default_authentication_plugin&#039; is deprecated and will be removed in a future release. Please use authentication_policy instead.<br />
2023-12-11T12:28:56.448130Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.35-commercial) starting as process 14038<br />
2023-12-11T12:28:56.452968Z 0 [ERROR] [MY-011382] [Server] Plugin keyring_okv reported: &#039;Could not find entry for server in configuration file /usr/local/mysql/mysql-keyring-okv/okvclient.ora&#039;<br />
2023-12-11T12:28:56.452995Z 0 [ERROR] [MY-011384] [Server] Plugin keyring_okv reported: &#039;Could not parse the okvclient.ora file provided&#039;<br />
2023-12-11T12:28:56.453005Z 0 [ERROR] [MY-011377] [Server] Plugin keyring_okv reported: &#039;keyring_okv initialization failure. Please check that the keyring_okv_conf_dir points to a readable directory and that the directory contains Oracle Key Vault configuration file and ssl materials. Please also check that Oracle Key Vault is up and running.&#039;<br />
2023-12-11T12:28:56.453015Z 0 [ERROR] [MY-010202] [Server] Plugin &#039;keyring_okv&#039; init function returned error.<br />
<br />
<br />
But the config all looks ok in the okvclient.ora file (used X to keep my domain safe but see the test below using openssl with KMIP to check connectivity):<br />
<br />
root@simon-virtual-machine:/usr/lib/mysql/plugin# cat /usr/local/mysql/mysql-keyring-okv/okvclient.ora<br />
SERVER=XX.XXXXXXXX.XX:5696<br />
STANDBY_SERVER=XX.XXXXXXXX.XX:5696<br />
<br />
and my okvclient.ora looks ok:<br />
<br />
[mysqld]<br />
early-plugin-load=keyring_okv.so<br />
keyring_okv_conf_dir=/usr/local/mysql/mysql-keyring-okv<br />
ssl-ca=/var/lib/mysql/ca.pem<br />
ssl-cert=/var/lib/mysql/server-cert.pem<br />
ssl-key=/var/lib/mysql/server-key.pem<br />
pid-file=/var/run/mysqld/mysqld.pid<br />
socket=/var/run/mysqld/mysqld.sock<br />
datadir=/var/lib/mysql<br />
log-error=/var/log/mysql/error.log<br />
<br />
Testing the cert, key etc. between DSM and my server hosting MySQL using KMIP also looks good:<br />
<br />
root@simon-virtual-machine:/usr/local/mysql/mysql-keyring-okv/ssl# openssl s_client -connect XX.XXXXXXXX.XX:5696 -cert cert.pem -key key.pem -CAfile CA.pem<br />
CONNECTED(00000003)<br />
depth=2 C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority<br />
verify return:1<br />
depth=1 C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA<br />
verify return:1<br />
depth=0 CN = XX.XXXXXXXX.XX<br />
verify return:1<br />
<br />
Running MySQL enterprise:<br />
<br />
mysql&gt; SELECT VERSION();<br />
+-------------------+<br />
| VERSION()         |<br />
+-------------------+<br />
| 8.0.35-commercial |<br />
+-------------------+<br />
1 row in set (0.00 sec)<br />
<br />
<br />
Am I missing some configuration or do I need to install another package?]]></description>
            <dc:creator>Simon Thornell</dc:creator>
            <category>Security</category>
            <pubDate>Sat, 30 Dec 2023 17:05:59 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,712008,712008#msg-712008</guid>
            <title>MySQL 8.0.35 and mysql_native_password (1 reply)</title>
            <link>https://forums.mysql.com/read.php?30,712008,712008#msg-712008</link>
            <description><![CDATA[ I am currently using MySQL 8.0.33 and am planning to upgrade to version 8.0.35. <br />
<br />
In my configuration file (my.cnf) I have set:<br />
<br />
default_authentication_plugin=mysql_native_password.<br />
<br />
According to the MySQL 8.0.35 release notes found at <a href="https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-35.html"  rel="nofollow">https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-35.html</a>, it is mentioned that &quot;mysql_native_password now replaces caching_sha2_password as the default authentication method when the server does not support pluggable authentication.&quot;<br />
<br />
I typically add users using the following command:<br />
<br />
CREATE USER &#039;username&#039;@&#039;%&#039; IDENTIFIED WITH mysql_native_password BY &#039;password&#039;;<br />
<br />
Given this information, I am concerned about whether there will be any issues logging in with these accounts after upgrading to MySQL 8.0.35.]]></description>
            <dc:creator>Christos Chatzaras</dc:creator>
            <category>Security</category>
            <pubDate>Tue, 20 Feb 2024 21:15:09 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,710361,710361#msg-710361</guid>
            <title>MySQL:  Improving TLS Ciphers usage (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,710361,710361#msg-710361</link>
            <description><![CDATA[ MySQL:  Improving TLS Ciphers usage<br />
— <a href="https://blogs.oracle.com/mysql/post/improving-tls-ciphers-usage-in-mysql-820"  rel="nofollow">https://blogs.oracle.com/mysql/post/improving-tls-ciphers-usage-in-mysql-820</a>]]></description>
            <dc:creator>Edwin Desouza</dc:creator>
            <category>Security</category>
            <pubDate>Tue, 31 Oct 2023 17:51:17 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,710360,710360#msg-710360</guid>
            <title>MySQL: authentication_webauthn (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,710360,710360#msg-710360</link>
            <description><![CDATA[ MySQL: authentication_webauthn<br />
— <a href="https://blogs.oracle.com/mysql/post/new-kid-on-the-block-authenticationwebauthn"  rel="nofollow">https://blogs.oracle.com/mysql/post/new-kid-on-the-block-authenticationwebauthn</a>]]></description>
            <dc:creator>Edwin Desouza</dc:creator>
            <category>Security</category>
            <pubDate>Tue, 31 Oct 2023 17:50:36 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,710350,710350#msg-710350</guid>
            <title>MySQL Connector/J 2FA and FIDO (WebAuthn) (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,710350,710350#msg-710350</link>
            <description><![CDATA[ MySQL Connector/J 2FA and FIDO (WebAuthn)<br />
- <a href="https://blogs.oracle.com/mysql/post/mysql-connectorj-fido-webauthn"  rel="nofollow">https://blogs.oracle.com/mysql/post/mysql-connectorj-fido-webauthn</a>]]></description>
            <dc:creator>Edwin Desouza</dc:creator>
            <category>Security</category>
            <pubDate>Mon, 30 Oct 2023 22:58:52 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,710318,710318#msg-710318</guid>
            <title>Encryption data (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,710318,710318#msg-710318</link>
            <description><![CDATA[ Hi,<br />
I would like to crypt data on my mysql database.<br />
I saw that Data-at-rest Encryption exist but is available in Mysql community version or only on mysql Enterprise.<br />
If not how to do the encryption ?<br />
<br />
Thanks<br />
Best regards<br />
<br />
Christophe]]></description>
            <dc:creator>christophe offroy</dc:creator>
            <category>Security</category>
            <pubDate>Fri, 27 Oct 2023 14:10:22 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,709811,709811#msg-709811</guid>
            <title>MySQL HeatWave Database Audit for Data Governance, Compliance, and Security (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,709811,709811#msg-709811</link>
            <description><![CDATA[ MySQL HeatWave Database Audit for Data Governance, Compliance, and Security<br />
- <a href="https://blogs.oracle.com/mysql/post/introducing-mysql-heatwave-database-audit"  rel="nofollow">https://blogs.oracle.com/mysql/post/introducing-mysql-heatwave-database-audit</a>]]></description>
            <dc:creator>Edwin Desouza</dc:creator>
            <category>Security</category>
            <pubDate>Fri, 18 Aug 2023 21:02:19 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,709767,709767#msg-709767</guid>
            <title>client auth with lets encrypt certs (1 reply)</title>
            <link>https://forums.mysql.com/read.php?30,709767,709767#msg-709767</link>
            <description><![CDATA[ i run ops for a few dev teams. because our servers must be publicly accessible and because they are under constant exploit attempts, we prefer to use strong (elyptic curve) tls client and server auth with real (rather than self-signed) certs, which regularly expire and are renewed, for db connections and for replication between source and replicas.<br />
<br />
mongodb support for this use case is pretty straightforward and our mongo servers have always been configured this way.<br />
<br />
postgresql support seems like an afterthought but is doable with a fair bit of configuration tinkering. we&#039;ve had this working for a few months.<br />
<br />
i&#039;ve spent a week trying to coerce mysql to work this way and so far, no joy.<br />
<br />
i did discover:<br />
- ca.pem needs to contain all intermediaries (everything in le&#039;s fullchain.pem + dst-root-x3, something le doesn&#039;t make it easy for you to find, but we&#039;d already jumped through those hoops for our other infra)<br />
- cert.pem and privkey.pem need nothing added or removed.<br />
<br />
starting the mysql service with the following config works:<br />
```<br />
[mysqld]<br />
require_secure_transport=ON<br />
ssl_ca=/var/lib/mysql/lets-encrypt-ca.pem<br />
ssl_cert=/var/lib/mysql/lets-encrypt-cert.pem<br />
ssl_key=/var/lib/mysql/lets-encrypt-key.pem<br />
#ssl_cipher=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256<br />
tls_version=TLSv1.3<br />
```<br />
client users are created like so:<br />
```<br />
CREATE USER &#039;foo&#039;@&#039;abc.example.com&#039; REQUIRE SUBJECT &#039;CN=abc.example.com&#039; AND ISSUER &#039;C=US,O=Let\&#039;s Encrypt,CN=R3&#039;;<br />
```<br />
i&#039;ve also tried:<br />
```<br />
CREATE USER &#039;foo&#039;@&#039;%&#039; REQUIRE SUBJECT &#039;CN=abc.example.com&#039; AND ISSUER &#039;C=US,O=Let\&#039;s Encrypt,CN=R3&#039;;<br />
```<br />
however no clients are able to authenticate (clients also have le certs) and an error is shown client-side which reads:<br />
access denied for user &#039;foo&#039;@&#039;ip address&#039; (using password: no)<br />
<br />
server-side the error log shows:<br />
```<br />
[Warning] [MY-010055] [Server] IP address &#039;ip address&#039; could not be resolved: Name or service not known<br />
```<br />
<br />
some research suggested that the ssl_cipher should be set, but uncommenting that line in the .cnf file causes the server to ignore all ssl settings and run without ssl.<br />
<br />
any example of a working client and server tls auth implementation that uses a real cert rather than a self signed one, would be greatly appreciated.]]></description>
            <dc:creator>rob thijssen</dc:creator>
            <category>Security</category>
            <pubDate>Tue, 15 Aug 2023 07:40:25 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,709640,709640#msg-709640</guid>
            <title>Problem data at rest encryption configuration of component_keyring_file in Windows 11. (1 reply)</title>
            <link>https://forums.mysql.com/read.php?30,709640,709640#msg-709640</link>
            <description><![CDATA[ I have a problem with the configuration of component_keyring_file in mysql server in windows 11. <br />
<br />
<br />
Until now these are the steps I have been followed. <br />
<br />
STEP BY STEP TO Encryption at DATA-REST <br />
<br />
1.	Activate Keyring component of mysql <br />
a.	In the bin directory installation of MySQL Server create a manifest file called mysqld.my with the following information in JSON format: <br />
{<br />
  &quot;read_local_manifest&quot;: false,<br />
  &quot;components&quot;: &quot;file://component_keyring_file&quot;<br />
}<br />
b.	In the plugin directory (normally C:\Program Files\MySQL\MySQL Server 8.0\lib\plugin) create a configuration file called component_keyring_file.cnf with the following information <br />
{<br />
               &quot;read_local_config&quot;: false,<br />
               &quot;path&quot;: &quot;component_keyring_file&quot;,<br />
               &quot;read_only&quot;: false<br />
}<br />
Note: Even if the instructions tell to use absolute path only relative path worked to activate the component in the server. <br />
<br />
c.	Use   ALTER INSTANCE RELOAD KEYRING in mysql query to update the component configuration. <br />
d.	Query SELECT * FROM performance_schema.keyring_component_status; to verify the status of the recent component installation. <br />
 <br />
<br />
<br />
2.	To alter the encryption of an existing file-per-table tablespace, an ENCRYPTION clause must be specified.<br />
<br />
mysql&gt; ALTER TABLE t1 ENCRYPTION = &#039;Y&#039;;<br />
<br />
3.	When we restart the service and even if we use the ALTER INSTANCE RELOAD KEYRING command, we are still not able to access the encrypted data. <br />
<br />
I don&#039;t know if this is a bug. Or I need to make changes to any of the manifest or configuration files. <br />
<br />
I would appreciate any help.]]></description>
            <dc:creator>Lesly Campo</dc:creator>
            <category>Security</category>
            <pubDate>Fri, 04 Aug 2023 15:18:41 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,709250,709250#msg-709250</guid>
            <title>Permission oddity/issue Mysql 8 (3 replies)</title>
            <link>https://forums.mysql.com/read.php?30,709250,709250#msg-709250</link>
            <description><![CDATA[ Hi y&#039;all,<br />
<br />
We&#039;ve recently upgraded our DB to the Mysql 8 from Mysql 5.7. Version of Mysql 8 we&#039;re on is 8.0.32<br />
<br />
I&#039;m going to use a test user below but this test user mimics an actual user in our DB.<br />
<br />
This user was created this way with these permissions in mysql 5.7:<br />
<br />
CREATE USER &#039;test_jb&#039;@&#039;%&#039; IDENTIFIED BY &#039;{enter_password}&#039;;<br />
GRANT ALL PRIVILEGES ON `phone_%prod%`.* TO &#039;test_jb&#039;@&#039;%&#039;;<br />
GRANT SELECT, CREATE TEMPORARY TABLES ON `%prod`.* TO &#039;test_jb&#039;@&#039;%&#039;;<br />
<br />
All was working fine and the user had &quot;ALL PRIVILEGES&quot; to phone_%prod%`.*.<br />
<br />
So we upgraded to Mysql 8 and there the user looked the same:<br />
<br />
Logged in as that user, test_jb.<br />
<br />
mysql&gt; show grants for current_user<br />
    -&gt; ;<br />
+---------------------------------------------------------------------+<br />
| Grants for test_jb@%                                                |<br />
+---------------------------------------------------------------------+<br />
| GRANT USAGE ON *.* TO `test_jb`@`%`                                 |<br />
| GRANT ALL PRIVILEGES ON `phone_%prod%`.* TO `test_jb`@`%`           |<br />
| GRANT SELECT, CREATE TEMPORARY TABLES ON `%prod`.* TO `test_jb`@`%` |         <br />
+---------------------------------------------------------------------+<br />
3 rows in set (0.06 sec)<br />
<br />
User was able to do things like so:<br />
<br />
<br />
mysql&gt; create schema phone_api_prod;<br />
Query OK, 1 row affected (0.06 sec)<br />
<br />
mysql&gt; CREATE TABLE phone_api_prod.test12 (id int);<br />
Query OK, 0 rows affected (0.08 sec)<br />
<br />
in mysql 8, just as they were able in mysql 5.7<br />
<br />
I&#039;m to drop those schema now so I can show running them again a bit later:<br />
<br />
mysql&gt; drop schema phone_api_prod;<br />
Query OK, 0 rows affected (0.06 sec)<br />
<br />
However, we added a role to this user and now its permission is denied for running the same statements as before. For the sake of simplicity, I&#039;ll show you a role that is created but the role will have no additional permissions (in real life this wouldn&#039;t be the case but this is just to keep it simple. The role we added actually had some additional/unrelated priviliges/permissions and showed the same behavior). The role will be granted to the same user.<br />
<br />
<br />
So this is what we did:<br />
<br />
mysql&gt; CREATE ROLE `TESTTESTTEST`@&#039;%&#039;;<br />
Query OK, 0 rows affected (0.07 sec)<br />
<br />
mysql&gt; GRANT TESTTESTTEST TO &#039;test_jb&#039;@&#039;%&#039;;<br />
Query OK, 0 rows affected (0.06 sec)<br />
<br />
Then logging back in to test_jb user:<br />
<br />
mysql&gt; set role TESTTESTTEST<br />
    -&gt; ;<br />
Query OK, 0 rows affected (0.06 sec)<br />
<br />
<br />
mysql&gt; select current_role()<br />
    -&gt; ;<br />
+--------------------+<br />
| current_role()     |<br />
+--------------------+<br />
| `TESTTESTTEST`@`%` |<br />
+--------------------+<br />
1 row in set (0.06 sec)<br />
<br />
<br />
mysql&gt; show grants for current_user<br />
    -&gt; ;<br />
+---------------------------------------------------------------------+<br />
| Grants for test_jb@%                                                |<br />
+---------------------------------------------------------------------+<br />
| GRANT USAGE ON *.* TO `test_jb`@`%`                                 |<br />
| GRANT SELECT, CREATE TEMPORARY TABLES ON `%prod`.* TO `test_jb`@`%` |<br />
| GRANT ALL PRIVILEGES ON `phone_%prod%`.* TO `test_jb`@`%`           |<br />
| GRANT `TESTTESTTEST`@`%` TO `test_jb`@`%`                           |<br />
+---------------------------------------------------------------------+<br />
4 rows in set (0.06 sec)<br />
<br />
And as mentioned, now when running just that create schema statement that earlier ran fine, now fails:<br />
<br />
mysql&gt; create schema phone_api_prod;<br />
ERROR 1044 (42000): Access denied for user &#039;test_jb&#039;@&#039;%&#039; to database &#039;phone_api_prod&#039;<br />
<br />
Now if I set my role to NONE, it works again:<br />
<br />
mysql&gt; set role NONE;<br />
Query OK, 0 rows affected (0.05 sec)<br />
<br />
mysql&gt; create schema phone_api_prod;<br />
Query OK, 1 row affected (0.06 sec)<br />
<br />
mysql&gt; CREATE TABLE phone_api_prod.test12 (id int);<br />
Query OK, 0 rows affected (0.09 sec)<br />
<br />
<br />
set the role back again and it stops working again:<br />
<br />
mysql&gt; set role TESTTESTTEST;<br />
Query OK, 0 rows affected (0.06 sec)<br />
<br />
mysql&gt; show grants for current_user;<br />
+---------------------------------------------------------------------+<br />
| Grants for test_jb@%                                                |<br />
+---------------------------------------------------------------------+<br />
| GRANT USAGE ON *.* TO `test_jb`@`%`                                 |<br />
| GRANT SELECT, CREATE TEMPORARY TABLES ON `%prod`.* TO `test_jb`@`%` |<br />
| GRANT ALL PRIVILEGES ON `phone_%prod%`.* TO `test_jb`@`%`           |<br />
| GRANT `TESTTESTTEST`@`%` TO `test_jb`@`%`                           |<br />
+---------------------------------------------------------------------+<br />
4 rows in set (0.06 sec)<br />
<br />
mysql&gt; CREATE TABLE phone_api_prod.test14 (id int);<br />
ERROR 1142 (42000): CREATE command denied to user &#039;test_jb&#039;@&#039;ec2-34-197-131-140.compute-1.amazonaws.com&#039; for table &#039;test14&#039;<br />
<br />
read access still works:<br />
<br />
mysql&gt; select * from phone_api_prod.test12<br />
    -&gt; ;<br />
Empty set (0.06 sec)<br />
<br />
and the role we assigned doesn&#039;t have any additional permissions. All the permissions come from the GRANTS assigned at the user level. So it&#039;s getting its read access from the GRANTS assigned at the user level. It&#039;s just when assigning a role which is a feature of mysql 8, those previous &quot;modify&quot; scripts fail to behave as before.<br />
<br />
Can someone point me in the Mysql Docs where this behavior is documented? Seems kind of strange.<br />
<br />
Only thing remotely related that I could find in the mysql 8 docs is this (https://dev.mysql.com/doc/refman/8.0/en/grant.html#:~:text=Issuing%20multiple%20GRANT): &quot;Issuing multiple GRANT statements containing wildcards may not have the expected effect on DML statements; when resolving grants involving wildcards, MySQL takes only the first matching grant into consideration. In other words, if a user has two database-level grants using wildcards that match the same database, the grant which was created first is applied.&quot; To be clear, this is the same behavior documented in mysql 5.7, and like I said, it works fine in mysql 5.7 and mysql 8. But stops working as expected once a role is granted and activiated on a user.<br />
<br />
Is there a way to solve this, keeping to the permission strategy we have in place, or does mysql 8 with roles just break permission setup like this? Either way, where is this behavior documented in the mysql 8 docs, so I can understand better?<br />
<br />
We use this strategy of permissions to give broad &quot;read only and temporary table creation access to all %prod schemas&quot; and elevated/ALL privileges permissions to a subset of schemas depending on the data subject area /data domain. It was a great strategy for us, but since we want to use roles in mysql 8 for additional simplicity of permission management, we&#039;re now coming across the inability to continue BAU permission strategy with role based permissioning.<br />
<br />
Could use some help here solving this mystery, thanks!]]></description>
            <dc:creator>Jordan Brown</dc:creator>
            <category>Security</category>
            <pubDate>Thu, 13 Jul 2023 00:51:37 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?30,709096,709096#msg-709096</guid>
            <title>dynamic privileges for web applications (no replies)</title>
            <link>https://forums.mysql.com/read.php?30,709096,709096#msg-709096</link>
            <description><![CDATA[ Hello, <br />
I want to design a dynamic privileges system to be applied in relation to some bundles (modules) of my monolithic web application in PHP. My goal is to ensure security by applying custom privileges for each user based on their roles at the database level, not just relying on the application logic. This approach aims to prevent any unwanted behavior in the web application, such as arbitrary execution due to undiscovered vulnerabilities.<br />
<br />
During my research, I discovered that one way to achieve this is by creating multiple database users. However, it is strongly advised against switching between multiple database users, and there are no arguments in favor of it. In my application, I have numerous user profiles, each with different access permissions, similar to what we find in cloud solution providers.<br />
<br />
Is it possible to implement this in MySQL?]]></description>
            <dc:creator>mohamed salah sdiri</dc:creator>
            <category>Security</category>
            <pubDate>Fri, 26 May 2023 13:54:55 +0000</pubDate>
        </item>
    </channel>
</rss>
