[MXS-1321] Mask columns referred inside functions Created: 2017-07-20 Updated: 2017-08-22 Resolved: 2017-08-22 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | masking |
| Affects Version/s: | 2.1.4 |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Dipti Joshi (Inactive) | Assignee: | Massimiliano Pinto (Inactive) |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Today if the mask filter is configured for a column , and the column is referred inside a function in the select projection list than, column is not masked. This should be correct Following query returns nation_id even if masking filter is set to filter nation_id This should be fixed, that if the masked column is used inside a function in projection list, then the entire field should be masked with "X" - no partial regex masking or obfuscation should be done. |
| Comments |
| Comment by Massimiliano Pinto (Inactive) [ 2017-07-21 ] | |||||||
|
-bash-4.1$ mysql -h 127.0.0.1 -P 8811 -e "select MD5(name), MAX(ssn) from test.masking"
---------------------------------
--------------------------------- This can be easily done by checking also "column_def" "name", not only "column_def" "org_name", as above. What cannot be done immediately is: -bash-4.1$ mysql -h 127.0.0.1 -P 8811 -e "select MAX(name) AS mmm from test.masking"
-------
------- Adding a column alias with a function is something that cannot be checked in the result set but it must be done inspecting the input | |||||||
| Comment by Johan Wikman [ 2017-07-24 ] | |||||||
|
Anything that cannot be performed by merely inspecting the resultset implies a massive change. Masking the result of a statement like "select SUBSTRING(nation_id, 1) from table_1" effectively means that the parse tree of the statement must be made available to the filter, so that it can figure out whether a column to be masked (e.g. nation_id) is used as an argument to a function. | |||||||
| Comment by Dipti Joshi (Inactive) [ 2017-07-25 ] | |||||||
|
johan.wikman Alternate to using parse tree of the entire SQL statement is to do regex processing of the return column name in the result set - "column_def". "name" in addition to "column_def". "org_name"
This regex covers patterns of <function-name>(<column-name>, zero or more parameters) | |||||||
| Comment by Johan Wikman [ 2017-07-26 ] | |||||||
|
That's a good idea, but the regex needs to be more complex than that. It would not catch e.g.
| |||||||
| Comment by Johan Wikman [ 2017-08-22 ] | |||||||