Comments (2)
the error log can not be changed in nginx and it always adds a timestamp to the error message
Imho, it depends on how the log-forwarding to syslog in configured.
Changing the start of the expression from ^\s*[error] to ^.*[error] resolves this problem and the filter matches.
This is ugly workaround, since the RE becomes vulnerable due to broken anchor - because ^.*
is quasi the same as if it were missing, so no anchor anymore and REs may match everywhere (also against a user input with an "injection" attempt), additionally it becomes very slow, especially on long messages, since it must search the whole message.
Anyway for people having that format here is interim workaround:
- mdre-auth = ^\s*\[error\] \d+#\d+: \*\d+ user "(?:[^"]+|.*?)":? (?:password mismatch|was not found in "[^\"]*"), client: <HOST>, server: \S*, request: "\S+ \S+ HTTP/\d+\.\d+", host: "\S+"(?:, referrer: "\S+")?\s*$
+ mdre-auth = ^\s*(?:(?!\[)\S+ nginx\[\d+\]: [^\[]*)?\[error\] \d+#\d+: \*\d+ user "(?:[^"]+|.*?)":? (?:password mismatch|was not found in "[^\"]*"), client: <HOST>, server: \S*, request: "\S+ \S+ HTTP/\d+\.\d+", host: "\S+"(?:, referrer: "\S+")?\s*$
- mdre-fallback = ^\s*\[crit\] \d+#\d+: \*\d+ SSL_do_handshake\(\) failed \(SSL: error:\S+(?: \S+){1,3} too (?:long|short)\)[^,]*, client: <HOST>
+ mdre-fallback = ^\s*(?:(?!\[)\S+ nginx\[\d+\]: [^\[]*)?\[crit\] \d+#\d+: \*\d+ SSL_do_handshake\(\) failed \(SSL: error:\S+(?: \S+){1,3} too (?:long|short)\)[^,]*, client: <HOST>
(part (?:(?!\[)\S+ nginx\[\d+\]: [^\[]*)?
would optionally match systemd prefix with also optional additional timestamp)
from fail2ban.
Thanks a lot for the quick resolution. I suspected that my workaround is a dirty hack.
from fail2ban.
Related Issues (20)
- [BR]: Fail2ban not filtering ssh on Debian 12 due to journalctl controlling logs HOT 1
- Exit code 255 HOT 1
- [BR]: backend = systemd seems to ignore user journals HOT 1
- [BR]: Debian 12 by default fail2ban fails start HOT 4
- [BR]:Ineffective for sip requests HOT 2
- [RFE]: fail2ban-client unban should print what it unbanned
- ERROR NOK: (13, 'Permission denied') HOT 1
- [BR]: Can't get firewall bans to go into a different zone HOT 3
- Unavailability of iptables-multiport on VPS HOT 2
- [BR]: fail2ban not banning specific IP HOT 2
- Error when trying to ban? HOT 1
- [BR]: Fail2ban for mssql not work filtering my log from docker containers log HOT 1
- [BR]: Long lines are let through to an email causing it to bounce HOT 4
- [BR]: Failed during configuration: Have not found any log file for jupyterlab jail (log not in /var/log) HOT 5
- [FR]: SoftEtherVPN stable edition HOT 1
- [RFE]: Document upgrade (in)compatibility HOT 1
- [FR]: nginx-limit-conn.conf HOT 1
- [BR]: wont run HOT 1
- [BR]: iptables action: no chains after start HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fail2ban.