Fail2ban with docker bridge ip #3958

Closed
opened 2026-03-07 19:21:16 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @snevas on GitHub (Jun 13, 2019).

I have my docker behind a apache proxy that does 80 > 81 per wiki instructions. When I try to setup fail2ban, I see it tries to ban the docker bridge ip based on this log:
[2019-06-13 09:26:51][bitwarden_rs::error][ERROR] Username or password is incorrect. Try again. IP: 172.17.0.1. Username:test@test.com.

Originally created by @snevas on GitHub (Jun 13, 2019). I have my docker behind a apache proxy that does 80 > 81 per wiki instructions. When I try to setup fail2ban, I see it tries to ban the docker bridge ip based on this log: `[2019-06-13 09:26:51][bitwarden_rs::error][ERROR] Username or password is incorrect. Try again. IP: 172.17.0.1. Username:test@test.com.`
Author
Owner

@snevas commented on GitHub (Jun 13, 2019):

bitwarder_rs should use the X-Forwarded-For header to log the original ip.

@snevas commented on GitHub (Jun 13, 2019): bitwarder_rs should use the [X-Forwarded-For](http://en.wikipedia.org/wiki/X-Forwarded-For) header to log the original ip.
Author
Owner

@dani-garcia commented on GitHub (Jun 13, 2019):

Rocket uses the X-Real-IP header when determining the origin IP address, you should configure the proxy to set that one instead of X-Forwarded-For.

@dani-garcia commented on GitHub (Jun 13, 2019): Rocket uses the `X-Real-IP` header when determining the origin IP address, you should configure the proxy to set that one instead of `X-Forwarded-For`.
Author
Owner

@snevas commented on GitHub (Jun 13, 2019):

Hi Dani, thanks for all your work on the project. You rock!
I've tested setting the correct header and it works. I've changed the proxy example in the wiki @
https://github.com/dani-garcia/bitwarden_rs/wiki/Proxy-examples

@snevas commented on GitHub (Jun 13, 2019): Hi Dani, thanks for all your work on the project. You rock! I've tested setting the correct header and it works. I've changed the proxy example in the wiki @ https://github.com/dani-garcia/bitwarden_rs/wiki/Proxy-examples
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#3958