Block weak passwords on sign up or password change
Account takeovers are a common cybersecurity threat made much easier when a user decides to use a weak password to protect their account. This MR introduces a static list of known weak passwords against which the user's chosen password can be compared. The password is also validated against components of the user's attributes, such as their name, email, and username. Weak passwords are prevented only when the `block_weak_passwords` feature flag is enabled, and only at registration or when a password is changed. (It is not checked or enforced when the password is not changed, such as during sign-in). Notably, and in comparison to password complexity rules, blocking weak passwords is a requirement of NIST SP 800-63B: > When processing requests to establish and change memorized secrets, > verifiers SHALL compare the prospective secrets against a list that > contains values known to be commonly-used, expected, or compromised. > > - https://pages.nist.gov/800-63-3/sp800-63b.html See also: - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86310 - https://gitlab.com/gitlab-org/gitlab/-/issues/23610
显示
- app/models/user.rb 9 个添加, 0 个删除app/models/user.rb
- config/feature_flags/development/block_weak_passwords.yml 8 个添加, 0 个删除config/feature_flags/development/block_weak_passwords.yml
- config/initializers/1_settings.rb 1 个添加, 0 个删除config/initializers/1_settings.rb
- config/weak_password_digests.yml 4550 个添加, 0 个删除config/weak_password_digests.yml
- ee/spec/models/concerns/password_complexity_spec.rb 10 个添加, 10 个删除ee/spec/models/concerns/password_complexity_spec.rb
- lib/security/weak_passwords.rb 88 个添加, 0 个删除lib/security/weak_passwords.rb
- locale/gitlab.pot 3 个添加, 0 个删除locale/gitlab.pot
- qa/qa/resource/user.rb 1 个添加, 1 个删除qa/qa/resource/user.rb
- qa/qa/specs/features/ee/api/9_data_stores/elasticsearch/elasticsearch_api_spec.rb 7 个添加, 1 个删除...api/9_data_stores/elasticsearch/elasticsearch_api_spec.rb
- qa/spec/resource/user_spec.rb 5 个添加, 4 个删除qa/spec/resource/user_spec.rb
- spec/controllers/registrations_controller_spec.rb 27 个添加, 0 个删除spec/controllers/registrations_controller_spec.rb
- spec/initializers/settings_spec.rb 36 个添加, 0 个删除spec/initializers/settings_spec.rb
- spec/lib/security/weak_passwords_spec.rb 112 个添加, 0 个删除spec/lib/security/weak_passwords_spec.rb
- spec/models/user_spec.rb 52 个添加, 0 个删除spec/models/user_spec.rb
加载中
想要评论请 注册 或 登录