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

Brute force attacks protection #8

Open
gimenete opened this issue Mar 31, 2017 · 6 comments
Open

Brute force attacks protection #8

gimenete opened this issue Mar 31, 2017 · 6 comments

Comments

@gimenete
Copy link
Contributor

gimenete commented Mar 31, 2017

There should be protection agains brute force attacks by slowing down the server:

  • Many failed logins from same IP
  • Many failed logins to the same email (even if they are from different IPs).
  • Many failed logins using the same password (even if they are from different IPs or to different accounts).

We need to store some counters either in memory (default) or redis (opt-in feature that would allow multiple server instances having the same counters).

@gimenete
Copy link
Contributor Author

reCAPTCHA was added, but we might want to implement other mechanisms.

@callaars
Copy link

You might want to increase the response time slightly with every incorrect attempt as well.

@gimenete
Copy link
Contributor Author

Yeah, agreed.

I've looked to this module for in-memory rate limiting: https://github.com/jhurliman/node-rate-limiter for rate-limiting.

And these docs for using redis for rate limiting: https://redis.io/commands/incr#pattern-rate-limiter-1

@callaars
Copy link

The first step would be to just add rate limiting in nginx through: limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s; for example.

We could advice on that.

@callaars
Copy link

We might not need to hit the actual app for this.

@chadfurman
Copy link

It would also make sense to cache the JWTs in redis, and then a quick check can filter out most unauthorized requests without having to decode or verify any session IDs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants