mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 08:39:46 +03:00
Feature Request: include IP and username in logging for failed attempts #64
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @davekaufman on GitHub (Aug 8, 2018).
Feature Request
Improve logging of failed login attempts
Issue
Currently, failed login attempts are logged like so:
Ideally, these log messages would include the IP address of the host attempting login, and username that was attempted. Including this information would allow for better monitoring and alerting, as well as blocking of bad actors.
Suggestion
Include IP address and username in log message.
Example:
@mprasil commented on GitHub (Aug 8, 2018):
Excellent idea and shouldn't be too hard to implement.
@Baelyk commented on GitHub (Aug 25, 2018):
I'm interested in trying to add this, but I can't seem to find any log file. The only logging that I am finding is the logging to stdout that Rocket usually does.
Am I missing something obvious?
@mprasil commented on GitHub (Aug 25, 2018):
There's #63 for logging to file, but that is currently pending some upstream changes. So this is purely about changing that single failure message to include requested information.
@dani-garcia commented on GitHub (Aug 26, 2018):
The stdout now logs IP and user on failed login attempts.
For those behind proxy, you might need to configure the proxy to create a
X-Real-IPheader with the external IP of the request.@philw07 commented on GitHub (Sep 13, 2018):
This is a useful feature, however I noticed the IP is only logged when trying to log in with a valid username and a wrong password (with the message "Username or password is incorrect"). When trying to log in with a username for which no account exists however only "Invalid user" is logged.
What's even worse is that the same error messages are displayed in the web vault UI, so a potential attacker can immediately see if an account exists or not.
I think the error message should be "Username or password is incorrect" including logged IP in any case.
@dani-garcia commented on GitHub (Sep 14, 2018):
That should be fixed now in
b75ba216d. Thanks for reporting it!