Fending of DoS attacks against nats-server by auto-revoking auth-keys #2783
-
Let's assume we have 100k accounts in a nats-fueled infrastructure each one enjoying their own auth-credentials. Let's assume that one of them has his auth-credentials leaked and attackers exploit the credentials to launch an attack against nats by either (a) spamming a huge volume of traffic towards nats (b) opening millions of connections towards nats It's indeed documented that nats does in fact support revoking the auth-keys of the affected account: https://docs.nats.io/using-nats/nats-tools/nsc/revocation How would you advise making the revocation process automatic to make the system recover elegantly all by itself from these DoS attacks? (a) Does nats support setting some "auto-revoke" policy for auth-keys so that if it detects that a certain account is misbehaving to knock it out of commission by promptly revoking its auth-key? (b) If nats doesn't have the aforementioned auto-revoke feature (and there are no plans to implement it either) is it possible to use something like 'nats top' or some rest-api to scrape metrics and send them to prometheus (or w/e) in order to alert ourselves in case we notice a DoS attack and revoke the auth-key(s) involved there to deactivate the exploited account(s) that the attackers are abusing? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
We do not have auto-revoke, that is very semantic and needs quite a bit of context. For the above issue, you can limit both the server and accounts to the number of connections they are allowed etc. You can also of course lock down what users can do as well. So for the system to be responsive in terms of a new admin account connection during this time, set its connection max to a number higher (in aggregate across the whole system) than the account's max. |
Beta Was this translation helpful? Give feedback.
We do not have auto-revoke, that is very semantic and needs quite a bit of context.
For the above issue, you can limit both the server and accounts to the number of connections they are allowed etc. You can also of course lock down what users can do as well.
So for the system to be responsive in terms of a new admin account connection during this time, set its connection max to a number higher (in aggregate across the whole system) than the account's max.