netbird icon indicating copy to clipboard operation
netbird copied to clipboard

Option and setting to auto delete old expired/revoked setup keys.

Open mzs114 opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. In the current versions, the expired/revoked setup keys are cluttering the interface, is it possible to remove them from the database, should be allowed based on the root/super user role. Other admin users should not be able to delete the history for the sake of audit trail

Describe the solution you'd like Allow certain groups with specific roles to delete the expired keys and keep the interface de cluttered. Also, allow the backend to automatically purge old revoked/expired keys.

Describe alternatives you've considered Allow a setting to automatically delete expired keys after a certain period, this will auto clean the DB.

Additional context As the number of devices grow this will add more expired keys that may not be required anymore after a certain period.

mzs114 avatar Dec 10 '23 12:12 mzs114

No one care about this request ?

tarocjsu avatar Sep 29 '24 13:09 tarocjsu

+1 for the feature request to have a way to remove old setup keys.

I currently have accumulated > 5000 expired setup keys in one single account. This not only clutters the UI but has significant impact on the overall API performance. With >5000 setup keys a simple GET to /api/groups took > 1300 ms. After manually deleting the majority of the old keys I now have ~150ms. In my setup this is almost a 10x speed improvement in most API calls. I was also able to reproduce this not only in my production system but also in a smaller test setup. Removing old keys does help here, but probably this is a problem in the API implementation as all setup keys are always fetched in GetAccount: https://github.com/netbirdio/netbird/blob/b2379175fe856e24c71263b7f0dcfac77ab8a722/management/server/sql_store.go#L584

maybe also related to #2587

maigl avatar Oct 10 '24 14:10 maigl