Page MenuHomePhabricator

Log when AbuseFilter user sees IP address associated with temp account via user_unnamed_ip variable trigger
Closed, ResolvedPublic2 Estimated Story Points

Description

Context

See the parent task for context about the user_unnamed_ip variable and the need to restrict access to it: T363906.

Scope

This does not concern logging access to the IPs visible to users via the abusefilter-privatedetails right (which already exists and is independent to the new work we are doing on temporary accounts).

This concerns access to IP addresses by users with the abusefilter-access-protected-vars. This right will be given to a subset of users who are able to reveal IP addresses, in accordance with the IP address access policy, introduced for temporary accounts.

The log

What do we need to log?

As described in more detail in T364902: How should access to IPs of temporary accounts be logged?, we are supposed to log whenever a user with the right to reveal IP addresses for temporary accounts actually chooses to reveal one.

The ability to reveal an IP is already implemented via the CheckUser extension. Here's a screenshot of what is logged:

image.png (195×924 px, 85 KB)

The log is debounced by 24 hours.

We need something similar in AbuseFilter, whenever a user sees the precise IP address for a temporary user who triggered a filter.

How should we log?

The screenshot above shows an on-wiki log, which is the current implementation in CheckUser (at the time of writing). We hope to log via the event platform instead.

This conversation with Legal is ongoing, and tracked via T364902. That task is a dependency of this one.

When should we log?

We would need to do something like one of the following:

  • Log whenever a user with the right to see an IP address loads a page that contains that IP address
    • Special:AbuseFilter/examine/log/
    • Are there any other pages?
  • Don't show the IP address by default on these pages; instead show a "reveal IP" button, and make the log when the user clicks on it

Related Objects

Event Timeline

kostajh renamed this task from Ensure that access to an IP address via the user_unnamed_ip variable is logged to Log when AbuseFilter user sees IP address associated with temp account via user_unnamed_ip variable trigger.Jun 11 2024, 11:11 AM
kostajh updated the task description. (Show Details)
Tchanders changed the task status from Open to Stalled.Jul 9 2024, 10:35 AM
Tchanders added a subscriber: Madalina.

Stalled on legal conversations. FAO @Madalina

We need something similar in AbuseFilter, whenever a user sees the precise IP address for a temporary user who triggered a filter.

I think this is the question for legal-- do we actually need something similar to temp account IP reveal logging in AbuseFilter, or is it OK to not log anything in this scenario?

JayCano set the point value for this task to 2.Aug 26 2024, 10:21 AM

Change #1074725 had a related patch set uploaded (by Dreamy Jazz; author: STran):

[mediawiki/extensions/CheckUser@master] Add support for AbuseFilter's protected var view log

https://gerrit.wikimedia.org/r/1074725

Change #1072555 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/AbuseFilter@master] Log specific views of protected variables

https://gerrit.wikimedia.org/r/1072555

Change #1072555 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Log specific views of protected variables

https://gerrit.wikimedia.org/r/1072555

dom_walden subscribed.

Querying the API[1] can trigger a lot of logs being inserted. I did this and checked that every temporary user whose AbuseFilter log was included in the API response also had a log generated in the logging table.

While testing T371798#10228836, when I was using PHPUnit to simulate accessing various combinations of filter and logs via Special:AbuseLog/<log id> I also checked that a row was inserted into the logging table each access.

I notice that a new INSERT is created for each temp user returned by the API. I wonder if they could be batched together in some way. I also get the constraint violation each time, but I think we already know about that:

[rdbms] Expectation (writes <= 0) by MediaWiki\Actions\ActionEntryPoint::execute not met (actual: 1) in trx #a24b0ad46e:
INSERT INTO `logging` (log_type,log_action,log_timestamp,log_actor,log_namespace,log_title,log_page,log_params,log_comment_id) VALUES '?'
...

We might need to do more testing after this has been fixed.

I briefly tested a wiki without temporary accounts, accessing AbuseFilter logs for IP actions (including Special:AbuseFilter/examine/log/).

If protected variables are included in the log of a filter which is not protected, viewing them is also logged.

Notes:

  1. api.php?action=query&format=json&list=abuselog&formatversion=2&aflprop=ids|user|title|action|result|timestamp|hidden|revid|filter|details&wrappedhtml=1&afllimit=5000