This document describes the security measures applied by the bootstrap.
- unattended-upgrades is installed and configured.
- Configuration:
/etc/apt/apt.conf.d/20auto-upgrades - Security updates are applied automatically; package lists are updated daily.
- Default policy: deny incoming, allow outgoing.
- Allowed incoming: SSH (22), HTTP (80), HTTPS (443).
- UFW is enabled. Custom rules can be added in
config/ufw/rules.sh(executable).
- Jail configuration:
config/fail2ban/jail.local→/etc/fail2ban/jail.local - Default settings:
maxretry = 5,bantime = 1h,findtime = 10m - Jails:
- sshd — protects SSH
- nginx-http-auth — protects Nginx auth (e.g. login pages)
Commands:
- Status:
sudo fail2ban-client status - Unban:
sudo fail2ban-client set sshd unbanip <IP>
- Applied via
/etc/ssh/sshd_config.d/99-bootstrap-hardening.conf(drop-in). - PermitRootLogin — set to
no(use thedeployuser and sudo). - MaxAuthTries — 3.
- PubkeyAuthentication — yes.
- PermitEmptyPasswords — no.
- X11Forwarding — no.
- PasswordAuthentication — left as yes by default; set to
noonly after the deploy user has key-based access.
- Configuration:
config/sysctl/hardening.conf→/etc/sysctl.d/99-hardening.conf - RP filter — IP spoofing protection (reverse path filtering).
- ICMP redirects — disabled.
- TCP SYN cookies — enabled.
- Source routing — disabled.
- Log martians — enabled (logs suspicious packets).
- Server tokens — disabled (hides Nginx version).
- Security headers (via snippet):
X-Frame-Options: SAMEORIGINX-Content-Type-Options: nosniffX-XSS-Protection: 1; mode=blockReferrer-Policy: strict-origin-when-cross-origin
- Dedicated unprivileged user for deployments.
- Sudo access (NOPASSWD by default; restrict in
/etc/sudoers.d/deployif required). - Member of the
dockergroup for running containers. - Root SSH login disabled; use this user and sudo for administration.
- SSH key in place for
deploybefore disabling root/password login - Firewall allows only required ports; custom app ports added in
config/ufw/rules.shif needed - SSL/TLS via Certbot for any public HTTP(S) sites
- Fail2ban jails and bantime reviewed for your environment
- Sudo and deploy user permissions reviewed (e.g. restrict NOPASSWD if needed)