Send email notification when 2FA is disabled
requested to merge 26149-email-notifications-not-being-sent-on-important-security-event-like-disabling-2fa into master
What does this MR do?
For #26149 (closed)
This change
- Sends out an email notification to the user when their 2FA is disabled.
Currently, there are 2 ways 2FA can be disabled.
- The user can disable it themselves via
profile/two_factor_auth
page. - The GitLab instance admin can disable the 2FA of any user in the system via the
/admin/users/:username
page.
Disabling 2FA from both these places will send out an email to the affected user, informing them about their 2FA being disabled.
I've also created a follow-up issue #238177 (closed), to add Audit Event when the 2FA of a user is disabled. Keeping this follow-up in mind, I have moved the logic to a new Service
class, so that it can be extended easily.
Screenshots
Email - HTML Version
Email - Plaintext version
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Manoj M J [On PTO]