Skip to content
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

修改默认的正则表达式,添加Redis的高危操作命令 #2580

Merged
merged 10 commits into from
Apr 12, 2024
4 changes: 2 additions & 2 deletions sql/engines/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def execute_check(self, db_name=None, sql=""):
id=line,
errlevel=0,
stagestatus="Audit completed",
errormessage="None",
errormessage="暂不支持显示影响行数",
sql=cmd,
affected_rows=0,
execute_time=0,
Expand All @@ -204,7 +204,7 @@ def execute_workflow(self, workflow):
id=line,
errlevel=0,
stagestatus="Execute Successfully",
errormessage="None",
errormessage="暂不支持显示影响行数",
sql=cmd,
affected_rows=0,
execute_time=t.cost,
Expand Down
4 changes: 2 additions & 2 deletions sql/engines/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def test_execute_check(self):
id=1,
errlevel=0,
stagestatus="Audit completed",
errormessage="None",
errormessage="暂不支持显示影响行数",
sql=sql,
affected_rows=0,
execute_time=0,
Expand All @@ -440,7 +440,7 @@ def test_execute_workflow_success(self, _execute_command):
id=1,
errlevel=0,
stagestatus="Execute Successfully",
errormessage="None",
errormessage="暂不支持显示影响行数",
sql=sql,
affected_rows=0,
execute_time=0,
Expand Down
3 changes: 2 additions & 1 deletion sql/utils/workflow_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ def is_auto_review(self) -> bool:

# 获取正则表达式
auto_review_regex = self.sys_config.get(
"auto_review_regex", "^alter|^create|^drop|^truncate|^rename|^delete"
"auto_review_regex",
"^alter|^create|^drop|^truncate|^rename|^delete|^del|^flushdb|^flushall|^lpop|^rpop",
)
p = re.compile(auto_review_regex, re.I)

Expand Down
Loading