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权限申请“有效时间”字段值漏洞修复 #2818

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

feiazifeiazi
Copy link
Contributor

@feiazifeiazi feiazifeiazi commented Sep 20, 2024

背景:
SQL权限申请“有效时间”valid_date 的值用户可随意修改。(目前在前端js实现,前端可随意修改时间值。或修改本机电脑时间为未来1年)。 虽然需要审核,但DBA实际审核权限的时候,可能没有关注这个值。

  1. 修改valid_date 由前端改为服务后端实现。
  2. 加多"超长期(二年)"选项。
  3. 删除是否已有权限检查。

PS: “检查申请账号是否已拥库查询权限 或表查询” 这个检查是不是必要呢? 我觉的要删除或加配置开关才合理,管大大怎么认为呢?

从archery的使用者角度来来看,每次提单加权限时,这个检查很烦人。
用户现已有某实例(某系统)的库权限,因系统变更加了几个库, 在新申请时,自己还得需要知道哪些已经申请 哪些没有申请, 难道不能是提前申请续期吗?

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 78.27%. Comparing base (b1efe08) to head (1132f68).

Files with missing lines Patch % Lines
sql/query_privileges.py 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2818      +/-   ##
==========================================
+ Coverage   78.25%   78.27%   +0.01%     
==========================================
  Files         124      124              
  Lines       17492    17489       -3     
==========================================
  Hits        13689    13689              
+ Misses       3803     3800       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LeoQuote
Copy link
Collaborator

我觉得不用加校验, 倒是可以加提醒, 就是告诉他还有时间, 可以不申请, 这样审批的人负担小一些, 不能排除有些人拿了2天, 有效期没到但是觉得不够用了, 所以重新申请一个更长的. 这个功能应该不用做开关, 直接改成前端提醒吧.

这个配置能不能改成 django 的配置或 archery 的配置方便管理员覆盖?

类似于这样的:

[{"name": "1-day", "duration": 86400, "disaplay": "一天"}]

这样的话想设置多久就设置多久. duration 的单位你注意写好文档就行, 我这里举例子用的是秒, 你想用天或者小时都行, 用秒的话就是统一单位方便沟通.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants