Repository navigation
filter.d/immich: add new filter and jail for Immich - #4281
Open
rafaelsoje wants to merge 1 commit into
Open
rafaelsoje wants to merge 1 commit into
rafaelsoje wants to merge 1 commit into
Conversation
Add filter and jail configuration for Immich photo and video management solution, supporting both reverse proxy access logs and direct application server logs with respective unit test samples. Closes fail2bangh-4029
This branch has not been deployed
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 Immich photo and video management solution, supporting both reverse proxy access logs (Nginx, Traefik, Apache, Caddy) and direct application server logs (NestJS / Docker / systemd-journal).
Closes gh-4029
Details
config/filter.d/immich.conf:POST /api/auth/login) returning HTTP status code401 Unauthorized.[Api:AuthService]and legacy[AuthService].<ADDR>(IPv4 and IPv6) and username via<F-USER>.before = common.confand%(__prefix_line)sto dynamically support standard file logging as well as systemd journal format (logtype = journal).journalmatch = _SYSTEMD_UNIT=immich-server.service + _COMM=immich-server.config/jail.conf:[immich]jail definition with portshttp,https,2283and default logpath/var/log/nginx/immich.access.fail2ban/tests/files/logs/immich:filterOptions: [{"logtype": "journal"}]) covering both IPv4 and IPv6.# failJSON: { "match": false }) for successful logins (201 Created) and non-auth401responses (e.g./api/photos) to ensure no false positives.ChangeLog:### New Features and Enhancements.Verification
fail2ban-regextests:Lines: 1 lines, 0 ignored, 1 matched, 0 missedLines: 1 lines, 0 ignored, 1 matched, 0 missed[logtype=journal]:Lines: 1 lines, 0 ignored, 1 matched, 0 missed./bin/fail2ban-testcases samplestestcase->Ran 103 tests in 0.541s, OK./bin/fail2ban-testcases clientreadertestcase->OK(stock jail.conf consistency check passed)./bin/fail2ban-testcases -f -m -n->Ran 530 tests in 5.257s, OKChecklist
# failJSON) within fail2ban/tests/files/logs/X file