Skip to content

Security Hardening

Security configuration for production deployments.


HTTPS

  • Force HTTPS redirect
  • HSTS headers
  • Secure cookies

Firewall

# Allow only necessary ports
ufw allow 22/tcp  # SSH
ufw allow 80/tcp  # HTTP
ufw allow 443/tcp # HTTPS
ufw enable

Database Security

  • Use strong passwords
  • Restrict database access
  • Enable SSL connections