Skip to content

Send email notification when 2FA is disabled

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

Screenshot_2020-08-19_at_11.45.10_AM

Email - Plaintext version

Screenshot_2020-08-19_at_11.54.37_AM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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]

Merge request reports