Extension:CheckUser

From mediawiki.org
This page is a translated version of the page Extension:CheckUser and the translation is 63% complete.
Outdated translations are marked like this.
MediaWiki 拡張機能マニュアル
CheckUser
リリースの状態: 安定
実装 特別ページ , 利用者識別 , API , フック , データベース
説明 チェックユーザー機能を使用すると、チェックユーザー権限を持つ利用者は、指定された利用者名で使用されているIPと、特定のIPで使用されている利用者名を手動で照会する必要がなくなります。
作者 Tim Starling, Aaron Schulz, Dreamy Jazz
最新バージョン 2.5 (continuous updates)
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
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 一般公衆利用許諾書 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
Quarterly downloads 237 (Ranked 29th)
Public wikis using 9,118 (Ranked 13th)
translatewiki.net で翻訳を利用できる場合は、CheckUser 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告
このページは拡張機能そのものに関するものです。 ウィキメディア財団のチェックユーザーの方針については、m:チェックユーザーの方針を参照してください。

CheckUser (チェックユーザー) は、利用者 (checkuser 権限がある) がデータベースに対して手作業で直接クエリを実行することなく、特定の利用者名で使用されている IP と特定の IP で使用されている利用者名を確認できるようにする拡張機能です。 この拡張機能は、WikimediaのすべてのWikiで実行されています。

ウィキメディアのウィキのニーズに合わせて、または重大な脆弱性が発見された場所が更新されます。

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のCheckUserという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CheckUser
  • Gitでのインストールの場合のみ、PHPの依存関係をインストールするためComposerを実行します。 (合併症の可能性についてはタスク T173141を参照。)
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'CheckUser' );
    
  • 更新スクリプトを実行します。このスクリプトは、この拡張機能が必要とするデータベーステーブルを自動的に作成します。
  • 必要に応じて設定します。
  • 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 に影響を与えずに recentchanges を短縮できます。 checkuser データが処理する深さを $wgCUDMaxAge で指定します (単位は秒)。

CheckUser 固有の設定 $wgCheckUserCIDRLimit によって、1 回の検証の最大範囲が決定します。 書式は $wgBlockCIDRLimit と同等です。 既定の制限は IPv6 検証で /32IPv4 検証で /16 です。

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.

チェックユーザー権限の付与

