gpt4 book ai didi

keycloak - "Login timeout"设置和功能的原因是什么?

转载 作者:行者123 更新时间:2023-12-04 08:25:50 24 4
gpt4 key购买 nike

如果应用程序将用户重定向到 Keycloak 登录页面,并且它在那里停留的时间超过了“登录超时”(默认 5 分钟),那么当用户输入用户名和密码而不是登录名时,她会看到:

You took too long to login. Login process starting from beginning.


login page timed out
为了避免这种情况,可以将“领域设置→ token →登录超时”更改为例如10000 天也就是 27 年,这应该确保这在现实中永远不会发生。
但是在我们继续并有效地禁用此超时之前,我们想问:此超时的目的是什么?显然有人在实现它时遇到了麻烦,但它可以防止什么?禁用它的(安全?)后果是什么?

最佳答案

据我所知,它主要用作避免session fixation attacks的附加机制。 .例如,在一家公司,用户去喝咖啡并打开计算机,然后黑客看到机会并在浏览器 URL 中手动设置
当前登录 session ID (或只是复制它)。现在,如果系统的配置方式是 session ID在 pre 和 pos 登录阶段之间不会改变。然后在受害者成功通过身份验证后,黑客将能够使用受害者当前所在的 session ,而无需插入任何身份验证;
超时时间越长,发生此类攻击的机会窗口就越宽。登录超时只是避免此类问题的另一层保护,因为它是 session 到期,在登录前和登录后阶段之间更改 session ID,等等。
更正式的可以读入 ( source )。

Initial Login TimeoutThis extra protection mechanism tries to force the renewal of thesession ID pre-authentication, avoiding scenarios where a previouslyused (or manually set) session ID is reused by the next victim usingthe same computer, for example, in session fixation attacks.


来自 OWASP.org

Session Fixation is an attack that permits an attacker to hijack avalid user session. The attack explores a limitation in the way theweb application manages the session ID, more specifically thevulnerable web application. When authenticating a user, it doesn’tassign a new session ID, making it possible to use an existent sessionID. The attack consists of obtaining a valid session ID (e.g. byconnecting to the application), inducing a user to authenticatehimself with that session ID, and then hijacking the user-validatedsession by the knowledge of the used session ID. The attacker has toprovide a legitimate Web application session ID and try to make thevictim’s browser use it.


关于 session 固定攻击如何工作以及如何防止它的一个相当好的解释 herehere .
现在我不是安全专家,但我想说,如果您有其他预防机制,例如更改 session ID,您应该没问题。然而,另一方面,你真的需要那么多时间登录吗?再次刷新是否很烦人?

关于keycloak - "Login timeout"设置和功能的原因是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65266761/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com