grafana/pkg/services/sqlstore/migrator
Marcus Efraimsson 3d1c624c12 WIP: Protect against brute force (frequent) login attempts (#10031)
* db: add login attempt migrations

* db: add possibility to create login attempts

* db: add possibility to retrieve login attempt count per username

* auth: validation and update of login attempts for invalid credentials

If login attempt count for user authenticating is 5 or more the last 5 minutes
we temporarily block the user access to login

* db: add possibility to delete expired login attempts

* cleanup: Delete login attempts older than 10 minutes

The cleanup job are running continuously and triggering each 10 minute

* fix typo: rename consequent to consequent

* auth: enable login attempt validation for ldap logins

* auth: disable login attempts validation by configuration

Setting is named DisableLoginAttemptsValidation and is false by default
Config disable_login_attempts_validation is placed under security section
#7616

* auth: don't run cleanup of login attempts if feature is disabled

#7616

* auth: rename settings.go to ldap_settings.go

* auth: refactor AuthenticateUser

Extract grafana login, ldap login and login attemp validation together
with their tests to separate files.
Enables testing of many more aspects when authenticating a user.
#7616

* auth: rename login attempt validation to brute force login protection

Setting DisableLoginAttemptsValidation => DisableBruteForceLoginProtection
Configuration disable_login_attempts_validation => disable_brute_force_login_protection
#7616
2018-01-26 10:41:41 +01:00
..
column.go fix(postgres): fixes db migration issue with_credentials column for postgres, fixes #3505 2015-12-14 10:19:53 +01:00
conditions.go Progress on database schema migration for account -> org refactor 2015-02-24 11:46:34 +01:00
dialect.go WIP: Protect against brute force (frequent) login attempts (#10031) 2018-01-26 10:41:41 +01:00
migrations.go utf8mb4 encoding (#7959) 2017-03-28 14:34:53 +02:00
migrator.go fix(build): fixed broken build, unreachable code in migrator.go 2016-09-30 09:23:26 +02:00
mysql_dialect.go utf8mb4 encoding (#7959) 2017-03-28 14:34:53 +02:00
postgres_dialect.go Corrected a PostgreSQL SELECT statement. (#9460) 2017-10-08 20:37:16 +02:00
sqlite_dialect.go WIP: Protect against brute force (frequent) login attempts (#10031) 2018-01-26 10:41:41 +01:00
types.go More work on SQL migrations 2015-02-24 17:59:21 +01:00