[MXS-3766] Not able to insert data on Masking enabled table Created: 2021-09-15  Updated: 2022-01-31  Resolved: 2021-09-16

Status: Closed
Project: MariaDB MaxScale
Component/s: masking
Affects Version/s: 2.5.15, 6.1.1
Fix Version/s: 2.5.16, 6.1.2

Type: Bug Priority: Critical
Reporter: Pon Suresh Pandian (Inactive) Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS Linux release 7.9.2009 (Core)



 Description   

it is no problem with the masking process for the select clause,
When the insert command is executed on the table, the following error occurs.

error message : The function = is used in conjunction with a field that should be masked for 'testuser1'@'127.0.0.1', access is denied.

masking test case!!
-------------------------------------------------------------------

CREATE TABLE t_masking (
  id varchar(20) NOT NULL,
  name varchar(10) NOT NULL,
  ssn char(13) NOT NULL,
  address varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
);
 
#cat /etc/maxscale.filter.masking.json 
{
    "rules": [
        {
            "replace": {
                 "database": "test"
                ,"table": "t_masking"
                ,"column": "ssn"
		,"match": "[1234]\\d{6}$"		
            },
            "with": {
		"fill":"*"
            }
        }
    ]
}

There seems to be an account problem when filtering the masking column.

When connecting through maxscale.....

MariaDB [(none)]> system maxctrl --version
6.1.1

MariaDB [(none)]>
MariaDB [(none)]> select current_user();
+----------------+
| current_user() |
+----------------+
| testuser1@%    |   
+----------------+
1 row in set (0.001 sec)

MariaDB [test]> insert into t_masking(id, name, ssn, address) values('max','MR.X','0109073234567','America');
ERROR 1141 (HY000): The function = is used in conjunction with a field that should be masked for 'testuser1'@'127.0.0.1', access is denied.


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