Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server should implement rate limiting for appended keys #37

Open
HendX opened this issue Apr 24, 2020 · 3 comments
Open

Server should implement rate limiting for appended keys #37

HendX opened this issue Apr 24, 2020 · 3 comments
Labels
Key Server Related to the web server component

Comments

@HendX
Copy link
Contributor

HendX commented Apr 24, 2020

After an approved positive diagnosis, user device should continue to submit keys on following days. This is allowed by an authenticated device with a previous submission ID.

Since the subsequent keys are associated with an existing submission, to avoid having to re-approve the diagnosis each time, the server can simply accept up to 1 key per day for that submission (for X number of days beyond the initial submission).

@HendX HendX added the Key Server Related to the web server component label Apr 24, 2020
@tatey
Copy link

tatey commented Apr 25, 2020

Yes, I think the server should have rate limiting in general to prevent abuse. See tatey/trace_privately#4.

the server can simply accept up to 1 key per day for that submission

The downside of this is if the client misses a submission for any reason (ie. flakey network) then they wouldn't be able to submit two days worth of keys.

Would these protections be adequate:

  • Protect against the same key being submitted again. Does the server tell the client this happened in the response, or does the server just silently ignore it?
  • Limit to a single submission per day
  • Limit the total number of additional keys since diagnosis to +14

This would give some flexibility to the client but ultimately stop abuse.

@HendX
Copy link
Contributor Author

HendX commented Apr 25, 2020

On the other thread (or somewhere) I wrote "an average of 1 key per day", so make-up can occur if necessary.

I think a success code from server is required so the client knows whether or not to try again, but behind the scenes the server can choose its own strategy for rate-limiting.

@tatey
Copy link

tatey commented Apr 29, 2020

FYI I've patched it so a submission can have a maximum of 21 keys. This should give the client a fair degree of flexibility to either submit many keys on one day or one key per day. There's also general rate limiting on the sever as well as the ability to revoke authentication tokens to prevent abuse.

See tatey/trace_privately@8601982.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Key Server Related to the web server component
Projects
None yet
Development

No branches or pull requests

2 participants