Event data query API: Block abusive IPs
Background
This issue has been extracted from the original issue #1088 (closed) as we decided to implement rate limiting and blocking separately
Any API has a capacity and occasionally these are repeatedly stretched by a small number of users. In exceptional cases, for the benefit of all users, we need be able to block queries originating from a specific IP address in order to keep the API running.
The Event Data API hasn't needed this in the past but may do in the future, where users are not polite (so we can't contact them) or ignore requests to change their query behaviour.
How urgent
We have experienced two events in the past week that look to have been caused by over-use of the Event Data API, it would be useful to have this option as soon as possible.
Definition of ready
-
Product owner: @mrittman -
Tech lead: @ppandis -
Service:: label applied -
Definition of done updated -
Acceptance testing plan: local demo or screenshot of failed queries -
Weight applied
Definition of done
-
Code reviewed -
Available for acceptance testing via a staging URL, or otherwise -
Consider any impacts to current or future architecture/infrastructure, and update specifications and documentation as needed -
Knowledge base reviewed and updated -
Public documentation reviewed and updated -
Acceptance criteria met -
An IP address can be blocked from querying the Event Data Query API by being added to a blacklist file hosted on the proxy -
Logs from haproxy are send to cloudwatch so that we can monitor naughty IPs -
Both proxies have been updated
-
-
Acceptance testing passed -
An IP added to the blacklist can not query the API -
An IP removed from the blacklist can query the API
-