Saltar al contenido
56K

56K

Slow IT Notes – Just 4 Fun

Menú
Menú

Proxmox – 0x01 – Bloquear intentos de acceso a Proxmox 6 con Fail2ban

Publicada el 03/11/202125/04/2024 por fanta

En cada nodo que tengamos es buena cosa instalar fail2ban. Si instalaste Proxmox 6 sobre una debian 10 es proceso es muy sencillo.

# apt-get install fail2ban

Se instala fail2ban y luego se crea el siguiente archivo: /etc/fail2ban/jail.d/proxmox.conf

# cd /etc/fail2ban/jail.d/ 
# nano proxmox.conf

En ese archivo se especifica lo siguiente:

[proxmox]
enabled = true
port = https,http,8006
filter = proxmox
logpath = /var/log/daemon.log
maxretry = 3
# 1 hour
bantime = 3600

Luego creamos un segundo archivo con el filtro: /etc/fail2ban/filter.d/proxmox.conf

# cd /etc/fail2ban/filter.d/ 
# nano proxmox.conf 

Con el siguiente contenido:

[Definition]
failregex = pvedaemon\[.*authentication failure; rhost=<HOST> user=.* msg=.*
ignoreregex =

Y reiniciamos fail2ban así:

# systemctl restart fail2ban

 

Podemos realizar pruebas en algún nodo. En la interface web (puerto 8006). Fallamos varias veces y desde la consola comprobamos:

 

# fail2ban-client status proxmox

 

Lo mismo si queremos comprobar fallos de intento de acceso en el 22 (sshd):

# fail2ban-client status sshd


fanta

Escrito por Fanta
fanta de naranja
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
💾 QEMU
💾 SOLARIS
💾 ESXi
💾 FREEBSD
💾 DEBIAN
💾 AMIGA
💾 SYSADMIN
💾 JUNOS
💾 IMPRIMIR
💾 MSDOS
💾 WINDOWS
💾 FAIRPHONE
💾 GAMING
💾 STREAMING
💾 REDHAT
💾 GRÁFICOS
💾 CACHARROS
💾 SONIDO
💾 NETWORKING
💾 ROCKY
💾 SUSE
💾 TMP
©2025 56K | Construido utilizando WordPress y Responsive Blogily tema por Superb
Menú