-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
fail2ban not working with dropbear (+ a hacky solution) #6665
Comments
Many thanks for your report. The reason might be that Dropbear turned into a native systemd service with Bookworm, while previously it was an init.d service. The difference is that as init.d service is runs in background, while as systemd service is runs in foreground, i.e. the However, while it is not beautiful to have doubled timestamps, indeed it does not really hurt either, when the Fail2Ban filter allows it. Here is a pattern with works without loosening the regex: prefregex = ^%(__prefix_line)s\[\d+\] [A-Z][a-z]+ \d\d \d\d:\d\d:\d\d <F-CONTENT>(?:[Ll]ogin|[Bb]ad|[Ee]xit).+</F-CONTENT>$ |
Sent upstream: fail2ban/fail2ban#3597 |
- DietPi-Software | Fail2Ban: Resolved an issue on Debian Bookworm and above, where Dropbear login failures were not detected due to a non-matching default filter. Dropbear runs as native systemd unit since Bookworm, logging to the system journal via STDOUT, which results in a different log entry prefix. The default filter however has not been updated for this. The fix is as well applied to existing Fail2Ban installs, as long as no own override /etc/fail2ban/filter.d/dropbear.local has been created. Many thanks to @ThePlanplan for reporting this issue: #6665
Fixed with: 7095f96 |
Sent to Debian: https://salsa.debian.org/python-team/packages/fail2ban/-/merge_requests/10 I'l mark this as closed now, as it is solved for DietPi users and I did all I can to solve it for Debian and upstream users as well. |
Uhh, there is more broken: fail2ban/fail2ban#3791 The most important cases (wrong password) are again successfully tracked, but login attempts with wrong users cannot be tracked, and the additional fail match when the Dropbear retry limit has been reached (less relevant) does not match anymore. |
Required Information
Additional Information (if applicable)
Steps to reproduce
fail2ban
on a clean dietpi installationfail2ban-client
for jails, dropbear is up and runningExpected behaviour
I should be banned after 3 failed attempts.
Actual behaviour
Nothing happen.
Extra details
I searched for a bit, and I think the way the logs are formated in journactl are the cause of the problem.
The date appear 2 times, and the fail2ban filter for dropbear is too strict for this case.
I resolved the problem on my machine by modifying the filter and allowing the filter to search in the middle of a line, but I don't think it's a good thing :
/etc/fail2ban/filter.d/dropbear.conf
to
The text was updated successfully, but these errors were encountered: