Bitwarden_rs: Logs missing for wrong logins

Created on 3 May 2020  ·  3Comments  ·  Source: dani-garcia/bitwarden_rs

Hello,
I am trying to turn on logging. I am running Debian 10 and Bitwarden_rs with MariaDB, all behind Nginx proxy using shauder config from https://github.com/dani-garcia/bitwarden_rs/wiki/Proxy-examples.
(I have only added two lines and removed the auth basic thing for admin page. This are the added lines :
access_log /var/log/nginx/bitwarden.access;
error_log /var/log/nginx/bitwarden.error;)
I also use systemd according to your wiki : https://github.com/dani-garcia/bitwarden_rs/wiki/Setup-as-a-systemd-service. My installation directory is /opt/bitwarden_rs/target/release/ : in fact, I did not move any files.

So here is the problem : I activated the logs according to this wiki page : https://github.com/dani-garcia/bitwarden_rs/wiki/Logging. So I have edited the .env file in /opt/bitwarden_rs/target/release/.env and enabled LOG_FILE=/data/bitwarden.log which I set to LOG_FILE=/opt/bitwarden_rs/target/release/data/bitwarden_rs.log. I have then enabled EXTENDED_LOGGING=true. All the other options concerning logging were removed. When I start Bitwarden_rs using sudo systemctl start bitwarden_rs.service, or cargo run --features mysql --release, It logs It in the file I mentionned. When I have created a new user, It also logs It.

However, when I try fail attempts, It does not anything. How is It possible? I want to set up Fail2ban up, but can't do anything yet and looked for a solution for several hours now. Thanks for help !

better for forum

Most helpful comment

Yeah in that case I get an "Invalid email adress" error in the web client, which probably doesn't even get sent to the server.
Screenshot_2020-05-04_00-43-30

All 3 comments

I'm not aware of the particulars of Fail2Ban but here is my setup where I do get the failed logins from bitwarden:
I use it with systemd and the service file as written in the wiki. I'm using caddy but the reverse proxy should not be important for that. I don't have Extended logging enabled and don't log the output of bitwarden_rs to a file but let it print everything. systemd picks it up from there automatically:

I see it in

$ systemctl status bitwarden_rs
● bitwarden_rs.service - Bitwarden Server (Rust Edition)
   Loaded: loaded (/usr/lib/systemd/system/bitwarden_rs.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2020-03-14 09:20:40 CET; 1 months 20 days ago
     Docs: https://github.com/dani-garcia/bitwarden_rs
 Main PID: 15947 (bitwarden_rs)
    Tasks: 20 (limit: 2203)
   Memory: 28.6M
   CGroup: /system.slice/bitwarden_rs.service
           └─15947 /usr/bin/bitwarden_rs

May 04 00:10:29 mydomain.com bitwarden_rs[15947]: [2020-05-04 00:10:29][request][INFO] POST /api/accounts/prelogin
May 04 00:10:29 mydomain.com bitwarden_rs[15947]: [2020-05-04 00:10:29][response][INFO] POST /api/accounts/prelogin (prelogin) => 200 OK
May 04 00:10:29 mydomain.com bitwarden_rs[15947]: [2020-05-04 00:10:29][request][INFO] POST /identity/connect/token
May 04 00:10:31 mydomain.com bitwarden_rs[15947]: [2020-05-04 00:10:31][error][ERROR] Username or password is incorrect. Try again. IP: 10.10.10.10. Username: [email protected].
May 04 00:10:32 mydomain.com bitwarden_rs[15947]: [2020-05-04 00:10:32][response][INFO] POST /identity/connect/token (login) => 400 Bad Request

after starting it with systemctl start bitwarden_rs.

I'm currently running bitwarden_rs v1.14, haven't updated it yet. What version are you using? Do you see other logs from that failed login, like the ones in my case before the error?

I think fail2ban can also look at the output of systemd/journalctl but simple files should also work. If you have any other questions regarding the .service file, let me know, I wrote that wiki entry ;-)

Ok sorry, I just found the problem after many hours huuh ! It was because I was testing with random letters. Bitwarden only logs failed attempts based on the @ letter. I did not put It for tests for hours now owo (Maybe because on french keyboards It requires two buttons to tap an @ 😣). So much time lost 😂... Thank you anyway for your very fast answer !

Yeah in that case I get an "Invalid email adress" error in the web client, which probably doesn't even get sent to the server.
Screenshot_2020-05-04_00-43-30

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mprasil picture mprasil  ·  6Comments

pageb018 picture pageb018  ·  3Comments

jjlin picture jjlin  ·  5Comments

newkind picture newkind  ·  4Comments

durd picture durd  ·  3Comments