Add tracking when auto banning users
What does this MR do and why?
This adds tracking when users are auto-banned because they tried to identify with a phone number or credit card that belongs to a previously banned user:
- write the event to the application log
- track the event in sisense
- record a custom attribute for the banned user
Issue: https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/369
How to set up and validate locally
-
From the console run the following
Users::AutoBanService.new(user: User.last, reason: :banned_phone_number).execute
-
Verify the custom attributes on that user's detail page now show something like
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Alex Buijs