Page MenuHomePhabricator

Add IP range support to [[Special:Log]]
Open, Needs TriagePublic

Description

Further to T145912, it'd be nice to be able to query for IP ranges at Special:Log, specifically for blocks. Primary use case:

As an administrator, I want to search the block log for all log events targeting IPs in a given IP range, i.e. https://en.wikipedia.org/w/index.php?title=Special%3ALog&type=block&user=&page=User%3A118.165.114.0%2F24&year=&month=-1&tagfilter=&subtype= should find both https://en.wikipedia.org/w/index.php?title=Special:Log/block&page=User%3A118.165.114.14 , https://en.wikipedia.org/w/index.php?title=Special:Log/block&page=User%3A118.165.112.156 and any blocks of subranges.

Such information would help in determining whether rangeblocks are necessary.

Related Objects

Event Timeline

I've created T187579 to investigate what I think may work for this, but note the idea is to add IP range support for every logged action and not just blocks. I'm going to hijack this ticket, hope that is OK :)

MusikAnimal renamed this task from Add IP range support to [[Special:Log/block]] to Add IP range support to [[Special:Log]].Feb 16 2018, 8:05 PM
MusikAnimal updated the task description. (Show Details)

Just wondered where this is currently sitting. I truly (for the 1000+th time) could do with the ability to search both Special:Log/spamblacklist, Special:DeletedContributions and Special:Abuselog by IP range. Where we have spambot activity, it is next to impossible to identify where the spambots are happening by any reasonable functionality than browser search.

To my knowledge, there is no WMF team working on this at the moment.

I'd also like to recurse "up" from a given IP or range (larger enclosing ranges of the given one rather than subranges). So if I look at https://en.wikipedia.org/w/index.php?title=Special:Log/block&page=User%3A2601%3A586%3A400%3A833A%3AFD78%3A71BE%3A47B5%3A5110 (specifically [[:en:User:2601:586:400:833A:FD78:71BE:47B5:5110]], I would also see that [[:en:User:2601:586:400:833a::/64]] is rangeblocked. And this would still be visible once the blocks have expired, unlike [[Special:BlockList]] that only displays active ones.

oh, that's a funny coincidence; I didn't see T270737. I disagree about it being a duplicate of T146628, though. It's not a duplicate, it's an interim solution before proper range search support is added.

This is likely to become more apparent once T206954 is fully implemented.

Moving the CheckUserLog to the logging tables is dependent on this because the CheckUserLog will need to be able to search by range (i.e. that range and IPs inside that range).

Block log entries put the IP range in the title (so the block target will be something like User:118.165.114.0/24). Special:Log uses LogPager::limitTitle() to filter blocks. That will result in a simple log_title = '<range>' condition. There is no way to make that work, a whole new storage mechanism would have to be invented. Probably convert IPs to a pure numeric notation, put that to log_search, use a separate starting number and ending number for ranges, have a maintenance script add that for existing log entries. Then we could use queries like log_search `start` LEFT JOIN log_search `end` ON start.ls_log_id = end.ls_log_id AND end.ls_field = 'ip_end' WHERE start.ls_field = 'ip_start' AND start.ls_value > '<range_start>' AND ( end.ls_field IS NULL OR end.ls_value < `<range_end>` ) - no idea if that would be workable performance-wise.