FANDOM


MediaWiki extensions manual - list
Extension:AbuseFilter

Release status: stable

Implementation User activity, Special page, API
Description <section begin=shortdesc />Allows specific behaviour-based restrictions to be placed on wiki activity.<section end=shortdesc />
Author(s) Andrew Garrett (WerdnaTalk)
MediaWiki 1.13+
PHP 5.3.4+ recommended
Database changes<abbr/> yes
License GPL v2 or later
Download
Parameters

$wgAbuseFilterAvailableActions
$wgAbuseFilterConditionLimit
$wgAbuseFilterEmergencyDisableThreshold
$wgAbuseFilterEmergencyDisableCount
$wgAbuseFilterEmergencyDisableAge
$wgAbuseFilterParserClass
$wgAbuseFilterStyleVersion
$wgAbuseFilterRestrictedActions
$wgAbuseFilterUDPPrefix
$wgAbuseFilterUDPAddress
$wgAbuseFilterUDPPort
$wgAbuseFilterCentralDB
$wgAbuseFilterIsCentral
$wgAbuseFilterBlockDuration

Added rights

abusefilter-view
abusefilter-modify
abusefilter-modify-restricted
abusefilter-log
abusefilter-log-detail
abusefilter-private
abusefilter-revert
abusefilter-view-private
abusefilter-hidden-log
abusefilter-hide-log

Hooks used
EditFilterMerged

GetAutoPromoteGroups
AbortMove
AbortNewAccount
ArticleDelete
LoadExtensionSchemaUpdates
RecentChange_save
ListDefinedTags
ContributionsToolLinks
UploadVerification
MakeGlobalVariablesScript

Check usage and version matrix
Bugs: list open list all report

<section begin=description />The AbuseFilter extension allows privileged users to set specific controls on actions by users, such as edits, and create automated reactions for certain behaviors.<section end=description />

Requirements Edit

This extension requires Extension:AntiSpoof to be installed on your wiki.

DownloadEdit

You can download the extension directly from the MediaWiki source code repository (browse code). You can get:

One of the extensions tags

Not all extensions have tags. Some extensions have tags for each release, in which case those tags have the same stability as the release. To download a tag

  • Go to the tags list
  • Click the name of the tag you want to download
  • Click "snapshot"
The latest version of one of the extensions branches

Each extension has a master branch containing the latest code (might be unstable). Extensions can have further branches as well.

  • Go to the branches list
  • Click the branch name
  • Click "snapshot"
A snapshot made during the release of a MediaWiki version.

This might be unstable and is not guaranteed to work with the associated MediaWiki version.

After you've got the code, save it into the extensions/Extension:AbuseFilter directory of your wiki.

If you are familiar with git and have shell access to your server, you can obtain the extension, with all its tags and branches, as follows:

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Extension%3AAbuseFilter.git


Installation Edit

  • Download and extract the files in a directory called "Extension:AbuseFilter" in your extensions/ folder.
  • Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/Extension:AbuseFilter/Extension:AbuseFilter.php" );
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • File:Yes check.svg Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

User rights Edit

Once you installed the extension, you'll have to set up the user rights in LocalSettings.php.

Right Description
abusefilter-modifyModify abuse filters
abusefilter-viewView abuse filters
abusefilter-logView the abuse log
abusefilter-log-detailView detailed abuse log entries
abusefilter-privateView private data in the abuse log
abusefilter-modify-restrictedModify abuse filters with restricted actions
abusefilter-revertRevert all changes by a given abuse filter
abusefilter-view-privateView abuse filters marked as private
abusefilter-log-privateView log entries of abuse filters marked as private
abusefilter-hide-logHide entries in the abuse log
abusefilter-hidden-logView hidden abuse log entries

For example, the following sample configuration would allow sysops to do everything they want with AbuseFilter, and everyone to view the log and see public filter settings:

