rustdesk-server
rustdesk-server copied to clipboard
Add option to log (failed) authentication attempts to enable the usage of tools like fail2ban and crowdsec
Is your feature request related to a problem? Please describe. Right now everyone can connect to the server repeatedly as often as he wants to try bruteforcing the pre-shared key which is needed to authenticate to the server. Besides that, denial-of-service attacks are possible. That is due to the fact that rustdesk does not log (failed) authentication attempts (with source ip addresses) anywhere which would make it possible to use tools like fail2ban or crowdsec to ban repeated offenders.
Describe the solution you'd like I'd like rustdesk-server to add an option to enable auth logging which would log (failed) authentication attempts to a logfile which could be used by above mentioned daemons to ban ip adresses which repeatedly fail to authenticate against the server.
Describe alternatives you've considered
I did enable debug logs by adding Environment="RUST_LOG=debug" to the systemd unit which is starting rustdesk-server according to the FAQ but since that logs all connections and doesnt differentiate between successful/failed authentications using fail2ban on it creates the risk of banning legitimate users. That risk gets even greater when considering the fact that a successfully established remote control session logs 8 lines containing the source ip address while an illegitimate connection (trying to connect with a wrong key specified in the Client settings under network -> ID/Relay server -> Key) only logs 2 lines.
It is definitely something that would be useful, I'm looking forward this exact same feature too!
Would be really nice to let Fail2Ban monitor rustdesk
Throwing my vote in there to add a login failed line for crowdsec parsing
Edit: I'll even write the crowdsec parser and some scenarios, just need the actual failed auth log line to parse.
Would love to see this for Crowdsec / fail2ban, too. Maybe for both: RustDesk Pro Dashboard-Login-Page and the Service in general.
Anything is better than NOTHING. Security is paramount for a project that sells itself on being a secure, convenient method to access your devices remotely.
I just set up rustdesk for a company and also want to get it integrated with crowdsec and possibly SIEM. Please make it easier for us to handle security.
One more vote to keep it recent. We badly need it to improve security.
Thanks!
Just for reference:
log::warn!("Relay authentication failed from {} - invalid key", addr);
log::warn!("Authentication failed from {} for peer {} - invalid key", addr, ph.id);