Limit Number of Failed Login Attempts
Your Rocket.Chat version: 0.24
Is there a way to limit the number of failed login attempts for a user account? How much security can be put into place from this end?
This should be helpful for those of us who run an instance that is available on the public internet.
I believe there is already. 5 per second, but we can change it.
That sounds good. Is there a way to also block based on IP?
I forgot to mention, does it still apply for LDAP users?
Applies to all method calls, so it still apply for LDAP users.
And if there is a way to set how many attempts for how long til we lock it and possibly get a notification, that would be ideal.
👍
I intended to secure it with fail2ban but I did not find where these failed login attempts are logged. I am using https://github.com/RocketChat/Deploy.to.Cloud/tree/master/GenericLinux to deploy, with this docker-compose.yml:
db:
image: mongo
volumes:
- ./data/runtime/db:/data/db
- ./data/dump:/dump
command: mongod --smallfiles
web:
image: rocketchat/rocket.chat
environment:
- MONGO_URL=mongodb://db:27017/meteor
- ROOT_URL=https://rocket.domain.com
- MAIL_URL=smtp://[email protected]:[email protected]:465
links:
- db:db
volumes:
- logs:/home/app/logs
expose:
- "3000"
ports:
- "3000:3000"
Anyway, 5 per second is a much too high limit for my needs (and it does not seem to work, maybe I missed something?).
Hi I am also trying to reduce the chances of brute forcing our LDAP via Rocket Chat. Fail2Ban is useless until there is error reporting in the nginx log I cannot act upon the brute forcing.
Interestingly the api/login route will provide a 401 (HTTP/1.1 401 Unauthorized) response back and into the access log in nginx but normal users are not coming in via API calls.
Can you provide some timescales to add the standard user login fail 401 error output back to nginx? That would sort this problem out allowing me to use fail2ban.
p.s. fail2ban has worked to block /api/logon brute forcing :-) Thanks for your help.
Mark
@mdearlove I am not sure how we would be able to do that. All the logins are done via a single open web-socket connection, so there is not 401. Maybe the only way would be to redirect the browser to a route that returns 401 so NGINX and pick that up. @rodrigok what do you think?
@engelgabriel If the DDOS is scripted, redirect to another route probably will not work. Since the login requires a WebSocket connection, normal tools for DDOS does not work, so it's harder to do that on Rocket.Chat.
We can add the ability to ban IPs based on loggin or connection attempts.
@rodrigok one alternative is to get Rocket.Chat it self to record on the logs the failed login attempt, so @mdearlove can configure fail2ban to monitor our logs too and this would make it work. Makes sense?
@rodrigok @engelgabriel I believe that would be do-able from a fail2ban pov as it uses a regex to spot the machine behaviour to identify the issue. The log entry would also need to identify the source IP of the request so that fail2ban can take action.
@rodrigogs wan we log failed login attempts with the IP? This would be very useful for everyone.
@rodrigok @engelgabriel Hi guys Ive been away sunny my ar$e for several weeks :-). Have you made any progress on this issue? Thanks in advance.
@engelgabriel i'm afraid you notified @rodrigogs instead of @rodrigok
BTW, I believe this is still a much needed improvement for security
I agree with pa-de-solminihac that 5 per second is way too high. But regardless, @pa-de-solminihac you suggested earlier on this ticket that the block didn't seem to work. Is that still the case?
@engelgabriel @rodrigok would be great to have this feature enabled... so we can monitor the logs and use fail2ban.. any idea if it will be available any time soon? Thanks
+1 Push
+1 Push
+1
Is the 5-attempts-per-second rule still aplying? If so, is it configurable? Gitlab, for example, offers a limit and period variables to be set, defaulting to 6 attempts per minute (source).