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

智能扫描配置高优先级SQL #2539

Closed
LordofAvernus opened this issue Aug 14, 2024 · 2 comments
Closed

智能扫描配置高优先级SQL #2539

LordofAvernus opened this issue Aug 14, 2024 · 2 comments
Assignees
Labels
publish-pre2 verified the issue all pr is verified
Milestone

Comments

@LordofAvernus
Copy link
Collaborator

LordofAvernus commented Aug 14, 2024

需求描述(Describe)

入口
智能扫描配置页面

权限
拥有该类型智能扫描创建/编辑权限

需求细节
在智能扫描相关字段下,新增一个开关“标记高优先级SQL”

说明:开启后,符合高优先级标准的SQL将被标记,并推送至指定成员

默认状态为关闭
开启后,需要配置问题标准,参考如下

基于不同扫描类型,展示的问题标准
库表结构: 审核等级 > warning 慢SQL:执行时间超过?秒的SQL 慢查时间(秒) > 4 审核等级 > warning TOPSQL 选择的阈值(单位) > ? 会话SQL 会话时间 > warning JAVA应用程序中的SQL 审核等级 > warning

保存后,采集到的SQL中,如果符合问题标准,SQL将识别为高优先级的SQL
同时会根据推送配置推送给指定的用户

实现方案

  • 扫描任务原始配置根据不同的类型新增默认筛选条件
  • 获取扫描任务Meta接口返回对应的筛选条件
  • 新增/创建扫描任务新增筛选条件参数

变更影响面

受影响的模块或功能

外部引用的潜在问题或风险

版本兼容性

测试建议

@LordofAvernus
Copy link
Collaborator Author

LordofAvernus commented Aug 20, 2024

智能扫描SQL详情页面 支持高优先级SQL展示和筛选

  1. 任务SQL页面都支持高优先级参数的展示和筛选

  2. 任务SQL页面新增通用的sql/rule的筛选条件
    image

  3. 任务增加默认的高优先级配置(audit_level)
    image

@hasa1K
Copy link
Contributor

hasa1K commented Aug 28, 2024

版本

sqle-ee:785fbb3ad5781a9c2a004131aef5994a2aef2f2e

测试

库表元数据开启高优先级sql
image
标记为高优先级sql
image
飞书可以收到信息
image

mysql慢日志开启高优先级sql
image
标记为高优先级sql
image
飞书成功收到信息
image

筛选高优先级sql
image

sql筛选
image

@hasa1K hasa1K added the verified the issue all pr is verified label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
publish-pre2 verified the issue all pr is verified
Projects
None yet
Development

No branches or pull requests

3 participants