cornfeedhobo / ansible-role-fail2ban

Install and configure fail2ban

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fail2ban Ansible Role

install, configure, and manage fail2ban

Table of content


Requirements

  • Minimum Ansible version: 2.5

Default Variables

fail2ban_configure

Default value

fail2ban_configure: true

fail2ban_filters

name: before: [] after: [] failregex: [] ignoreregex: []

Default value

fail2ban_filters: {}

Example usage

nginx-custom:
  init:
    block: >-
      \/?(<webmail>|<phpmyadmin>|<wordpress>|<php>|<misc>)[^,]*
    misc: >-
      (cgi-bin|mysqladmin|admin|aws|credentials|\.aws)
    php: >-
      (phpinfo|test\.php|vendor|laravel|\?XDEBUG_SESSION_START)
    phpmyadmin: >-
      (typo3/|xampp/|admin/|)(pma|(php)?[Mm]y[Aa]dmin)
    webmail: >-
      roundcube|(ext)?mail|horde|(v-?)?webmail
    wordpress: >-
      wp-(login|signup|admin)\.php
  failregex:
    - >-
      \"<HOST>\" \"(\w+|-)\" \"https?\:\/\/.+\" .+ (301|4\d\d)$
    - >-
      \"<HOST>\" \"(\w+|-)\" \"https?\:\/\/[\w\d\.]+<block>\"
    - >-
      \[error\] \d+#\d+: \*\d+ (\S+ )?\"\S+\" (failed|is not found) \(2\: No such file or directory\), client\: <HOST>\, server\: \S*\, request: \"(GET|POST|HEAD).*\"
  ignoreregex: []

fail2ban_install

Default value

fail2ban_install: true

fail2ban_jails

Jail rules in the form of name: {key: value, ...}

Default value

fail2ban_jails: {}

Example usage

nginx-custom:
  enabled: "true"
  filter: "nginx-custom"
  bantime: "72h"
  findtime: "180m"
  maxretry: 3

fail2ban_package_state

Default value

fail2ban_package_state: present

fail2ban_packages

Default value

fail2ban_packages: [fail2ban]

fail2ban_service

Default value

fail2ban_service: true

fail2ban_service_enabled

Default value

fail2ban_service_enabled: true

fail2ban_service_name

Default value

fail2ban_service_name: fail2ban

fail2ban_service_state

Default value

fail2ban_service_state: started

Discovered Tags

fail2ban

fail2ban-configure

fail2ban-install

fail2ban-service

Dependencies

None.

License

MIT

Author

cornfeedhobo

About

Install and configure fail2ban

License:MIT License


Languages

Language:Jinja 85.7%Language:Makefile 14.3%