Extension:Filtro de Abuso

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:AbuseFilter and the translation is 30% complete.

Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎català • ‎dansk • ‎español • ‎français • ‎galego • ‎italiano • ‎polski • ‎português • ‎português do Brasil • ‎sicilianu • ‎suomi • ‎yue • ‎čeština • ‎български • ‎русский • ‎עברית • ‎العربية • ‎سنڌي • ‎فارسی • ‎中文 • ‎日本語 • ‎한국어
Manual de extensões do MediaWiki
Crystal Clear action run.svg
AbuseFilter
Estado da versão: estável
AbuseFilter-Management.png
Implementação User activity, Special page, API
Descrição Permite colocar restrições baseadas em comportamentos específicos na atividade da wiki.
Autor(es)
Normas de
compatibilidade
ramos de lançamentos
MediaWiki 1.25+
PHP 5.4+ recomendado
Alterações à
base de dados
Sim
Tabelas abuse_filter
abuse_filter_action
abuse_filter_history
abuse_filter_log
Licença GNU General Public License 2.0 or later
Exportação (Download)
Parâmetros
  • $wgAbuseFilterActions
  • $wgAbuseFilterConditionLimit
  • $wgAbuseFilterEmergencyDisableThreshold
  • $wgAbuseFilterEmergencyDisableCount
  • $wgAbuseFilterEmergencyDisableAge
  • $wgAbuseFilterParserClass
  • $wgAbuseFilterRestrictions
  • $wgAbuseFilterNotifications
  • $wgAbuseFilterNotificationsPrivate
  • $wgAbuseFilterCentralDB
  • $wgAbuseFilterIsCentral
  • $wgAbuseFilterDisallowGlobalLocalBlocks
  • $wgAbuseFilterBlockDuration
  • $wgAbuseFilterAnonBlockDuration
  • $wgAbuseFilterCustomActionsHandler
  • $wgAbuseFilterValidGroups
  • $wgAbuseFilterDefaultWarningMessage
  • $wgAbuseFilterIPMaxAge
  • $wgAbuseFilterProfile
  • $wgAbuseFilterRuntimeProfile
  • $wgAbuseFilterProfileActionsCap
Privilégios adicionados
  • abusefilter-view
  • abusefilter-log
  • abusefilter-log-detail
  • abusefilter-revert
  • abusefilter-private
  • abusefilter-private-log
  • abusefilter-view-private
  • abusefilter-log-private
  • abusefilter-hidden-log
  • abusefilter-hide-log
  • abusefilter-modify
  • abusefilter-modify-restricted
  • abusefilter-modify-global
Hooks usados
EditFilterMerged
GetAutoPromoteGroups
AbortMove
MovePageCheckPermissions
ArticleDelete
RecentChange_save
ListDefinedTags
ChangeTagsListActive
LoadExtensionSchemaUpdates
ContributionsToolLinks
UploadVerifyFile
UploadVerifyUpload
UploadStashFile
MakeGlobalVariablesScript
PageContentSaveComplete
UserMergeAccountFields
ParserOutputStashForEdit
Traduza a extensão AbuseFilter se ela estiver disponível na wiki translatewiki.net
Verifique a matriz de utilização e versões
Problemas Tarefas em aberto · Reportar um problema

A extensão Filtro de Abuso permite que utilizadores privilegiados estabeleçam controlos específicos sobre ações de utilizadores, como edições, e criar reações automáticas para certos comportamentos.

For example, a filter could be created to prevent anonymous users from adding external links, or to block a user who removes more than 2000 characters.

Requerimentos

There are no required dependencies for this extension.

Instalação

  • Exporte e coloque o ficheiro, ou ficheiros, num diretório chamado AbuseFilter, na sua pasta extensions/.
  • Run Composer to install PHP dependencies, by issuing composer install in the extension directory. (See T173141 for potential complications.)
  • Acrescente o seguinte código ao fundo do ficheiro LocalSettings.php:
    wfLoadExtension( 'AbuseFilter' );
    
  • Execute o script de atualização que irá criar automaticamente as tabelas da base de dados necessárias para esta extensão.
  • Yes Pronto – Na página especial Special:Version da sua wiki verifique se a extensão foi instalada.

Para utilizadores que tenham o MediaWiki versão 1.26 ou anteriores:

As instruções acima descrevem a nova forma de instalar esta extensão, usando a extensão wfLoadExtension() Se precisar de instalar esta extensão nestas versões anteriores (MediaWiki 1.26 e anteriores), em vez de wfLoadExtension( 'AbuseFilter' );, use:

require_once "$IP/extensions/AbuseFilter/AbuseFilter.php";


Direitos do Utilizador

Uma vez instalada a extensão, terá de estabelecer os direitos de utilizador em LocalSettings.php.

