Ir al contenido

Base Linux Securitization Playbook

Linux Server Hardening Guide

0views

This document contains the hardening guide that will be systematically applied to all Ubuntu 22.04 LTS machines in the Portelcore ecosystem to ensure a Zero Trust environment.

In a modern environment, remote access such as root should never be allowed, nor should simple passwords be used. These measures will be applied to /etc/ssh/sshd_config:

Ventana de terminal
PermitRootLogin no
PasswordAuthentication no
ChallengeResponseAuthentication no

2. Implement Firewall with UFW and Application Profiles

Sección titulada «2. Implementar Firewall con UFW y Perfiles de Aplicación»

All servers will have ports blocked by default except for SSH (modified port) and those specific to the application they host:

Ventana de terminal
ufw default deny incoming
ufw default allow outgoing
ufw allow 2222/tcp # Nuestro SSH endurecido
ufw allow 'Nginx Full'
ufw enable

To reduce the attack surface and unnecessary routing vectors (if the local infrastructure does not require IPv6):

It will be added to /etc/sysctl.conf:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

And finally, reload the kernel with sysctl -p.