debops / ansible-fail2ban

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

How to configure definitions section in fail2ban_filters section #16

Closed jlerbsc closed 7 years ago

jlerbsc commented 7 years ago

I want to specify _daemon = sshd in definitions but i don't know how to defines it. Could you improve your doc with more exemples ?

is it ? definitions = '_daemon = sshd'

jlerbsc commented 7 years ago

i try it. It seems to be the right way

definitions:
  _deamon: sshd
jlerbsc commented 7 years ago

this is a more complex configuration exemple

fail2ban_filters:

  - name: 'sshd-connect'
    before: 'common.conf'
    definitions:
      _daemon: sshd
    failregex: |
      '^%(__prefix_line)sConnection closed by <HOST> \[preauth\]$'
      '^%(__prefix_line)sDisconnecting: Too many authentication failures for .+? from <HOST> .+? \[preauth\]$'
    state: 'present'