Skip to content
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

XIVY-15829 Add an example with NGINX with rate limits and fail2ban #252

Merged
merged 1 commit into from
Mar 14, 2025

Conversation

weissreto
Copy link
Member

No description provided.

@weissreto weissreto requested a review from ivy-cst March 12, 2025 15:17
@weissreto weissreto requested a review from alexsuter as a code owner March 12, 2025 15:17
Copy link
Member

@alexsuter alexsuter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,21 @@
# Fail2Ban configuration file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you really need to add all the fail2ban configuration files. are these not already part of the container itself?

if they are already in the container, then I would not define them here. because they are getting outdated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they are not part of this image. I copied them from the swag image. But here I use the fail2ban image itself.

Copy link
Member

@ivy-cst ivy-cst Mar 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry seems that only this nginx-badbots.conf is not here by default. I would remove it. I do not think that this filter helps a lot. The other filters should be inside the image.

Copy link
Member

@ivy-cst ivy-cst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool.
There is also a nginx-limit-req fail2ban jail. If you get rate limitted to often you also get banned ;).

# To use 'nginx-limit-req' jail you should have `ngx_http_limit_req_module` 
# and define `limit_req` and `limit_req_zone` as described in nginx documentation
# http://nginx.org/en/docs/http/ngx_http_limit_req_module.html
# or for example see in 'config/filter.d/nginx-limit-req.conf'
[nginx-limit-req]
port    = http,https

[Definition]

logtarget = STDOUT
dbfile = /config/fail2ban/fail2ban.sqlite3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add final new line

@ivy-cst
Copy link
Member

ivy-cst commented Mar 14, 2025

Please fix the warnings in the nginx log:

nginx-1  | nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:25
nginx-1  | nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:26

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be document how we can see the fail2ban logs? docker compose logs fail2ban

@weissreto weissreto force-pushed the feature/XIVY-15829_fail2ban branch from bd43003 to 9ffe936 Compare March 14, 2025 15:20
@weissreto weissreto merged commit c0d8f7a into master Mar 14, 2025
@weissreto weissreto deleted the feature/XIVY-15829_fail2ban branch March 14, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants