mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 09:46:00 +03:00
[GH-ISSUE #678] fail2ban regex will match but no match found when actually running #455
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#455
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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 @Ezzahhh on GitHub (Oct 22, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/678
I have followed the instructions in the wiki to setup fail2ban. My setup is with caddy and bitwarden_rs both running in docker with root and using cloudflare cdn for https. My log is being output in /bw-data/bitwarden.log and it appears to be updating. My OS time and the log time appear to match up. When I run fail2ban's regex on the given one in the wiki and the bitwarden.conf it appears to find matches. However, when I try to spam logins myself the fail2ban log does not show any indication that anything is happening even with the verbosity set to DEBUG. Comparatively, the ssh blocking appears to work.
bitwarden.conf
bitwarden.local
fail2ban.log it basically just does usual startup and ends like this:
2019-10-22 23:05:34,232 fail2ban.jail [15452]: INFO Jail 'bitwarden' started@hwwilliams commented on GitHub (Oct 22, 2019):
Hey @Ezzahhh , you may have to use the following action in bitwarden.local since you're using docker and docker uses the forward chain in iptables.
action = iptables-allports[name=bitwarden, chain=FORWARD]@Ezzahhh commented on GitHub (Oct 23, 2019):
My understanding from the wiki was to not include the chain forward because I have docker AND caddy as a reverse proxy in front. Wouldn't jail2ban normally show something in logs if it at least picked up something to ban in logs before taking action? I'm no sure. It's weird because I get nothing at all.
I have tried running with chain=FORWARD but nothing happens.
@hwwilliams commented on GitHub (Oct 23, 2019):
In that case I'm not too sure, I'm also using docker but with Traefik instead of Caddy. I use the
chain=forwardaction as I mentioned and its working fine for me with no changes to Traefik.Perhaps someone else can chime in.
@Ezzahhh commented on GitHub (Oct 23, 2019):
Yeah it's definitely something to do with my bitwarden config, because fail2ban is banning IPs for sshd and that is working fine.
When I run : fail2ban-regex /bw-data/bitwarden.log /etc/fail2ban/filter.d/bitwarden.conf
I definitely get matches on previous failed logins
@dani-garcia commented on GitHub (May 13, 2020):
Closed due to inactivity.
@savowe commented on GitHub (Dec 21, 2020):
I had the very same issue. Tried some things posted in other issues such as checking for correct timezone settings and so forth nothing worked. Even though
fail2ban-regexgot all the correct hits with the regex^.*Username or password is incorrect\. Try again\. IP: <HOST>\. Username:.*$'it would not work when actually running fail2ban.It started working when I changed the timestamp to
-e LOG_TIMESTAMP_FORMAT="%Y-%m-%d %H:%M:%S"leaving out the
%3fat the end.