Extension:CrowdSec

Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:GPL licensed extensions
MediaWiki extensions manual
CrowdSec
Release status: experimentalCategory:Experimental extensions
Implementation Page action Category:Page action extensions
Description Bouncer Integration with CrowdSec for anti-spam.
Author(s) MPThLeetalk
Latest version 0.20.0
MediaWiki 1.39+Category:Extensions with manual MediaWiki version
License GNU General Public License 2.0 or later
Download Category:Extensions in GitHub version control
  • $wgCrowdSecEnable
  • $wgCrowdSecAPIUrl
  • $wgCrowdSecAPIKey
  • $wgCrowdSecCache
  • $wgCrowdSecCacheTTL
  • $wgCrowdSecFallback
  • $wgCrowdSecRestrictRead
  • $wgCrowdSecTreatTypesAsBan
  • $wgCrowdSecReportOnly
Category:All extensions

This extension adds anti-spam integration with CrowdSec. It works as a bouncer, so it is mandatory to set up the CrowdSec Agent as well.

Installation

Configuration

Step 1: Setup CrowdSec Agent

Follow this documentation from CrowdSec. You may need to set up collections, logs, and more.

Then, you need to get a bouncer API token.

sudo cscli bouncers add mediawiki-bouncer

Remember the token key. It needs to be added to the extension configuration.

It is highly recommended to register with the Central API to pull blocklists from remote sources.

sudo cscli capi register

Step 2: Setup Extension

wfLoadExtension( 'CrowdSec' );
$wgCrowdSecAPIKey = ""; // Put LAPI key here.

This is the basic configuration. More configurations are documented in the README.

Notes

This extension is highly experimental. Use at your own risk.

  • There is no challenge method implemented. You can treat captcha decisions as bans using $wgCrowdSecTreatTypesAsBan.
  • This extension has been tested on MediaWiki 1.43. The minimum required version is 1.39+. It may work on older versions.

AbuseFilter Integration

This extension integrates with AbuseFilter. The variable crowdsec_decision represents the CrowdSec decision:

  • ok: The user is allowed to proceed.
  • ban: The user is banned according to LAPI.
  • error: The LAPI request failed.
  • unknown: Failed to retrieve the user's IP.
  • ... and various (custom) types from CrowdSec, including captcha.

User rights

  • crowdsec-bypass - Allows users to bypass the CrowdSec check.

See also

Category:Spam management extensions
Category:AbuseFilter-builder extensions Category:AbuseFilter-computeVariable extensions Category:AbuseFilter-generateUserVars extensions Category:All extensions Category:Experimental extensions Category:Extensions in GitHub version control Category:Extensions which add rights Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:Extensions without an image Category:GPL licensed extensions Category:GetUserPermissionsErrors extensions Category:OtherBlockLogLink extensions Category:Page action extensions Category:Spam management extensions