[MXS-1482] PROXY grants do not work with MaxScale Created: 2017-10-21  Updated: 2017-10-23  Resolved: 2017-10-23

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 2.1.9
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

A PROXY grant allows one user to masquerade as another. MaxScale does not detect that a user shares the grants of another user and is allowed to authenticate.

To fix this problem, the SQL executed by the MySQLAuth module needs to be adjusted into the following form:

SELECT t.user, t.host, t.db, t.select_priv, t.password FROM
(
    SELECT u.user, u.host, d.db, u.select_priv, u.password 
    FROM mysql.user AS u LEFT JOIN mysql.db AS d 
    ON (u.user = d.user AND u.host = d.host) 
    UNION 
    SELECT u.user, u.host, t.db, u.select_priv, u.password 
    FROM mysql.user AS u LEFT JOIN mysql.tables_priv AS t 
    ON (u.user = t.user AND u.host = t.host)
) AS t
WHERE (t.user, t.host) NOT IN (SELECT user, host FROM mysql.proxies_priv)
UNION
SELECT p.user, p.host, t.db, t.select_priv, t.password FROM
(
    SELECT u.user, u.host, d.db, u.select_priv, u.password 
    FROM mysql.user AS u LEFT JOIN mysql.db AS d 
    ON (u.user = d.user AND u.host = d.host) 
    UNION 
    SELECT u.user, u.host, t.db, u.select_priv, u.password 
    FROM mysql.user AS u LEFT JOIN mysql.tables_priv AS t 
    ON (u.user = t.user AND u.host = t.host)
) AS t
JOIN mysql.proxies_priv AS p
ON (p.proxied_user = t.user AND p.proxied_host = t.host);

With this, the grants of the account being proxied are returned instead of the user with the proxy grant.



 Comments   
Comment by markus makela [ 2017-10-23 ]

MariaDB does not support PROXY privilege processing for the default authentication plugin. The PROXY protocol for 10.3 should be a cleaner solution for handling user authentication.

Generated at Thu Feb 08 04:07:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.