Blocking a project causing high load
When to use this runbook: when the abuse originates from a specific GitLab project and needs to be mitigated at the application layer (Rails admin / rails console). For blocking by IP, path, or User-Agent at the edge, see the Cloudflare blocking and managing traffic runbook instead — Cloudflare is the preferred first option for blocking HTTP/S traffic.
-
Start a rails console issuing the command
sudo gitlab-rails console. -
Set the project in question to private. For example,
my-namespace/my-group/my-projectwould be:project = Project.find_by_full_path('my-namespace/my-group/my-project')project.visibility_level = Gitlab::VisibilityLevel::PRIVATEproject.save -
If that fails for some reason, navigate to the project via an admin account and disable that. For example, the URL for the example above would be:
https://gitlab.com/my-namespace/my-group/my-project/settings/edit
Under
Permissions, clickExpand, and setProject visibilityfromPublictoPrivate. -
For good measure, you may also want to toggle the
Repositorybutton from on to off. -
To avoid having these settings changed by the project owner, you may also want to block the owner of the project. For example:
project.owner.block!