Open main menu

확장기능:편집필터

This page is a translated version of the page Extension:AbuseFilter and the translation is 18% complete.

Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎català • ‎dansk • ‎español • ‎français • ‎galego • ‎magyar • ‎polski • ‎português • ‎português do Brasil • ‎română • ‎sicilianu • ‎čeština • ‎български • ‎русский • ‎עברית • ‎سنڌي • ‎فارسی • ‎हिन्दी • ‎বাংলা • ‎中文 • ‎日本語 • ‎粵語 • ‎한국어
미디어위키 확장 기능 매뉴얼
OOjs UI icon advanced.svg
AbuseFilter
출시 상태: 안정
AbuseFilter-Management.png
구현 User activity , 특수 문서 , API
설명 Allows specific behavior-based restrictions to be placed on wiki activity
만든이
호환성 정책 출시 브랜치
MediaWiki 1.33+
PHP 5.4+ recommended
데이터베이스 변경
테이블 abuse_filter
abuse_filter_action
abuse_filter_history
abuse_filter_log
라이선스 GNU 일반 공중 사용 허가서 2.0 or later
다운로드
  • $wgAbuseFilterActions
  • $wgAbuseFilterConditionLimit
  • $wgAbuseFilterEmergencyDisableThreshold
  • $wgAbuseFilterEmergencyDisableCount
  • $wgAbuseFilterEmergencyDisableAge
  • $wgAbuseFilterParserClass
  • $wgAbuseFilterRestrictions
  • $wgAbuseFilterNotifications
  • $wgAbuseFilterNotificationsPrivate
  • $wgAbuseFilterCentralDB
  • $wgAbuseFilterIsCentral
  • $wgAbuseFilterDisallowGlobalLocalBlocks
  • $wgAbuseFilterBlockDuration
  • $wgAbuseFilterAnonBlockDuration
  • $wgAbuseFilterCustomActionsHandler
  • $wgAbuseFilterValidGroups
  • $wgAbuseFilterDefaultWarningMessage
  • $wgAbuseFilterIPMaxAge
  • $wgAbuseFilterProfileActionsCap
  • $wgAbuseFilterLogPrivateDetailsAccess
  • $wgAbuseFilterPrivateDetailsForceReason
  • abusefilter-view
  • abusefilter-log
  • abusefilter-log-detail
  • abusefilter-revert
  • abusefilter-privatedetails
  • abusefilter-privatedetails-log
  • abusefilter-view-private
  • abusefilter-log-private
  • abusefilter-hidden-log
  • abusefilter-hide-log
  • abusefilter-modify
  • abusefilter-modify-restricted
  • abusefilter-modify-global
AbuseFilter 확장 기능 번역 (translatewiki.net에서 가능한 경우)
사용법과 버전 매트릭스를 확인합니다.
이슈 미해결 작업 · 버그 보고

The AbuseFilter extension allows privileged users to set specific actions to be taken when actions by users, such as edits, match certain criteria.

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.

Contents

요구 사양

There are no required dependencies for this extension.

설치

  • 파일을 다운로드해서, extensions/ 폴더 내의 AbuseFilter 이라는 이름의 디렉터리 내에 설치합니다.
  • PHP 의존 기능을 설치하려면 Composer를 실행하여 확장 기능 디렉터리에 composer install --no-dev를 발행하십시오. (잠재적인 문제에 대해서는 T173141 을 참고하십시오.)
  • 아래의 코드를 LocalSettings.php의 말미에 추가합니다:
    wfLoadExtension( 'AbuseFilter' );
    
  • 갱신 스크립트를 실행합니다. 이 스크립트는 이 확장기능을 필요로 하는 데이터 베이스 테이블을 자동적으로 작성합니다.
  •   완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.

미디어위키 1.26 이하를 실행 중인 사용자에게:

위의 지시사항은 wfLoadExtension()을 사용하여 이 확장기능을 설치하는 새로운 방법을 기술한 것으로, wfLoadExtension( 'AbuseFilter' ); 대신 초기 버전(미디어위키 1.26 이하)에 이 확장기능을 설치하려면 다음을 사용해야 합니다:

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

