Page MenuHomePhabricator

Implement event logging for IP cookie blocks to make sure it's working reasonably
Closed, InvalidPublic3 Estimated Story Points

Description

Implement event logging (like T146230) but we should be able to differentiate IP cookie blocks from username cookie blocks.

Event Timeline

TBolliger renamed this task from Implement event logging for IP cookie blocks in the same way we do username cookie blocks to Implement event logging for IP cookie blocks to make sure it's working reasonably.Apr 11 2018, 6:10 PM

Change 427938 had a related patch set uploaded (by Dmaza; owner: Dmaza):
[mediawiki/extensions/WikimediaEvents@master] [WIP] Implement event logging for IP cookie blocks autoblocks

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

@Niharika, @kaldari, @TBolliger, @dbarratt
I've been going back and forth on this to determine how best can we measure the new Cookie blocking for IP users. The only measurement I can think that could be useful is the resulting autoblocks from the IP cookie block.

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

NOTE: This change would depends on a new hook (AutoblockComplete) that would be fired after an autoblock has been created. Let me know what you think.

This is the schema:

{
    "description": "Logs autoblocks when a logged-out user is denied editing due to presence of cookie referencing an IP/Range Block",
    "properties": {
        "ip": {
            "description": "IP address blocked",
            "type": "string",
            "required": true
        },
        "block_id": {
            "description": "Resulting autoblock (Block ID) created",
            "type": "integer",
            "required": true
        }
    }
}

Let me know what you think.

@dmaza We do have some eventlogging in place from when we did cookie blocks. See -
https://gerrit.wikimedia.org/r/#/c/320405/6/includes/user/User.php and https://gerrit.wikimedia.org/r/#/c/320239/

Can we modify the CookieBlock schema to accommodate for autoblocks?

Can we modify the CookieBlock schema to accommodate for autoblocks?

We can, I thought on creating a new one just to make it more relevant through the name and because the WIP patch is tracking something different. But we could re-use that one.

https://gerrit.wikimedia.org/r/#/c/320405/6/includes/user/User.php and https://gerrit.wikimedia.org/r/#/c/320239/

I looked at those patches. I feel that they make sense for what you were trying to accomplish, I'm not so sure that's what we want to do here.
That is the reason I'm asking. Maybe we need to log both things, the source of the block if it is cookie related and the resulting autoblocks out of that cookie.

I guess what I'm trying to ask here is what can we look at that will reassure us that it is working as expected?

I guess what I'm trying to ask here is what can we look at that will reassure us that it is working as expected?

We want to make sure that:

  1. Cookies are being set as expected.
  2. If user switched IP but has cookie gets blocked.

Correct?

So how about logging it when you set the cookie for anons and/or when doAutoblock is called?

I like @dmaza's idea of logging the autoblock creation rather than logging every time the block is detected. I think this will give us a clearer picture of the actual impact. It might require a bit more work though.

I guess what I'm trying to ask here is what can we look at that will reassure us that it is working as expected?

We want to make sure that:

  1. Cookies are being set as expected.
  2. If user switched IP but has cookie gets blocked.

Correct?

So how about logging it when you set the cookie for anons and/or when doAutoblock is called?

You are correct, and the reason why I don't think logging when we set the cookie is useful is because it will literally happen on every IP block.

I like @dmaza's idea of logging the autoblock creation rather than logging every time the block is detected. I think this will give us a clearer picture of the actual impact. It might require a bit more work though.

Not really. The patch[1] for WikimediaEvents is done (unless you want me to change something) and all I need from core is a new Hook (AutoblockComplete) when autoblocks happen.

[1] https://gerrit.wikimedia.org/r/427938

I agree with your decision, @dmaza . When compared to data in T190328, this will help us know if the anon cookie blocking is running out of control.

dbarratt set the point value for this task to 3.Apr 26 2018, 3:34 PM

Change 429444 had a related patch set uploaded (by Dmaza; owner: Dmaza):
[mediawiki/core@master] Add AutoblockComplete hook to autoblocks

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

Change 429444 abandoned by Dmaza:
Add AutoblockComplete hook to autoblocks

Reason:
We don't need this anymore

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

Change 427938 abandoned by Dmaza:
Implement event logging for IP cookie blocks autoblocks

Reason:
We are gonna be using statsd instead

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