debops / ansible-fail2ban

Install and configure fail2ban service
GNU General Public License v3.0
38 stars 15 forks source link

Change filters failregex #25

Closed hohmanjl closed 6 years ago

hohmanjl commented 6 years ago

Change fail2ban_filters failregex to a list to support multiple pattern matching.

Example fail2ban.yml

fail2ban_filters:
  - name: custom_filter
    failregex:
      - '(?i)<HOST> (php|sql|web|pma|/p/m/a/)'
      - '(?i).*admin task.*HTTP.*'
    state: present

Reference: https://www.fail2ban.org/wiki/index.php/MANUAL_0_8

drybjed commented 6 years ago

Sounds good. Can you create a PR with this change against the DebOps monorepo instead? The roles will be exported from there at some point.

hohmanjl commented 6 years ago

Hi Maciej,

I did further reading / playing around and it looks like the code change is not needed. I will submit a PR with a change to the docs that illustrates how to perform multiline regex using the existing codebase. Perhaps add a filter example.

hohmanjl commented 6 years ago

Maciej,

Changes discussed above in PR: https://github.com/debops/debops/pull/69

Thanks.