Repository navigation
filter.d/authelia: add new filter and jail for Authelia - #4259
Merged
Merged
Conversation
Add filter and jail configuration for Authelia 2FA/SSO portal, supporting standard key-value (file) and structured JSON logging formats with respective unit test samples. Closes fail2bangh-4005
rafaelsoje
force-pushed
the
add-authelia-filter
branch
from
November 2, 2026 13:59
c75dbf5 to
e5fdcef
Compare
…lookahead for msg and remote_ip tokens)
sebres
approved these changes
Nov 2, 2026
| datepattern = <lt_<logtype>/datepattern> | ||
| ignoreregex = | ||
|
|
||
| journalmatch = _SYSTEMD_UNIT=authelia.service |
Contributor
There was a problem hiding this comment.
I don't think this filter would work with journal (because normally it'd expect a typical journal prefix, with host and [pid]), but OK - one can do it later...
Contributor
Author
There was a problem hiding this comment.
Thanks for merging and for the regex optimization! That makes total sense regarding the journal prefix. I'll test Authelia logs under systemd-journald and submit a follow-up PR to handle the journal prefix properly.
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds official filter and jail configuration for the Authelia 2FA/SSO authentication portal, supporting both standard key-value (file) and structured JSON logging formats.
Closes gh-4005
Details
config/filter.d/authelia.conf:logtype:file(default key-value format) andjson(structured JSON format).Unsuccessful \S+ authentication attempt by user '<F-USER>'.<ADDR>fromremote_ip.journalmatch = _SYSTEMD_UNIT=authelia.servicefor systemd journal integration.config/jail.conf:[authelia]jail definition with standard portshttp,https,9091and logpath/var/log/authelia/authelia.log.filter = authelia[logtype=json].fail2ban/tests/files/logs/authelia:filterOptions: [{"logtype": "json"}]) covering 1FA, TOTP, and WebAuthn.# failJSON: { "match": false }) for successful authentications in both formats to prevent false positives.ChangeLog:### New Features and Enhancements.Verification
fail2ban-regexagainst text log format:Lines: 1 lines, 0 ignored, 1 matched, 0 missedfail2ban-regexagainst JSON log format ([logtype=json]):Lines: 1 lines, 0 ignored, 1 matched, 0 missed./bin/fail2ban-testcases --no-network samples->Ran 102 tests in 0.540s, OKChecklist
# failJSON) withinfail2ban/tests/files/logs/Xfile