vn-ansible/linux/base-config-debian/config-fail2ban.yaml

37 lines
811 B
YAML

---
- hosts: "{{ ip_addr }}"
become: yes
become_method: sudo
gather_facts: yes
tasks:
- name: set variables
set_fact:
bantime: "10m"
maxretry: "10"
findtime: "10m"
jails:
- name: sshd
enabled: true
filter: sshd
logpath: /var/log/lastlog
port: ['ssh', '22']
maxretry: 10
bantime: 10m
findtime: 10m
- name: asterisk
enabled: true
filter: asterisk
logpath: /var/log/asterisk/messages
port: ['asterisk', '5060']
maxretry: 10
bantime: 10m
findtime: 10m
- name: "[CONFIG FAIL2BAN] Install and configure fail2ban service"
import_role:
name: config-fail2ban