Page MenuHomePhabricator

Add `user_ip` variable
Open, Needs TriagePublic

Description

From T357772: Investigate: How will `ip_in_range` and `ip_in_ranges` function when temporary accounts are enabled, create a user_ip variable to expose the IP to AbuseFilter filters. IPs can't be store in the variable dump, as blobs are append only and the IP needs to be cleared from the database after 90 days. Instead, user_ip:

  • will be lazy loaded and is the IP of temporary accounts or anonymous users
    • In practice, this IP should only be revealed for temporary accounts but by also exposing it for anonymous users, the migration path for filters will be simpler (swap user_name for user_ip instead of having to maintain both)
  • on saving to the variable dump for storage, transform user_ip into a boolean value
  • on loading the variable dump, transform user_ip (if true) back into an IP, grabbing it from afl_ip, a column in abuse_filter_logs that gets cleared on a schedule via maintenance script

This variable will need to be protected/restricted; see follow-up tasks for a breakdown of that work.

Event Timeline

T234155: Create CheckUser-level abuse filters/T155553: abuse filter should be able to evaluate is IP in range for registered users may introduce another field for ip of every user. Since the proposed field in this task will only contain ip of non-permanent accounts, I propose this field be named temp_user_ip instead.

T234155: Create CheckUser-level abuse filters/T155553: abuse filter should be able to evaluate is IP in range for registered users may introduce another field for ip of every user. Since the proposed field in this task will only contain ip of non-permanent accounts, I propose this field be named temp_user_ip instead.

This will AFAIK also have a value for wikis where temporary accounts are not enabled. As such calling it temp_user_ip will be confusing in that case.

or alternatively unnamed_user_ip / non_permanent_user_ip?