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

Define procedure for rotating keypair seed and resolve issues #354

Open
chris13524 opened this issue Feb 8, 2024 · 0 comments
Open

Define procedure for rotating keypair seed and resolve issues #354

chris13524 opened this issue Feb 8, 2024 · 0 comments
Labels

Comments

@chris13524
Copy link
Member

chris13524 commented Feb 8, 2024

Since this is a private key, what happens if we need to rotate it? There are several issues:

The keypair seed is used to derive two other keys: the client ID for the relay, and the Notify Server authentication key.

  • A new client ID will subscribe to the same set of topics as the previous client ID. This will result in a large number of abandoned topic subscriptions, and messages being stored in the mailbox. Furthermore, if the key is rotated too quickly we will hit the 100 subscriber limit of the topic before the previous topic subscriptions expire themselves.
    • The same topic being subscribed multiple times will also result in duplicate messages being processed the Notify Server for a few minutes during the rollout of the new version/configuration.
    • Topic subscriptions are only renewed when they need to be, and we do not store the client ID that was used for the subscription. However we should, but there is still a risk that when the client ID changes it takes many hours to subscribe to and extend the TTL of all of the topics.
  • A new authentication key will be updated in the Notify Server did.json file, but during rollout there will be a period of time where clients cached the old did.json and are sending requests to either a non-existant server (and thus requests are being dropped) or they are hitting the old Notify Server which will result in topic subscriptions for the old client ID.
@chris13524 chris13524 changed the title Define procedure for rotating keypair seed Define procedure for rotating keypair seed and resolve issues Feb 8, 2024
@arein arein added the accepted label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants