-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] 测试基于goInception的脱敏发现两个问题 #1360
Comments
我想想, |
[不支持诸如 [,column_a]| [a., column_a, b.*] 的脱敏] [
{
"index": 0,
"field": "id",
"type": "int",
"table": "users",
"schema": "db1",
"alias": "id"
},
{
"index": 1,
"field": "phone",
"type": "varchar(80)",
"table": "users",
"schema": "db1",
"alias": "phone"
},
{
"index": 2,
"field": "email",
"type": "varchar(30)",
"table": "users",
"schema": "db1",
"alias": "email"
},
{
"index": 3,
"field": "create_time",
"type": "datetime",
"table": "users",
"schema": "db1",
"alias": "create_time"
},
{
"index": 1,
"field": "phone",
"type": "varchar(80)",
"table": "users",
"schema": "db1",
"alias": "phone"
}
] 去掉 query_tree=DelRepeat(query_tree,'index') 函数就可以了, 但是去掉后,好像又有其他的问题,我考虑一下。 其他的还得在想想 |
嗷嗷,去掉去重函数后,['UNION', 'UNION ALL'] 会有下标越界的问题, |
就剩下子查询的问题了,我还不知道咋解决,其他同学有啥想法没 |
子查询之前就不支持? |
第一点问题不在是否支持,在于不支持的能否识别 |
[{'index': 0, 'field': 'id', 'type': 'int(11)', 'table': 'data_masking_rules', 'schema': 'archery', 'alias': 'id'}, |
昂,最新的已经改了,用最新的提交看看? |
嘶,缝合了一下,有点新问题 union
select id,phone,email,create_time,phone from users a where id in (select b.id from users b )
union all
select id,phone,email,create_time,phone from users a where id in (select b.id from users b )
和
select phone , a.* , a.* ,phone from users a
union all
select phone , b.* , b.* ,phone from users b 我明天look look |
明天先问问goInception的同学,能不能做进去吧。 |
|
第一点待解决 |
那边的小哥哥还不理我。。。 |
select concat(id,password) from sql_users limit 100; 抛错,demo环境可复现 |
已复现 原因是goInception的返回结果发生了变化 最新的1.2.5-10 里 index是重复的(符合预期的) 参考: index: 列索引,标识为第几列,可能重复(如函数引用了多列时) 咱们有同学懂go么?那边的小哥哥好像比较忙。。。。 已提交issue |
有无大佬懂Go,支持一下goInception吧。。。😂😂😂😂 |
能够在返回信息中增加expression-type,就可以做识别处理 https://hanchuanchuan.github.io/goInception/tree.html#expression-type |
fixed. 如有问题欢迎随时提交issue. |
使用 goInception-linux-v1.2.5-29-ge46a69b.tar.gz
|
非常感谢!!!🤞🤞 |
我看1.8.3版本使用了Inception版本,我们还是要做成开关模式么。。。 |
能完全替换就不做开关,语法不支持不要紧,要求是按照当前逻辑能识别并且拦截 |
Inception 版本是通过queryprint方法,它的返回中type来判断是否支持的 Archery/sql/utils/data_masking.py Lines 95 to 104 in a8967be
type说明 所以不能像Inception 那样进行识别并拦截 需要看看有没有其他的方法? 要不然,我们先用用看,收集一下哪些语法不支持? |
已提交PR #1483,将会在下个版本完全替换Inception 不支持的语法,不过这种会直接解析错误,不影响query_check的判断
|
谢谢大佬!😊😊 |
测试基于goInception的脱敏发现两个问题,覆盖场景比Inception的少,需要解决一下
无法识别哪些语句不能正常脱敏,导致 QUERY_CHECK 参数失效,不能脱敏的语句也能正常查询,有较大风险
嵌套子查询:
select * from (select * from users ) t;
多列函数:
select concat(id,phone) from users;
不支持诸如 [*,column_a]| [a.*, column_a, b.*] 的脱敏
select *,phone from users;
select a.*,a.phone,b.* from users a join sql_users_groups b on a.id =b.users_id;
上述例子都可以在演示环境进行测试
Originally posted by @hhyo in #1307 (comment)
The text was updated successfully, but these errors were encountered: