Расширение:CheckUser

From mediawiki.org
This page is a translated version of the page Extension:CheckUser and the translation is 33% complete.
Outdated translations are marked like this.
Справка по расширениям MediaWiki
CheckUser
Статус релиза: стабильно
Реализация Служебная страница , Идентификация пользователя , API , Хук , База данных
Описание Позволяет определить, какие IP-адреса используются данной учётной записью и какие учётные записи используют данный IP-адрес без ручных запросов непосредственно к базе данных.
Автор(ы) Tim Starling, Aaron Schulz, Dreamy Jazz
Последняя версия 2.5 (continuous updates)
Политика совместимости Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.35+
PHP 7.4.3+
Изменения в БД Да
Таблицы cu_changes
cu_log_event
cu_private_event
cu_log
cu_useragent_clienthints
cu_useragent_clienthints_map
Лицензия GNU General Public License 2.0 или позднее
Скачать
  • $wgCheckUserGBtoollink
  • $wgCheckUserClientHintsSpecialPages
  • $wgCheckUserCAMultiLock
  • $wgCheckUserLogSuccessfulBotLogins
  • $wgCheckUserLogLogins
  • $wgCUPublicKey
  • $wgCheckUserCAtoollink
  • $wgCheckUserClientHintsRestApiMaxTimeLag
  • $wgCheckUserDeveloperMode
  • $wgCheckUserClientHintsForDisplay
  • $wgCUDMaxAge
  • $wgCheckUserCIDRLimit
  • $wgCheckUserMaxBlocks
  • $wgCheckUserPurgeOldClientHintsData
  • $wgCheckUserDisplayClientHints
  • $wgCheckUserClientHintsUnsetHeaderWhenPossible
  • $wgCheckUserForceSummary
  • $wgCheckUserEnableSpecialInvestigate
  • $wgCheckUserLogAdditionalRights
  • $wgCheckUserCollapseCheckUserHelperByDefault
  • $wgCheckUserClientHintsValuesToHide
  • $wgCheckUserClientHintsEnabled
  • $wgCheckUserMaximumRowCount
  • $wgCheckUserInvestigateMaximumRowCount
  • $wgCheckUserTemporaryAccountMaxAge
  • $wgCheckUserEventTablesMigrationStage
  • $wgCheckUserClientHintsHeaders

  • checkuser
  • checkuser-log
  • checkuser-temporary-account
  • investigate
Ежеквартальные загрузки 240 (Ranked 28th)
Использование общедоступными вики 9,118 (Ranked 13th)
Переведите расширение CheckUser, если оно доступно на translatewiki.net
Проблемы Открытые задачи · Сообщить об ошибке
Эта страница ― о расширении движка MediaWiki. О политике Фонда Викимедиа относительно проверок участников см. m:CheckUser policy.

CheckUser ― расширение, позволяющее участнику (со checkuser) определить, какие IP-адреса используются данной учётной записью и какие учётные записи используют данный IP-адрес без ручных запросов непосредственно к базе данных. Оно запущено во всех проектах Фонда Вимедиа.

Обновление производится согласно потребностям проектов или в случае выявления критической уязвимости.

Установка

  • Скачайте и распакуйте файл(ы) в папку с названием CheckUser в вашей папке extensions/.
    Вместо этого разработчикам и соавторам кода следует установить расширение из Git, используя:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CheckUser
  • Если и только если устанавливаете из git, запустите Composer для установки зависимостей PHP, запустив composer install --no-dev в каталоге расширений. (Смотрите задача T173141 о возможных осложнениях.)
  • Добавьте следующий код в конце вашего файла LocalSettings.php :
    wfLoadExtension( 'CheckUser' );
    
  • Выполните скрипт обновления, который автоматически создаст необходимые таблицы, используемые расширением.
  • Configure as required.
  • Yes Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.

Using MediaWiki-Docker

Follow the steps in MediaWiki-Docker/Extension/CheckUser to install this extension inside a MediaWiki Docker instance.

Настройка

Этот инструмент копирует данные о последних изменениях в отдельные таблицы и добавляет их при добавлении новых записей. Если для $wgPutIPinRC задано значение false, скопированные данные не будут содержать связанный IP-адрес. Тем не менее, записи, добавленные после установки этого расширения, будут содержать IP-адрес.

После установки этого расширения вы можете уменьшить $wgRCMaxAge , чтобы сделать недавние изменения короче, не затрагивая checkuser. Используйте $wgCUDMaxAge, чтобы указать, как далеко могут идти данные checkuser в секундах.

Параметр $wgCheckUserCIDRLimit определяется самый большой диапазон, который можно проверить за одну проверку. Его формат такой же, как у $wgBlockCIDRLimit . По умолчанию лимит составляет /32 для проверок IPv6 и /16 для проверок IPv4.

To allow this tool to log successful and failed login attempts as well as logouts, set $wgCheckUserLogLogins to true. If you have bot accounts on your wiki, setting $wgCheckUserLogSuccessfulBotLogins to false will skip logging successful login attempts to bot accounts.

Предоставление права на использование CheckUser

Чтобы предоставить право на использование функции «Проверка участника», участник, имеющий право назначать проверяющих, должен перейти на Special:UserRights и ввести имя пользователя в поле, а затем выбрать опцию «проверяющий участников». Как только это будет сделано, функция «Проверить участника» появится на странице Special:SpecialPages для этого участника.

To allow users to access the IP addresses of temporary accounts, they should be granted the checkuser-temporary-account right.

Чтобы включить управление правами участников для администраторов, добавьте в LocalSettings.php следующий код:

$wgGroupPermissions['sysop']['checkuser'] = true;
$wgGroupPermissions['sysop']['checkuser-log'] = true;
$wgGroupPermissions['sysop']['investigate'] = true;
$wgGroupPermissions['sysop']['checkuser-temporary-account'] = true;

Чтобы разрешить только добавление и удаление разрешения checkuser, используйте вместо этого следующее:

$wgAddGroups['sysop'][] = 'checkuser';
$wgRemoveGroups['sysop'][] = 'checkuser';

Настройка

Настройки в extension.json
параметр по умолчанию комментарий
$wgCUDMaxAge 7776000 Как долго хранить данные CU (в секундах)? (по умолчанию = 3 месяца)
$wgCheckUserMaxBlocks 200 Mass block limits
$wgCheckUserForceSummary false Задайте для этого параметра значение true, если вы хотите заставить участников указывать причину каждой проверки, которую они выполняют через Special:CheckUser. (Не очень полезно, учитывая, что участники могут просто дать краткое изложение, например, «они должны быть проверены» или «Мне хочется», и программное обеспечение не будет знать об этом.)
$wgCheckUserCIDRLimit [ 'IPv4' => 16, 'IPv6' => 19 ] Кратчайшие пределы CIDR, которые можно проверить в любой отдельной проверке диапазона
$wgCUPublicKey '' Открытый ключ для шифрования личных данных, которые, возможно, потребуется прочитать позже. Создайте открытый ключ с чем-то вроде:

openssl genrsa -out cu.key 2048; openssl rsa -in cu.key -pubout > cu.pub и вставьте содержимое cu.pub здесь

Used with an associated private key to encrypt certain data that is not shown to CUs but stored in the cu_changes or cu_private_event table. Currently this is only the recipients of emails. Without a valid public key the data will not be stored.

$wgCheckUserCAMultiLock false This can be used to add a link to Special:MultiLock by CentralAuth to the Special:CheckUser's mass block form. This requires the Расширение:CentralAuth extension to be installed on the wiki. To enable this, set this to an array with a central wiki's database name and an array with the name(s) of the global group(s) to add the link for. For example:
$wgCheckUserCAMultiLock = [
    'centralDB' => 'metawiki',
    'groups' => [ 'steward' ]
];
$wgCheckUserCAtoollink false Since 77360f1cf1d2. This adds a link to central wiki Special:CentralAuth to the Special:CheckUser's "Get users" results. This requires the Расширение:CentralAuth extension to be installed on the wiki. To enable this, set this with a central wiki's database name. For example:
$wgCheckUserCAtoollink = 'metawiki';
$wgCheckUserGBtoollink false Since 77360f1cf1d2. This adds a link to local or central wiki Special:GlobalBlock to the Special:CheckUser's "Get users" results. This requires the GlobalBlocking extension to be installed on the wiki. To enable this, if a $wgConf is configured, set this to an array with a central wiki's database name and an array with the name(s) of the local (or global if you have Расширение:CentralAuth installed) group(s) to add the link for. For example:
$wgCheckUserGBtoollink = [
	'centralDB' => 'metawiki',
	'groups' => [ 'steward', 'staff' ]
];
$wgCheckUserEnableSpecialInvestigate false (<=1.39)
true (1.40+)
Since 57dcfe46d2e4. This enables Special:Investigate, an updated version of Special:CheckUser that allows checking for multiple user accounts and IP addresses within one investigation.
$wgCheckUserLogLogins false Whether CheckUser should log login and logout attempts (both successful and not).
$wgCheckUserLogSuccessfulBotLogins true Whether CheckUser should store successful login attempts to accounts with the bot user group if $wgCheckUserLogLogins is set to true. Only is used if $wgCheckUserLogLogins is true
$wgCheckUserMaximumRowCount 5000 The maximum number of results that can be returned by Special:CheckUser. Before MediaWiki 1.39, in the 'Get edits' and 'Get IPs' results having over 5000 results would return the results in a different format. From MediaWiki 1.39 this is the maximum number of results to show by page and more can be generated using the paging links
$wgCheckUserInvestigateMaximumRowCount 25000 Similar to $wgCheckUserMaximumRowCount, but for Investigate
$wgCheckUserTemporaryAccountMaxAge (1.40+) 86400 The number of seconds for which the temporary account API response is fresh.
$wgCheckUserEventTablesMigrationStage (1.40+) 3 Used to control the migration stage of log events stored in cu_changes to the new cu_log_event and cu_private_event tables. Is temporary and will be removed once migration is complete.
$wgCheckUserClientHintsEnabled (1.41+) true Used to control whether client hints should be collected and displayed in results by CheckUser.
$wgCheckUserClientHintsSpecialPages (1.41+) [ "CreateAccount", "Emailuser", "PasswordReset", "Userlogin", "Userlogout" ] The list of SpecialPages where CheckUser will request client hints if $wgCheckUserClientHintsEnabled is true.
$wgCheckUserClientHintsActionQueryParameter (1.41+) [ "history" ] The list of "action" values in the query parameters where client hints will be requested.
$wgCheckUserClientHintsHeaders (1.41+) { "Sec-CH-UA": "", "Sec-CH-UA-Arch": "architecture", "Sec-CH-UA-Bitness": "bitness", "": "brands", "Sec-CH-UA-Form-Factor": "", "Sec-CH-UA-Full-Version-List": "fullVersionList", "Sec-CH-UA-Mobile": "mobile", "Sec-CH-UA-Model": "model", "Sec-CH-UA-Platform": "platform", "Sec-CH-UA-Platform-Version": "platformVersion", "Sec-CH-UA-WoW64": ""} The list of client hint types that will be requested. Keys represent the client hint values requested using the Accept-CH header. Values represent the equivalent name when requesting them from the JS client side client hints API.
$wgCheckUserClientHintsUnsetHeaderWhenPossible (1.41+) true If true, the server will send an empty Accept-CH header when the user is viewing a page which does not need client hints data.


Использование Special:CheckUser

Основной интерфейс

  1. Перейдите на Special:CheckUser.
  2. В поле «Участник» введите имя участника (без префикса «User:»), IP-адрес или диапазон CIDR.
    • IP: любой адрес IPv4 или IPv6.
    • CIDR: you can check a range of IP addresses by appending the CIDR prefix. The CIDR prefix value for IPv4 can be between 16-32 and the value for IPv6 can be between 19-128. The smaller number for both ranges can be changed using the configuration variable $wgCheckUserCIDRLimit. Об обозначениях смотрите Help:Блоки диапазонов .
    • XFF: вы можете проверить IP-адрес клиента, предоставленный заголовками X-Forwarded-For, добавив /xff (например, 127.0.0.1/xff).
  3. Выберите информацию, которую хотите получить.
    • Запросить IP-адреса - #* Запросить IP-адреса: возвращает IP-адреса, используемые зарегистрированным участником.
    • Get actions - #* Получить правки: возвращает все изменения и зарегистрированные действия, сделанные участником (зарегистрированным или анонимным) с IP-адреса или диапазона.
    • Получить участников - #* Получить участников: возвращает учетные записи участников, которые редактировали с указанного IP-адреса или диапазона.
  1. В поле причина введите причину, по которой вы обращаетесь к конфиденциальным данным.

Постарайтесь кратко охарактеризовать ситуацию (например, «кросс-вики-спам»); это будет зарегистрировано в журнале, видимом только участникам с разрешением checkuser-log.


Получение информации

Типичная запись в результатах проверки CheckUser (получить участников) выглядит следующим образом:


  1. Example user agent

Он отформатирован так, чтобы вместить большой объём информации в формат, который можно очень легко перечислить и просмотреть, но его трудно понять, если вы не знаете, что это такое. Информация размещена следующим образом:

  • участник (ссылки на страницы участника) (период времени, когда он редактировал с данного IP-адреса или диапазона) [количество правок с IP-адреса или диапазона]
    1. IP-адрес изменён с XFF: Предоставлена информация XFF (может быть подделана)

Каждая комбинация IP/XFF, использованная для редактирования, указана в порядке использования.

После этого будут перечислены последние десять пользовательских агентов (браузер, операционная система, системный язык и версии) для каждого участника, совершавшего правки с IP-адреса или диапазона.

Формат XXF

XFF (X-Forwarded-For) headers indicate the series of IP addresses used from the user's computer (first) to the last proxy server. In case of Wikimedia, the last proxy server is one of the Wikimedia proxies (listed under $wgCdnServersNoPurge in the Wikimedia configuration file).

In this example:

aaa.aaa.aaa.aaa XFF: 10.4.46.42, 127.0.0.1, aaa.aaa.aaa.aaa, 208.80.152.46

  • the first two addresses (10.4.46.42, 127.0.0.1) are private to the originating network and can't be reached directly from the public Internet,
  • the third address (aaa.aaa.aaa.aaa) is the "public face" of the editor, usually a broadband or dial-up ISP, a company gateway, (but possibly an anonymizer or a malware-compromised server),
  • the last address (208.80.152.46) is one of the Wikimedia squids (sq36.wikimedia.org).

MediaWiki configuration settings $wgUsePrivateIPs , $wgCdnServers , $wgCdnServersNoPurge and extensions using the IsTrustedProxy hook (such as Расширение:TrustedXFF ) change the way an actual IP address used to attribute edits is selected.

Personal tool links

When you get results from Special:CheckUser you can add personal user tool links via the following interface messages:

  • MediaWiki:checkuser-toollinks for IPs in the 'Get IP Addresses' check type (for example m:MediaWiki:checkuser-toollinks)
  • MediaWiki:Checkuser-cidr-tool-links for IP ranges produced by the CIDR calculator present at the bottom of all Special:CheckUser pages. Interface message added in 1.41.


Special:Investigate usage

Basic usage

  1. Go to Special:Investigate.
  1. In the Имена участников или IP-адреса field, type in up to 10 targets, which may be usernames (without the User: prefix), IP addresses, or CIDR ranges.
  2. In the Причина field, enter the reason you are accessing the confidential data, as described in the Special:CheckUser instructions above; this will be logged in a log visible only to users with the checkuser-log permission.

For advanced feature usage, see Help:Special Investigate.

Customizing tool links

As with Special:CheckUser, links to external tools can be customized.

The links are defined in the checkuser-investigate-compare-toollinks message. This message is parsed to find links, which are added to the menu in the IP-адреса и агенты пользователя tab.


Showing IPs for temporary accounts

Версия MediaWiki:
1.40

The CheckUser extension will show since MediaWiki 1.40 a button that is displayed next to temporary account user links which allows the revealing of their IP address.

This functionality is available exclusively to users with the checkuser-temporary-account privilege, granting them the ability to view the IP addresses that are linked to temporary accounts. To access this information, the Enable revealing IP addresses for temporary accounts feature must be enabled on the user's Special:Preferences page.

These buttons will appear wherever user links are shown for a temporary account, such as when viewing page histories or in Special:Contributions. However, these will not be shown on Special:CheckUser, Special:Investigate or Special:InvestigateBlock.

API

CheckUser and CheckUserLog API

CheckUser также предоставляет API. These two APIs work fairly similarly to the special pages, but the reason for a check using the checkuser API is prefixed with "API:" to indicate they were made using the API. Example usages of these APIs are shown below.

CheckUser API
api.php?action=query&list=checkuser&curequest=userips&cutarget=Jimbo_Wales
api.php?action=query&list=checkuser&curequest=edits&cutarget=127.0.0.1/16&xff=1&cureason=Some_check
CheckUserLog API
api.php?action=query&list=checkuserlog&culuser=WikiSysop&cullimit=25
api.php?action=query&list=checkuserlog&cultarget=127.0.0.1&culfrom=20111015230000

Temporary Account Reveal API

Версия MediaWiki:
1.40

Usage

The TemporaryAccountHandler class offers API endpoints for retrieving the IP addresses associated with temporary user accounts. To access this information, the Enable revealing IP addresses for temporary accounts feature must be enabled on the user's Special:Preferences page.

API endpoint

GET /rest.php/checkuser/v0/temporaryaccount/{name} where {name} is the user name you want to look up

Response

If the request is successful, the API will respond with a JSON object containing the following fields:

Name Type Description
ips string[] IPs of the given temporary account

If the request fails, the API will respond with an appropriate error code and message.

Example request

GET /rest.php/checkuser/v0/temporaryaccount/*Unregistered%202

Example response

{"ips": [ "114.127.69.62" , "212.47.235.82" , "212.47.235.81" ]}

TemporaryAccountRevisionHandler

The TemporaryAccountRevisionHandler class offers API endpoints for viewing the IP associated with a revision for temporary accounts. You can specify one or multiple revision IDs in the query string.

API endpoint

GET /rest.php/checkuser/v0/temporaryaccount/*Unregistered%203/revisions/{revisionId} where {revisionId} is the revision ID(s) you want to look up separated by the | character.

Response

If the request is successful, the API will respond with a JSON object containing the following fields:

Name Type Description
ips dictionary The revision ID as the key and the associated IP address as the value.

If the request fails, the API will respond with an appropriate error code and message.

Example request

GET /rest.php/checkuser/v0/temporaryaccount/*Unregistered%203/revisions/31

Example response

{"ips":{"31":"40.175.36.227"}}

Example request with multiple revisions

GET /w/rest.php/checkuser/v0/temporaryaccount/*Unregistered%205/revisions/194|193

Example response

{"ips":{"194":"40.175.36.227","193":"1.2.3.4"}}