Skip to content

Use auto-ban service in new abuse report worker

Ian Anderson requested to merge ia-abuse-report-worker-auto-ban-service into master

What does this MR do and why?

Related to https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/548?work_item_iid=795

This MR is just a refactor to use the auto-ban service instead of calling user.ban! when auto-banning users in the NewAbuseReportWorker. Additional logic performed in the auto-ban service will be beneficial here.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Note: Since this is a refactor there won't be any noticeable changes from the behavior on the master branch.

  1. Ensure GDK is running with the environment variable GITLAB_SIMULATE_SAAS=true exported in the environment.

  2. As a regular user, create the gitlab-com group at the top level.

  3. Tail the relevant sidekiq logs tail -f /path/to/GDK/gitlab/log/sidekiq.log | grep NewAbuseReportWorker

  4. As the same user who created the gitlab-com group (or a regular user you added to that group) report abuse for another user that was created within the last 7 days. The user should be reported for creating spam.

    image

  5. After submitting the report you should see the job queued and completed in the sidekiq logs.

  6. Verify that the user is banned in the admin UI.

Edited by Ian Anderson

Merge request reports