-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Make Fail2ban settings extensible #1177
Make Fail2ban settings extensible #1177
Conversation
A use case would be adding services and filters to integrate the WP-Fail2ban plugin. |
Thanks for the suggestion and use case. By default, every variable in Ansible can be overridden in # group_vars/all/fail2ban.yml
fail2ban_services:
- name: ssh
port: ssh
filter: sshd
logpath: /var/log/auth.log
- name: postfix
port: smtp,ssmtp
filter: postfix
logpath: /var/log/mail.log The The one very minor downside here is you need to include the default Nginx includes warrant their own extra solution for one main reason: they are templates which can't just be represented in a YAML data structure like these fail2ban services can. This seems like it would solve your use case; can you confirm that? If so, I'd prefer just using these default features of Ansible in this case instead of adding an extra feature. |
Indeed, and people might miss or forget that and inadvertently deactivate the
For the services part yes, for the filters part no. They still have to be copied over to the servers, which I introduce in the second commit d7f8733 For the WP Fail2ban, 3 filters and 3 services have to be added. If this convinces you, should I also edit the Fail2ban Readme and add this to the docs in Digging deeper or Security? |
By the forums, it seems people bumped into this already without being able to configure Fail2ban as expected. |
Ah thank you, that makes sense! I didn't know about the filters. Yes updating the README + docs would be great. Thank you 😄 |
This PR should be ready, but I am still working on roots/docs. But I am blocked by an unexpected behavior described in #1181. |
enable adding custom services in 'group_vars/'; rename default list to 'fail2ban_services_default'; create 'fail2ban_services_default'; combine 'default' & 'custom'.
enable adding custom Fail2ban filters; task style inspired from 'nginx-includes' task in 'wordpress-setup' role; add tasks to copy Fail2ban filter configurations; set default folder 'fail2ban-filters'.
Add new variables and their description. Explain how to add services and filters in `group_vars` and `fail2ban_filters` respectively.
Rebased to HEAD. |
🎉 thank you this is great. Tested it out and works as expected. |
add the ability to add custom services in
group_vars/
;add the ability to include custom filters in a new
fail2ban-filters/
folder;inspired from the
nginx-includes
task inwordpress-setup
role.