Direito Descrição
abusefilter-modify Modificar filtros de abuso
abusefilter-view Ver filtros de abuso
abusefilter-log Ver o registo de abusos
abusefilter-log-detail Ver entradas detalhadas do registo de abusos
abusefilter-private Ver dados privados no registo de abusos
abusefilter-modify-restricted Modificar filtros de abuso com ações restritas
abusefilter-modify-global Criar ou modificar os filtros globais de abusos
abusefilter-revert Reverter todas as alterações feitas por um dado filtro de abuso
abusefilter-view-private Ver filtros de abuso marcados como privados
abusefilter-log-private Mostrar entradas de registo de filtros de abuso marcados como privados
abusefilter-hide-log Ocultar entradas do filtro de abusos
abusefilter-hidden-log Ver entradas ocultadas do registo de abusos
abusefilter-private-log Ver o registo de consultas dos detalhes privados do filtro de abusos

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.

Creating and managing filters

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.

Configuração

Nome da variável Valor predefinido Descrição
$wgAbuseFilterActions array( 'flag' => true, 'throttle' => true, 'warn' => true, 'disallow' => true, 'blockautopromote' => true, 'block' => true, 'rangeblock' => false, 'degroup' => true, 'tag' => true ) As ações possíveis que podem ser realizadas pelos filtros de abuso. When adding a new action, check if it is restricted in $wgAbuseFilterRestrictions and, if it is, don't forget to add the abusefilter-modify-restricted right to the appropriate user groups.
$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').
$wgAbuseFilterValidGroups 'default' The list of "groups" filters can be divided into. By default there is only one group.
$wgAbuseFilterEmergencyDisableThreshold array( 'default' => 0.05 ) Disable a filter if it matched more than 2 edits, constituting more than 5 % of the actions which were checked against the filter's group in the "observed" period (at most one day), unless the filter has been changed in the last 86400 seconds (one day)
$wgAbuseFilterEmergencyDisableCount array( 'default' => 2 )
$wgAbuseFilterEmergencyDisableAge array( 'default' => 86400 )
$wgAbuseFilterParserClass 'AbuseFilterParser' Name of AbuseFilter's parser class.
$wgAbuseFilterRestrictions array( 'block' => true, 'degroup' => true, 'blockautopromote' => true, 'rangeblock' => true ) 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.
$wgAbuseFilterNotifications false Allows to configure the extension to send hit notifications to Special:RecentChanges or UDP. Available options: rc, udp, rcandudp
$wgAbuseFilterNotificationsPrivate false Enable notifications for private filters.
$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).
$wgAbuseFilterDisallowGlobalLocalBlocks false Disallow Centralised filters from taking actions that locally block, remove from groups, or revoke permissions.
$wgAbuseFilterBlockDuration 'indefinite' Duração dos blocos feitos pelo Filtro de Abuso
as of 1.31.0-wmf.25 block durations may be specified for every single filter and will override this variable. This variable is only used when enabling the block in order to preselect a default duration.
$wgAbuseFilterAnonBlockDuration null Duration of blocks made by AbuseFilter on users who are not logged in. The value of $wgAbuseFilterBlockDuration will be used if this is not set.
as of 1.31.0-wmf.25 block durations may be specified for every single filter and will override this variable. This variable is only used when enabling the block in order to preselect a default duration.
$wgAbuseFilterCustomActionsHandlers array() Callback functions for custom actions.
$wgAbuseFilterValidGroups array('default') Valid "filter groups" – used for applying edit filters to certain types of actions
$wgAbuseFilterDefaultWarningMessage array( 'default' => 'abusefilter-warning' ) Default warning messages, per filter group
$wgAbuseFilterLogIPMaxAge 3 * 30 * 24 * 3600 Age used as cutoff when purging old IP log data. Defaults to 3 months. Used by maintenance script purgeOldLogIPData.php.
$wgAbuseFilterProfile false
MediaWiki version: 1.27

Whether to record data about the performance of filters – the average number of conditions used and the time consumed by every filter.

(This was always enabled in MediaWiki up to 1.25, then entirely removed from 1.26 for performance reasons, then restored in 1.27.)

$wgAbuseFilterRuntimeProfile false Whether to calculate and record the total runtime, conditions, and matched filters on each execution.
$wgAbuseFilterProfileActionsCap 10000 Number of action that determines when to reset profiling stats.


API

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

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.

Exemplos

List non-private abuse filters

list = abuselog

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)
Exemplo

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

Possible errors

  • Some users might experience that creating new filters or modifying old filters fail and the user just gets redirected to the original page. If the Wiki is using SSL certificates, this error could possibly be because of the $wgServer value, which might be using "http://" instead of "https://". An indication of this error will be, the browser giving https warning for Special:AbuseFilter pages. (Topic:T23dyyih0ofjada5)

Ver também