隐藏密码重置页面的本机管理命令
This commit is contained in:
1 parent
83b1f44fdc
commit
f8db6ce4b1
5 files changed
+22
-30
No files matched your search
@@ -49,7 +49,7 @@ func (s *Server) resolvePasswordResetAccount(c *gin.Context) {
|
||||
AccountType: "super_admin",
|
||||
AccountLabel: "超级管理员",
|
||||
Title: "超级管理员密码重置",
|
||||
Description: "已识别为超级管理员账户。超级管理员不能通过普通重置页面修改密码,请使用 Scert-admin 开启的一次性重置入口。",
|
||||
Description: "已识别为超级管理员账户。该账户不能通过普通重置页面修改密码,请联系系统管理员按照服务器本机安全维护流程处理。",
|
||||
Action: "local_admin_command",
|
||||
})
|
||||
return
|
||||
|
||||
@@ -31,7 +31,10 @@ func TestPasswordResetResolutionOnlyOffersLocalAdminCommand(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if payload["account_type"] != "super_admin" || payload["action"] != "local_admin_command" {
|
||||
t.Fatalf("超级管理员没有返回本机命令指引:%v", payload)
|
||||
t.Fatalf("超级管理员没有返回受控本机处理标识:%v", payload)
|
||||
}
|
||||
if description, _ := payload["description"].(string); strings.Contains(strings.ToLower(description), "scert-admin") || strings.Contains(description, "systemctl") {
|
||||
t.Fatalf("公开查询不应泄露本机管理命令:%s", description)
|
||||
}
|
||||
for _, field := range []string{"reset_path", "reset_url", "token", "nonce"} {
|
||||
if _, exists := payload[field]; exists {
|
||||
|
||||
Reference in new issue
Block a user