matrix-org / mjolnir

A moderation tool for Matrix
Apache License 2.0
316 stars 54 forks source link

Raid protection #267

Open ShadowJonathan opened 2 years ago

ShadowJonathan commented 2 years ago

Is your feature request related to a problem? Please describe.

We just had a room get "invaded" by a bunch of users all at once, around 60 of them joining with no clear purpose, just all one-after-another.

Describe the solution you'd like

Be able to detect and automatically apply kick/mute on these users, or have commands to easily apply actions for users "joined in the last Y timespan".

Additional context

I remember in the early days where Discord had this, where it detected if 4 or more users joined after eachother in 15 minutes, and they had to be manually cleared by moderation.

The server this was on had infrequent joins, and was often plagued by abusive people (who'd mock people on the server), so this contingency measure was put in place to lessen the effectiveness of "dumb" raids (as opposed to "smart" raids, where people trickle in in a long timespan, though still saying nothing until they all spammed the general chat)

Yoric commented 2 years ago

have commands to easily apply actions for users "joined in the last Y timespan".

We have recently landed a command !since that can be used to kick/ban users who have joined in the last Y timespan. Would that do the trick?

We should probably expand this to mute.

I remember in the early days where Discord had this, where it detected if 4 or more users joined after eachother in 15 minutes, and they had to be manually cleared by moderation.

This could be implemented as a new customizable protection, I suppose. If too many users join one after the other, mute them by default and inform the moderator, I guess?

ShadowJonathan commented 2 years ago

If too many users join one after the other, mute them by default and inform the moderator, I guess?

Exactly, with maybe some quick buttons/actions to approve them en-masse, or some manual actions to pick out who to unmute specifically, and kick the rest.

Yoric commented 2 years ago

For the time being, I'm adding support for mute and unmute to command !since in #272 . I'll try and think of a good way to implement the protection you're interested in. Or, if you wish to write it yourself, I can review!

ShadowJonathan commented 2 years ago

Thanks, i'll add it to my todo :+1:

ShadowJonathan commented 2 years ago

Given the urgency of the current spam waves on matrix, i'll work on a "quicker" version of this, a protection module that will - very simply - put the room on invite-only if it detects 100 users joining within an hour.

It can be abused (by triggering it explicitly by joining with that many users), and it can have false positives (i.e. a mass join event), but it could work as a backstop while a better solution is created.