$wgGroupPermissions['sysop']['abusefilter-modify'] = true;
$wgGroupPermissions['*']['abusefilter-log-detail'] = true;
$wgGroupPermissions['*']['abusefilter-view'] = true;
$wgGroupPermissions['*']['abusefilter-log'] = true;
$wgGroupPermissions['sysop']['abusefilter-private'] = true;
$wgGroupPermissions['sysop']['abusefilter-modify-restricted'] = true;
$wgGroupPermissions['sysop']['abusefilter-revert'] = true;
Filters marked as private can only be viewed by users with either the abusefilter-modify or abusefilter-view-private permission.

Abuse filter management Edit

Once the extension has been installed, filters can be created/tested/changed/deleted and the logs can be accessed from the Abuse filter management page Special:AbuseFilter.

Configuration Edit

Variable name Default value Description
$wgAbuseFilterAvailableActions array( 'flag', 'throttle', 'warn', 'disallow', 'blockautopromote', 'block', 'degroup', 'tag', 'rangeblock' ) The possible actions that can be taken by abuse filters.
$wgAbuseFilterConditionLimit 1000 The maximum number of 'conditions' that can be used each time the filters are run against a change. (More complex filters require more 'conditions').
$wgAbuseFilterEmergencyDisableThreshold 0.05 Disable filters if they match more than X edits, constituting more than Y% of the last Z edits, if they have been changed in the last S seconds
$wgAbuseFilterEmergencyDisableCount 2
$wgAbuseFilterEmergencyDisableAge 86400
$wgAbuseFilterParserClass 'AbuseFilterParser' Name of AbuseFilter's parser class.
$wgAbuseFilterStyleVersion Like $wgStyleVersion, but only for this extension. Developers should bump this number every time time they change any of the .css/.js files.
$wgAbuseFilterRestrictedActions array( 'block', 'degroup' ) Users must have the "abusefilter-modify-restricted" user right as well as "abusefilter-modify" in order to create or modify filters which carry out these actions.
$wgAbuseFilterUDPPrefix 'abusefilter:' Like $wgRC2UDPPrefix, but only for AbuseFilter?
$wgAbuseFilterUDPAddress null Like $wgRC2UDPAddress, but only for AbuseFilter?
$wgAbuseFilterUDPPort null Like $wgRC2UDPPort, but only for AbuseFilter?
$wgAbuseFilterCentralDB null Name of a database where global abuse filters will be stored in (only supported in the latest, development version).
$wgAbuseFilterIsCentral false Set this variable to true for the wiki where global AbuseFilters are stored in (only supported in the latest, development version).
$wgAbuseFilterBlockDuration 'indefinite' Duration of blocks made by AbuseFilter

API Edit

AbuseFilter adds two API list modules, one for details of abuse filters ("abusefilters") and one for the abuse log, since it is separate from other MediaWiki logs ("abuselog"). It is not possible to create or modify abuse filters using the API.

list = abusefilters Edit

List information about filters

Parameters
  • abfstartid: The filter id to start enumerating from
  • abfendid: The filter id to stop enumerating at
  • abfdir: The direction in which to enumerate (older, newer)
  • abfshow: Show only filters which meet these criteria (enabled|!enabled|deleted|!deleted|private|!private)
  • abflimit: The maximum number of filters to list
  • abfprop: Which properties to get (id|description|pattern|actions|hits|comments|lasteditor|lastedittime|status|private)

When filters are private, some of the properties specified with abfprop will be missing unless you have the appropriate user rights.

Examples

List non-private abuse filters

list = abuselog Edit

List instances where actions triggered an abuse filter.

Parameters
  • aflstart: The timestamp to start enumerating from
  • aflend: The timestamp to stop enumerating at
  • afldir: The direction in which to enumerate (older, newer)
  • afluser: Show only entries where the action was attempted by a given user or IP address.
  • afltitle: Show only entries where the action involved a given page.
  • aflfilter: Show only entries that triggered a given filter ID
  • afllimit: The maximum number of entries to list
  • aflprop: Which properties to get (ids|user|title|action|result|timestamp|details)
Example

List instances where the abuse filter was triggered in response to actions from the user "SineBot"

See alsoEdit


Language: English

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.