-
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 ]使用快捷键查询能绕过脱敏 #1106
Comments
经过测试QUERY_CHECK设置为ON再这样查询页面会显示【数据脱敏异常:Inception Error: 请使用USE DB来指定数据库】的错误。我们一般是设置为OFF的,因为Inception对一些语句无法脱敏设置为ON会影响正常使用。 |
这个bug 应该是存在的, 应该是 Archery/sql/templates/sqlquery.html Line 62 in 3cef756
action="/sqlquery/" method="post" 去掉再试试, 应该就不会触发bug了. 我这边基本没开发环境, 如果方便的话也麻烦你提个 pr 修复下吧
|
[2021-06-07 13:52:41,485][DummyThread-2:140207184134984][task_id:default][data_masking.py:37][WARNING]- 数据脱敏异常,错误信息:Traceback (most recent call last): [2021-06-07 13:52:41,485][DummyThread-2:140207184134984][task_id:default][query.py:125][WARNING]- 数据脱敏异常,按照配置放行,查询语句:select * from db.t_user limit 100;,错误信息:Inception Error: 请使用USE DB来指定数据库 |
这个报错是什么报错, 是脱敏的配置问题吧, 我们现在只谈快捷键绕过脱敏的问题 |
给我的感觉是使用快捷键没有去检测用户选没选具体的库来查询,直接造成了脱敏异常,然后按照QUERY_CHECK=OFF给把sql放行了 |
你已经很久没有回复这个issue了,如果没有进一步的信息的话, 会作为不活跃issue关闭, 感谢你对本项目的贡献。 |
重现步骤
sql查询只选择实例不选择数据库,sql语句里表名前带上库名即dbname.tablename,用鼠标点击sql查询会提示选择数据库,但是如果使用键盘快捷键alt+回车(我的是mac,用的是command+回车)就会直接返回数据而且是未脱敏的。
QUERY_CHECK设置的是OFF
期待结果和实际结果
期待结果:对查询快捷键进行限制,提示必须选择数据库才能查询。
实际结果:
啊啊啊,图传不上来,反正就是通过快捷键可以不选库名进行查询并且使脱敏失效。
错误日志
[2021-05-31 14:52:23,781][DummyThread-350:140269294314312][task_id:default][data_masking.py:37][WARNING]- 数据脱敏异常,错误信息:Traceback (most recent call last):
File "/opt/archery/sql/utils/data_masking.py", line 32, in data_masking
query_tree = inception_engine.query_print(instance=instance, db_name=db_name, sql=sql)
File "/opt/archery/sql/engines/inception.py", line 178, in query_print
raise RuntimeError(f"Inception Error: {print_info['errmsg']}")
RuntimeError: Inception Error: 请使用USE DB来指定数据库
[2021-05-31 14:52:23,781][DummyThread-350:140269294314312][task_id:default][query.py:125][WARNING]- 数据脱敏异常,按照配置放行,查询语句:select * from dbname.t_user limit 100;,错误信息:Inception Error: 请使用USE DB来指定数据库
版本信息
应用版本/分支:版本v1.7.13
部署方式:Docker
The text was updated successfully, but these errors were encountered: