Skip to content

Use hosts IP address as user group instead of a guessed wildcard.#190

Open
IzzySmith wants to merge 1 commit intopercona:v2.0from
IzzySmith:fix-wildcard-user-hostrange
Open

Use hosts IP address as user group instead of a guessed wildcard.#190
IzzySmith wants to merge 1 commit intopercona:v2.0from
IzzySmith:fix-wildcard-user-hostrange

Conversation

@IzzySmith
Copy link

The wildcard approach has the issue, that it allows monitor connections
to the MySQL nodes from a too big IP range. Having the first pxc nodes
IP something like 10.1.2.3, proxysql-admin would create the monitor user
with the host range of 10.%. This would contain the complete 10.0.0.0/8
network which most likely contain other systems that are not supposed to
be allowed to connect to MySQL, even if we are just talking about the
monitor user.

Another issue with the current solution pops up, when the IP address of
the pxc node does not share the same first octet with the ProxySQL IP.
Example:
ProxySQL IP: 172.18.1.1
PXC IP: 10.0.0.1
Then the ProxySQL-Admin script will anyways create the monitor user as
monitor@10.%, resulting in ProxySQL not being able to connect.

In this commit, we use ifconfig to get the actual IP of the ProxySQL
node and will therefore only allow the ProxySQL node to connect as
monitor user.

Co-authored-by: Isobel isobelsmith00@gmail.com

The wildcard approach has the issue, that it allows monitor connections
to the MySQL nodes from a too big IP range. Having the first pxc nodes
IP something like 10.1.2.3, proxysql-admin would create the monitor user
with the host range of 10.%. This would contain the complete 10.0.0.0/8
network which most likely contain other systems that are not supposed to
be allowed to connect to MySQL, even if we are just talking about the
monitor user.

Another issue with the current solution pops up, when the IP address of
the pxc node does not share the same first octet with the ProxySQL IP.
Example:
  ProxySQL IP: 172.18.1.1
  PXC IP: 10.0.0.1
Then the ProxySQL-Admin script will anyways create the monitor user as
monitor@10.%, resulting in ProxySQL not being able to connect.

In this commit, we use ifconfig to get the actual IP of the ProxySQL
node and will therefore only allow the ProxySQL node to connect as
monitor user.

Co-authored-by: Isobel <isobelsmith00@gmail.com>
@it-percona
Copy link

it-percona commented Jul 30, 2020

CLA assistant check
All committers have signed the CLA.

@rameshvs02 rameshvs02 requested a review from kennt-percona July 30, 2020 11:07
@IzzySmith
Copy link
Author

Hi @kennt-percona any updates on this PR?

@venkatesh-prasad-v venkatesh-prasad-v self-assigned this May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants