[MXS-4504] IP wildcard values are not permitted in host values while using data masking Created: 2023-02-08  Updated: 2023-02-16  Resolved: 2023-02-09

Status: Closed
Project: MariaDB MaxScale
Component/s: masking
Affects Version/s: 2.5.19, 6.4, 22.08
Fix Version/s: 2.5.25, 6.4.6, 22.08.5, 23.02.0

Type: Bug Priority: Major
Reporter: Pramod Mahto Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: None


 Description   

While dealing with Data masking using Maxscale https://mariadb.com/kb/en/mariadb-maxscale-6-masking/ its not working as expected with wildcard used for host value in applies_to or exempted section
https://kb-prod.mariadb.com/kb/en/mariadb-maxscale-6-masking/#applies_to

Here is the test case [Not working] :-

Filename :- filter02.json

{
        "rules": [
        {
                "replace": {
                "database": "sbtest",
                "table": "sbtest1",
                "column": "pad"},
                "with": {"fill": "X"},
"applies_to": [ "'app_user'@'192.168.47.%'", "'uat_user'@'192.168.47.%'" ],
"exempted": ["'mgr_user'@'192.168.47.%'"]
        }
    ]
}

Output from backend MariaDB server :-

 
MariaDB [sbtest]> select current_user();
+-----------------------+
| current_user()        |
+-----------------------+
| app_user@192.168.47.% |
+-----------------------+
1 row in set (0.002 sec)
 
 
MariaDB [sbtest]> select pad from sbtest1 limit 10;
+-------------------------------------------------------------+
| pad                                                         |
+-------------------------------------------------------------+
| 67847967377-48000963322-62604785301-91415491898-96926520291 |
| 23183251411-36241541236-31706421314-92007079971-60663066966 |
| 38615512647-91458489257-90681424432-95014675832-60408598704 |
| 63947013338-98809887124-59806726763-79831528812-45582457048 |
| 34551750492-67990399350-81179284955-79299808058-21257255869 |
| 05161542529-00085727016-35134775864-52531204064-98744439797 |
| 91798303270-64988107984-08161247972-12116454627-22996445111 |
| 76460662325-41613089656-42706083314-81833284991-17063140920 |
| 30508501104-50823269125-88107014550-70202920684-95842308929 |
| 29489382504-13697582598-09964978366-26554639515-36136545002 |
+-------------------------------------------------------------+
10 rows in set (0.003 sec)

While its working fine with :-

filter03.json

{
        "rules": [
        {
                "replace": {
                "database": "sbtest",
                "table": "sbtest1",
                "column": "pad"},
                "with": {"fill": "X"},
"applies_to": [ "'app_user'@'%'", "'uat_user'@'%'" ],
"exempted": ["'mgr_user'@'%'"]
        }
    ]
}

Output from backend MariaDB server :-

 
MariaDB [sbtest]> select current_user();
+-----------------------+
| current_user()        |
+-----------------------+
| app_user@192.168.47.% |
+-----------------------+
1 row in set (0.002 sec)
 
MariaDB [sbtest]> select pad from sbtest1 limit 10;
+-------------------------------------------------------------+
| pad                                                         |
+-------------------------------------------------------------+
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
+-------------------------------------------------------------+
10 rows in set (0.003 sec)


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