-
-
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
Add built-in fail2ban filters #1375
Conversation
ca1d4bf
to
ffce489
Compare
@tangrufus I think we "recommend" (or at least link to) https://github.com/ItinerisLtd/trellis-disable-xml-rpc but the fail2ban based solution should be better since it will prevent it at the iptables level so requests don't even reach Nginx. Any thoughts? |
Agree.
Agree. They block at different levels. It should be okay to have both enabled at the same time. We should update https://docs.roots.io, especially:
Question: When an IP is banned because of one of the fail2ban services (e.g: If yes, we should warn the users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
I believe so since the ban is done at the iptables level which doesn't know about URLs. So the initial detection is URL based, but the ban isn't. |
Trellis supported default fail2ban services previously but they were restricted to filters built into fail2ban itself (like `sshd`). This adds filters defined by Trellis as well now by automatically creating the filter configuration files from templates. Importantly, these filters will be _disabled_ by default. Any time a new filter is added, it will also be added to `fail2ban_services_custom` with enabled set to `false.` This achieves a few goals: 1. makes it very easy to enable the built-in filters, which 2. brings more awareness to them by adding them to `group_vars/all/security.yml` 3. hopefully encourages more fail2ban filters to be created and used Currently there's only one built-in filter for banning requests to WordPress' `xmlrpc.php` endpoint which is a common DDoS attack vector.
ecf8ef7
to
73b5073
Compare
Trellis supported default fail2ban services previously but they were restricted to filters built into fail2ban itself (like
sshd
).This adds filters defined by Trellis as well now by automatically creating the filter configuration files from templates.
Importantly, these filters will be disabled by default. Any time a new filter is added, it will also be added to
fail2ban_services_custom
with enabled set tofalse.
This achieves a few goals:
group_vars/all/security.yml
There's two initial filters:
Which are both designed to prevent common DDoS attack vectors.