gosqasorg / asset-provenance-tracking

Node.js implementation, using Azure as a backend, of a system for Global Distributed Tracking, a free-of-charge, free-software system for building up a provenance or history of objects/assets/devices.
https://gosqas.org/
GNU Affero General Public License v3.0
5 stars 3 forks source link

[BUG] Need to add throttling to Legacy Code #141

Open RobertLRead opened 1 month ago

RobertLRead commented 1 month ago

We need to add throttling to the legacy code to dissuade Denial of Service attacks (or get off the Legacy Code and add it to the new code!)

I recommend we implement a system that no more than 200 Provenance Records can be created in any 200 second period. (I have made the code allow you to create 100 children at a time.)

I think this is bested implemented as a small table in the database where we track the timestamps of the last 200 records added. Whenever some wants to add a new record, we first run a query that clears this table of any record more than 200 seconds old. Then we allow the creation of the record if the count of records is less than 200.

devhawk commented 1 month ago

https://learn.microsoft.com/en-us/azure/api-management/api-management-key-concepts