Protegiendo ProXmox con Fail2ban
Es esta entrada vamos a ver como protegemos nuestro ProXmox con fail2ban de tal manera que mediante el registro de los log podremos bloquear los accesos SSH no autorizados. 1.- Instalamos fail2ban apt-get install fail2ban 2.- Creamos el archivo /etc/fail2ban/jail.local para definir los log de ProXmox [proxmox] enabled = true port = https,http,8006 filter = proxmox logpath = /var/log/daemon.log maxretry = 3 bantime = 36000 3.- Creamos el archivo /etc/fail2ban/filter.d/proxmox.conf para el filtro de ProXmox [Definition] failregex = pvedaemon\[.*authentication failure; rhost= user=.* msg=.* ignoreregex = 4.- Reiniciamos el servicio y lo dejamos activando systemctl restart fail2ban systemctl enable fail2ban 5.- Para comprobar su funcionamiento fail2ban-regex /var/log/daemon.log /etc/fail2ban/filter.d/proxmox.conf tail -f /var/log/fail2ban.log