Special:CheckUserSpecial:InvestigateおよびSpecial:CheckUserLogを利用する権限を付与するには、管理の権限を有する利用者がSpecial:UserRightsにアクセスして記入欄に利用者名を入力、オプション"checkuser"を選んでください。 この処理を行うと、当該の利用者に対して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 一括ブロックの制限
$wgCheckUserForceSummary false チェックユーザーがチェックするたび Special:CheckUser (特別:チェックユーザー) に理由を書かせるには、これに true を設定します。 (チェックユーザには要約欄に単に「チェックが必要」あるいは「気が向いたから」など書くことができ、ソフトウェアには判断できないため、あまり実効性はありません。)
$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 これを使うと「特別:チェックユーザー」の一括ブロックフォームにCentralAuthによる「Special:MultiLock」へのリンクを追加できます。 実行するにはウィキに CentralAuth 拡張機能のインストールが必要です。 これを有効にするには、対象とする個別の配列をグローバルなグループ(複数可)の名称から選び、個別の配列に中央ウィキのデータベース名をつけると設定できます。 例えば:
$wgCheckUserCAMultiLock = [
    'centralDB' => 'metawiki',
    'groups' => [ 'steward' ]
];
$wgCheckUserCAtoollink false 77360f1cf1d2 以降。 これにより中央のウィキの「特別:CentralAuth」に「特別:チェックユーザー」の「Get users」出力結果へのリンクを追加します。 実行には CentralAuth 拡張機能をウィキにインストールする必要があります。 これを有効にするには、ホームwikiのデータベース名で設定します。 例:
$wgCheckUserCAtoollink = 'metawiki';
$wgCheckUserGBtoollink false 77360f1cf1d2 以降。 これにより中央のウィキの「特別:GlobalBlock」に「特別:チェックユーザー」の「Get users」出力結果へのリンクを追加します。 実行には GlobalBlocking 拡張機能をウィキにインストールする必要があります。 有効にするには、$wgConf が設定済みならこれを中央のウィキのデーベース名のついた配列と、リンク先のローカル(CentralAuth がインストール済みならグローバル)のグループ(複数可)を指定します。 例:
$wgCheckUserGBtoollink = [
	'centralDB' => 'metawiki',
	'groups' => [ 'steward', 'staff' ]
];
$wgCheckUserEnableSpecialInvestigate false (<=1.39)
true (1.40+)
57dcfe46d2e4 以降。 すると Special:Investigate という更新版の Special:CheckUser が有効になり、1 回の究明で複数の利用者アカウントや IP アドレスを調査できます。
$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 5,000 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 欄に利用者名 (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: X-Forwarded-Forヘッダが提供するクライアントIPアドレスを知るには、/xff を追加 (例: 127.0.0.1/xff)。
  3. 取得したい情報を選択。
    • IPアドレスを取得 - 登録利用者が使用した IP アドレス群を返します。
    • Get actions - returns all edits and logged actions made by users using an IP address or range specified in the target field, or if the target is a user all edits and logged actions by that user.
    • 利用者名を取得 - 特定の IP または IP 範囲から編集を実行した利用者アカウント群を返します。
  4. 「理由:」欄には、秘密のデータにアクセスした理由を記入します。 状況を簡潔に要約するようにしてください (例: "ウィキ間スパム")。これは checkuser-log 権限保有者にのみ表示されるログに記録されます。


情報の戻り値

CheckUserのエントリから引き出される利用者サマリの結果 ("get users") は以下のとおりです。


  1. Example user agent

これは特定の書式に大量の情報を盛り込むための書式で、リスト化や読み流しが非常に簡単にできるものの、提供された情報が何かを知らない限り、読むのは困難です。情報の配置は次のとおりです。 情報のレイアウトは以下のとおりです。

  • 利用者名 (利用者リンク群) (特定のIPもしくはIP範囲から編集を行った期間) [特定のIPもしくはIP範囲から実行された編集の回数]
    1. 編集を行ったIPアドレス XFF: 提供されたXFF情報 (なりすましは可能)

編集に使用したIP/XFF組み合わせごとに、使用順に一覧にしてあります。

特定のIPもしくはIP範囲から編集した最近の利用者ごとのUA10件 (ブラウザ、OS、システム言語、バージョン) のリストが続きます。

XFF フォーマット

XFF (X-Forwarded-For) ヘッダにより、利用者のコンピュータ (1番目) が使用した一連のIPアドレス群から最終プロキシサーバまで表示されます。ウィキメディアの場合、最近のプロキシサーバとはウィキメディアのプロキシ群のどれかに該当します ([$url Wikimedia configuration file]内の$1に表示。) ウィキメディアの場合には最新のプラキシサーバは Wikimedia プロキシのうちのどれかです(Wikimedia 設定ファイル内の$wgCdnServersNoPurge に一覧あり)。

このサンプルの場合:

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

  • 最初のアドレス 2 件 (10.4.46.42, 127.0.0.1) は発信元ネットワークに秘匿され、公開インターネットからの直接アクセスはできません。
  • 3番目のアドレス (aaa.aaa.aaa.aaa) は編集者の「一般公開」であり、通常はブロードバンドまたはダイアルアップ ISP 、企業のゲートウェイ (ただしアノニマイザーまたはマルウェアに感染したサーバー) を示します。
  • 最後のアドレス (208.80.152.46) はウィキメディアの squid サーバー (sq36.wikimedia.org) の1つです。

MediaWiki 環境設定の $wgUsePrivateIPs $wgCdnServers $wgCdnServersNoPurge および IsTrustedProxy フックを使用している拡張機能 (Extension:TrustedXFF など) は、編集を行った実際の IP アドレスの選択方法を変更させます。

個人的ツールのリンク

「Special:CheckUser」から結果を入手したら、個人的な利用者ツールを追加するには以下のインターフェイス メッセージが使えます:

  • IPアドレスに対して MediaWiki:checkuser-userlinks-ip (m:MediaWiki:checkuser-userlinks-ip など)
  • 登録済み利用者に対して MediaWiki:Checkuser-userlinks (m:MediaWiki:Checkuser-userlinks など)
  • 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 の使用法

基本的な使用法

  1. Special:Investigate を開きます。
  2. 「利用者名またはIPアドレス」の欄には、最大 10 個のターゲットを入力します。ターゲットは、利用者名 (User: 接頭辞なし)、IP アドレス、または CIDR レンジです。
  3. 「理由」欄には、上述の Special:CheckUser の説明にあるように、機密データにアクセスする理由を入力します。この情報は、checkuser-log 権限を持つ利用者のみが閲覧できるように記録されます。

高度な機能の使い方については、Help:Special Investigateを参照してください。

ツールリンクのカスタマイズ

Special:CheckUserと同様に、外部ツールへのリンクもカスタマイズ可能です。

リンクはcheckuser-investigate-compare-toollinksメッセージで定義されています。 このメッセージを解析してリンクを見つけ、「IPアドレスとユーザーエージェント」タブのメニューに追加します。


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 は Special:CheckUserおよびSpecial:CheckUserLogで表示される情報にアクセスすることができる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:

名前 Type 説明
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"}}