mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
[Security Request] Fail2Ban Support #7920
Labels
No labels
Accessibility
AppImage
Bounty
Build system
CI
Can't reproduce
Code cleanup
Confirmed bug
Confirmed bug
Core
Crash
Data loss
Discussion
Docker
Documentation
Duplicate
Feature
Feature request
Feature request
Feature request
Filters
Flatpak
GUI
Has workaround
I2P
Invalid
Libtorrent
Look and feel
Meta
NSIS
Network
Not an issue
OS: *BSD
OS: Linux
OS: Windows
OS: macOS
PPA
Performance
Project management
Proxy/VPN
Qt bugs
Qt6 compat
RSS
Search engine
Security
Temp folder
Themes
Translations
Triggers
Waiting diagnosis
Waiting info
Waiting upstream
Waiting web implementation
Watched folders
WebAPI
WebUI
autoCloseOldIssue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/qBittorrent#7920
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 @zero77 on GitHub (Oct 15, 2018).
Can you please add support for fail2ban by, creating a log of failed logins with the IP address, date and time stamp.
Thanks
https://github.com/fail2ban/fail2ban
Basic requirements for log compatibility:
Also, perhaps just separate logs as I think this could decrease system load when analyzing.
@boredomdenied commented on GitHub (Oct 27, 2018):
I would very much like this as well
@Chocobo1 commented on GitHub (Oct 27, 2018):
@zero77
IMO it doesn't make sense for qbt to support other log format, also I suspect it would be much eaiser the other way around (fail2ban to support qbt log format), they support writing custom filters: https://fail2ban.readthedocs.io/en/latest/filters.html
@Piccirello commented on GitHub (Oct 28, 2018):
All we'd need to do is log some additional information on auth failures- the fail2ban custom filter would take care of the rest. I want to look into this further, but very short on time right now. Will try to make time if no one else picks it up.
@aorith commented on GitHub (Jan 29, 2020):
This regex seems to work fine but only if you use a reverse proxy with nginx to connect to qbittorrent:
failregex = ^<HOST> - -.*POST /qbt/api/v2/auth/login HTTP/1.1" 200 6 "Failed login prints 200 6, successful login 200 3
@Feriman22 commented on GitHub (Jan 4, 2023):
@aorith, could you tell me where is the log file located for this one? Thx!
@aorith commented on GitHub (Jan 4, 2023):
The log is wherever you want, it's the log from nginx, see: http://nginx.org/en/docs/http/ngx_http_log_module.html
It's a common practice to reverse proxy local services (for TLS termination, etc), see: https://github.com/qbittorrent/qBittorrent/wiki/NGINX-Reverse-Proxy-for-Web-UI
The fail2ban custom regex that I posted reads the nginx log file trying to find that pattern, it's a very weak check that worked fine for me, it just checks the bytes from the default nginx logging format, which is:
So it's the field
$body_bytes_sent, and it was 6 when a login failed.It's been a long time and I'm not using qbittorrent at this moment, so maybe they've changed the status code from 200 to 401 already which should make things easier...