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

Scannerd Token失效的问题 #2602

Open
winfredLIN opened this issue Sep 13, 2024 · 1 comment
Open

Scannerd Token失效的问题 #2602

winfredLIN opened this issue Sep 13, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@winfredLIN
Copy link
Collaborator

winfredLIN commented Sep 13, 2024

版本信息(Version)

sqle latest

问题描述(Describe)

Scannerd的token的时效是365天(包括智能扫描和CI/CD集成)
在用户创建智能扫描/流水线节点超过365天后,Token会失效,
会面临大量Scannerd因为Token过期而无法与SQLE交互的问题,需要及时解决

截图或日志(Log)

如何复现(To Reproduce)

问题原因

  1. 旧版本的Scannerd的token仅持续一年,当token过期时,将不可使用

解决方案

SQLE V2

  1. 对于慢日志扫描,将慢日志扫描的接口组移动到v1路由组外,该接口的权限校验全由ScannerVerifier来鉴权
  2. 在ScannerVerifier中,针对token过期的错误,放行包含该错误的token
  3. ScannerVerifier增加了对用户的校验
  4. 修改了原有单元测试,增加了用户信息查询
  5. 增加了新的单元测试,测试了不可用用户、正常用户、和不存在用户三种情况
  6. 增加了新的单元测试,测试了过期token和未过期token的两种情况

影响面

v2上的修改仅解决了slowlog上传sql的问题,兼容旧版本过期的token

@winfredLIN winfredLIN added the bug Something isn't working label Sep 13, 2024
@ColdWaterLW ColdWaterLW added this to the v3.2409.0 milestone Sep 13, 2024
@winfredLIN
Copy link
Collaborator Author

  1. 伪造过期的token
    image
    image
  2. 跳过过期错误
    image
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants