MySQL Forums
Forum List  »  German

Problem mit Proxy/Proxied User
Posted by: Silvio Schloeffel
Date: January 21, 2025 02:32AM

Hallo,

ich setzte gerade inen neuen MySQL 8.4 Server auf und möchte das erste mal mit Rechtevergabe mittels Proxy User arbeiten.

Die Dokumentation unter: https://dev.mysql.com/doc/refman/8.4/en/proxy-users.html
gibt Hinweise bezüglich der Konfiguartion:

check_proxy_users=ON
sha256_password_proxy_users=ON

Wir haben zwar nicht vor sha256_password zu verwenden, da alle Nutzer neu erzeugt werden und somit caching_sha2_password verwendet wir aber zur Sicherheit ...

Wenn ich die Variable für Proxy abfrage wird auch alles korrekt geladen:

mysql> show variables like '%proxy%';
+-----------------------------------+-------+
| Variable_name | Value |
+-----------------------------------+-------+
| check_proxy_users | ON |
| mysql_native_password_proxy_users | OFF |
| proxy_user | |
| sha256_password_proxy_users | ON |
+-----------------------------------+-------+
4 rows in set (0,01 sec)


Im nächsten Schritt habe ich 2 User erzeugt:
CREATE USER 'test_user_1'@'%' IDENTIFIED WITH caching_sha2_password BY RANDOM PASSWORD;
CREATE USER 'test_user_2'@'%' IDENTIFIED WITH mysql_no_login;

Nutzer 2 hat Select Rechte für eine DB erhalten:
Grant SELECT on channel_broadcast.* to 'test_user_2'@'%';

und zum Schluss die Proxy Rechte laut Doku:
GRANT PROXY ON 'test_user_2'@'%' TO 'test_user_1'@'%';

Rechte kontrollieren:
mysql> SHOW GRANTS FOR 'test_user_1'@'%';
+-------------------------------------------------------+
| Grants for test_user_1@% |
+-------------------------------------------------------+
| GRANT USAGE ON . TO test_user_1@% |
| GRANT PROXY ON test_user_2@% TO test_user_1@% |
+-------------------------------------------------------+
2 rows in set (0,00 sec)

mysql> SHOW GRANTS FOR 'test_user_2'@'%';
+------------------------------------------------------------+
| Grants for test_user_2@% |
+------------------------------------------------------------+
| GRANT USAGE ON . TO test_user_2@% |
| GRANT SELECT ON channel_broadcast.* TO test_user_2@% |
+------------------------------------------------------------+
2 rows in set (0,00 sec)

-> sieht gut aus.


Nach dem anmelden mit Nutzer 1 hat dieser allerdings keine Rechte und auch die Proxy Variable liefert NULL zurück.

mysql> SELECT @@proxy_user;
+--------------+
| @@proxy_user |
+--------------+
| NULL |
+--------------+

Die Doku nutzt explizit Loacalhost und sha256_password also habe ich 2 Nutzer mit diesen Angaben verwendet, ändert nichts.

mysql> select * from mysql.proxies_priv;
+-----------+-------------+--------------+--------------+------------+----------------+---------------------+
| Host | User | Proxied_host | Proxied_user | With_grant | Grantor | Timestamp |
+-----------+-------------+--------------+--------------+------------+----------------+---------------------+
| % | test_user_1 | % | test_user_2 | 0 | root@localhost | 2025-01-20 08:11:02 |
| localhost | root | | | 1 | boot@ | 2024-12-19 12:46:10 |
| localhost | test_user_3 | localhost | test_user_4 | 0 | root@localhost | 2025-01-20 10:31:48 |
| localhost | test_user_3 | localhost | test_user_5 | 0 | root@localhost | 2025-01-20 10:40:23 |
+-----------+-------------+--------------+--------------+------------+----------------+---------------------+
4 rows in set (0,00 sec)


Ich denke also das ich irgendwas in der Konfiguartion übersehen habe.
Kann mir jemand einen Hinweis geben?

Grüße

Silvio

Options: ReplyQuote


Subject
Views
Written By
Posted
Problem mit Proxy/Proxied User
386
January 21, 2025 02:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.