Post

Hardening y vulnerabilidades Linux

Hardening y vulnerabilidades Linux

Hardening y vulnerabilidades Linux

Este post ayuda a revisar el estado de seguridad de servidores Linux, comprobar parches, servicios expuestos, accesos, firewall y logs relevantes.

Identificacion del sistema

1
2
3
4
hostnamectl
cat /etc/os-release
uname -a
rpm -qa --last | head

Parches y repositorios

1
2
3
yum check-update
yum updateinfo list security all
yum updateinfo list cves

Servicios expuestos

1
2
3
ss -tulpen
systemctl list-unit-files --state=enabled
systemctl --failed

Usuarios y accesos

1
2
3
4
getent passwd
awk -F: '($3 == 0) {print $1}' /etc/passwd
lastlog
faillock --user <USUARIO>

SSH

Revisar al menos:

1
2
3
4
PermitRootLogin no
PasswordAuthentication no
Protocol 2
AllowUsers <USUARIO>

Firewall

1
2
3
4
iptables -S
iptables -L -n -v
firewall-cmd --list-all
firewall-cmd --list-services

SACK y kernel

1
2
3
sysctl net.ipv4.tcp_sack
sysctl net.ipv4.tcp_dsack
sysctl net.ipv4.tcp_fack

Ejemplo de mitigacion temporal si aplica:

1
sysctl -w net.ipv4.tcp_sack=0

Logs utiles

1
2
3
journalctl -p warning..alert
grep -i "failed password" /var/log/secure*
ausearch -m USER_LOGIN,USER_AUTH
This post is licensed under CC BY 4.0 by the author.