Keycloak:决定阻止用户时可以考虑IP地址吗?

Keycloak : Can I take account IP address when deciding to block a user?

我从事使用 keycloak 进行身份验证的 Web 项目。 在决定阻止用户时可以考虑 IP 地址吗? 示例:如果用户验证失败 5 次,我将屏蔽该 IP 地址。

此致。

你说的类似于暴力破解。根据 keycloak documentation,它们提供了在遭受暴力攻击时暂时禁用用户的功能。

The way this works is that if there are Max Login Failures during a period of Failure Reset Time, the account is temporarily disabled for the Wait Increment multiplied by the number of failures over the max. After Failure Reset Time is reached all failures are wiped clean.

但是他们提到的一个缺点是服务器容易受到拒绝服务攻击。

他们推荐使用第三方工具:Fail2ban,它可以指向 keycloak 日志文件并可用于阻止某些 IP 地址。