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

Feature Request: include IP and username in logging for failed attempts #119

Closed
davekaufman opened this issue Aug 8, 2018 · 6 comments
Closed
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@davekaufman
Copy link

Feature Request

Improve logging of failed login attempts

Issue

Currently, failed login attempts are logged like so:

{"log":"ERROR: Username or password is incorrect. Try again.\n","stream":"stdout","time":"2018-08-08T19:33:20.892869034Z"}

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:

{"log":"ERROR: Username or password is incorrect. Try again.\n","IP":"192.0.2.23","username":"[email protected]","stream":"stdout","time":"2018-08-08T19:33:20.892869034Z"}
@mprasil
Copy link
Contributor

mprasil commented Aug 8, 2018

Excellent idea and shouldn't be too hard to implement.

@mprasil mprasil added enhancement New feature or request good first issue Good for newcomers labels Aug 8, 2018
@Baelyk
Copy link
Contributor

Baelyk commented 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
Copy link
Contributor

mprasil commented 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
Copy link
Owner

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-IP header with the external IP of the request.

@philw07
Copy link

philw07 commented 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
Copy link
Owner

That should be fixed now in b75ba21. Thanks for reporting it!

thelittlefireman pushed a commit to thelittlefireman/bitwarden_rs that referenced this issue Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants