GitHub PushEvent at 2014-04-03 18:22:46
Repository: phabricator
Actor: epriestley
Payload: {"shas":[["847b7977c1254e28c2106f03048f849b7f1fedad","46f1a0bd5592a2f9244ca321b129902a06b53e03@epriestley.com","Add semi-generic rate limiting infrastructure\n\nSummary:\nThis adds a system which basically keeps a record of recent actions, who took them, and how many \"points\" they were worth, like:\n\n  epriestley email.add 1 1233989813\n  epriestley email.add 1 1234298239\n  epriestley email.add 1 1238293981\n\nWe can use this to rate-limit actions by examining how many actions the user has taken in the past hour (i.e., their total score) and comparing that to an allowed limit.\n\nOne major thing I want to use this for is to limit the amount of error email we'll send to an email address. A big concern I have with sending more error email is that we'll end up in loops. We have some protections against this in headers already, but hard-limiting the system so it won't send more than a few errors to a particular address per hour should provide a reasonable secondary layer of protection.\n\nThis use case (where the \"actor\" needs to be an email address) is why the table uses strings + hashes instead of PHIDs. For external users, it might be appropriate to rate limit by cookies or IPs, too.\n\nTo prove it works, I rate limited adding email addresses. This is a very, very low-risk security thing where a user with an account can enumerate addresses (by checking if they get an error) and sort of spam/annoy people (by adding their address over and over again). Limiting them to 6 actions / hour should satisfy all real users while preventing these behaviors.\n\nTest Plan:\nThis dialog is uggos but I'll fix that in a sec:\n\n{F137406}\n\nReviewers: btrahan\n\nReviewed By: btrahan\n\nSubscribers: epriestley\n\nDifferential Revision: https://secure.phabricator.com/D8683","epriestley",true]],"size":1,"ref":"refs/heads/master","head":"847b7977c1254e28c2106f03048f849b7f1fedad"}