Auth: Add IP address login attempt validation (#98123)

* Auth: Add IP address login attempt validation

* LoginAttempt struct IpAddress field must be camelCase to match db ip_address column

* add setting DisableIPAddressLoginProtection

* lint

* add DisableIPAddressLoginProtection setting to tests

* add request object to authenticate password test

* nit suggestions & rename tests

* add login attempt on failed password authentication

* dont need to reset login attempts if successful

* don't change error message

* revert go.work.sum

* Update pkg/services/authn/clients/password.go

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

---------

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
This commit is contained in:
colin-stuart
2025-02-05 13:16:36 -05:00
committed by GitHub
parent d58dec7951
commit 6200361f36
15 changed files with 224 additions and 29 deletions
+3
View File
@@ -353,6 +353,9 @@
# max number of failed login attempts before user gets locked
;brute_force_login_protection_max_attempts = 5
# disable protection against brute force login attempts by IP address
; disable_ip_address_login_protection = true
# set to true if you host Grafana behind HTTPS. default is false.
;cookie_secure = false