Page MenuHomePhabricator

AbuseFilter abuse_filter_log table: Store IP addresses as hex values
Closed, ResolvedPublic

Description

Summary

The abuse_filter_log table stores IP addresses in plaintext. To allow searching by ranges these should be converted to a hex column.

Background & Technical details

  • T391322: Special:AbuseLog: Support search by IP and IP range when temporary accounts are enabled requests that it be possible to search AbuseFilter log entries performed by temporary accounts by the IP address used to perform the action
  • To achieve this we need to be able to search by the IP address column in the abuse_filter_log table
    • The afl_ip column currently stores the IP as plaintext, which is not searchable
    • Instead a afl_ip_hex column should replace afl_ip that stores the IP as a hexadecimal value, which can then be searched through using the same method that the CheckUser extension does
    • There will be no need to keep afl_ip around as this would duplicate data, so removing it would be necessary to ensure that the table does not grow in disk size long term due to this change

Acceptance criteria

  • The afl_ip column in abuse_filter_log is replaced with a new afl_ip_hex column (T395613, T397762, T397842)
  • Code using afl_ip uses afl_ip_hex (T397941)
  • The afl_ip column is removed after a migration period (T400280)
  • Onwiki documentation for the table is updated as the migration proceeds

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Tchanders added subscribers: STran, Tchanders.

Having spoken with @STran, this belongs in "Epics in Progress", since the acceptance criteria are either tracked by other tasks or migration steps that will be done over time.

Dreamy_Jazz claimed this task.
Dreamy_Jazz updated the task description. (Show Details)

This is now done. T407997: Drop the afl_ip column and the afl_ip_timestamp index from the abuse_filter_log table tracks removing afl_ip column on WMF wikis, but we don't need to wait for that to resolve the epic