사용자 권한

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

권한 설명
abusefilter-modify 편집 필터 수정
abusefilter-view 편집 필터 보기
abusefilter-log 편집 필터 기록 보기
abusefilter-log-detail 편집 필터 기록의 자세한 내용 보기
abusefilter-privatedetails 편집 필터 기록의 비공개 정보 보기
abusefilter-modify-restricted 편집 필터의 제한된 기능 설정 바꾸기
abusefilter-modify-global 전역 편집 필터를 만들거나 수정하기
abusefilter-revert 주어진 필터에 의한 모든 바뀜을 되돌리기
abusefilter-view-private 비공개된 필터 보기
abusefilter-log-private 비공개된 편집 필터 기록 보기
abusefilter-hide-log 편집 필터 기록의 항목 숨기기
abusefilter-hidden-log 숨겨진 편집 필터 기록 보기
abusefilter-privatedetails-log 편집 필터 비공개 상세 정보 접근 기록 보기

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;
비공개 필터는 abusefilter-modify 권한이나 abusefilter-view-private 권한이 있는 사용자만이 볼 수 있습니다.

편집필터를 만들거나 관리

확장 기능을 설치한 다음에는 Special:AbuseFilter에서 필터를 만들거나, 시험하거나, 변경/삭제할 수 있습니다.

설정

변수명 기본값 설명
$wgAbuseFilterActions array( 'flag' => true, 'throttle' => true, 'warn' => true, 'disallow' => true, 'blockautopromote' => true, 'block' => true, 'rangeblock' => false, 'degroup' => true, 'tag' => true ) The possible actions that can be taken by abuse filters. 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. Other extensions may add other groups.
$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). See emergency throttling.
$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' 편집 필터에 의한 차단 기간입니다.
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.
$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.
$wgAbuseFilterProfileActionsCap 10000 Number of action that determines when to reset profiling stats.
$wgAbuseFilterLogPrivateDetailsAccess false Whether accessing private information from a filter log entry is logged.
$wgAbuseFilterPrivateDetailsForceReason false Whether users are forced to provide a reason for accessing private information from a filter log entry.

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

;변수
  • 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):
  • 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.

;예시

List non-private abuse filters

list = abuselog

List instances where actions triggered an abuse filter.

;변수
  • 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):
  • 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)
;예시

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

Emergency throttling

AbuseFilter comes with a feature that automatically throttles (disable) filters that have been edited recently and match a certain theresold of the latest actions.

This is done to prevent harmful edits on the filters to block every user that performs an action on the wiki or similar.

The condition to disable the filter depend on those variables:

  • $wgAbuseFilterEmergencyDisableThreshold - Percent of matches over the total amount of actions in the observed period.
  • $wgAbuseFilterEmergencyDisableCount - Count of matches of the filter in the observed period.
  • $wgAbuseFilterEmergencyDisableAge - Age of the filter to take it into account. If the last edit of the filter is older than this number of seconds, the filter won't be throttled, unless it's already throttled.
  • $wgAbuseFilterProfileActionsCap - Maximum number of recent actions to count against the threshold. Note that each action increments a counter, and once this counter reaches this configured value, this counter and the number of recent actions that matches all filters are reset to 0.

Throttled filters can be identified in the list of filters (Special:AbuseFilter) with the state Enabled, throttled. Throttling happens silently, and there's no way to see when a filter got throttled.

When a filter gets throttled, it doesn't perform any dangerous action (the ones specified in $wgAbuseFilterRestrictions), and only "safe" actions are allowed. Throttled filters don't get enabled automatically. To disable the throttling, you need to edit the filter. Note that you need to actually change something from the filter: changing somethin from the filter's notes is sufficient.

Note that editing the filter updates its age, and can cause it to be disabled if it reaches again the conditions to be throttled in a short period since the last edit, leading to a unusable filter if your wiki has more abuse edits than legitimate ones. Filters can also get randomly throttled if the action count reaches $wgAbuseFilterProfileActionsCap, causing all filter matches count to reset to 0, and then someone repeatedly makes a filter to hit.

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)

같이 보기