The base image prioritizes a small package set and predictable baseline controls. The production profile adds stronger host logging, audit, and hardening without adding role packages.
- SSH key authentication enabled.
- SSH password authentication disabled.
- Root SSH login limited to key-based access.
- UFW enabled with incoming traffic denied by default.
- OpenSSH allowed through UFW.
- Fail2Ban installed and enabled for SSH.
- unattended security upgrades enabled.
- qemu guest agent installed and enabled.
- cloud-init configured to regenerate SSH host keys on first boot.
- machine-id reset during cleanup.
- persistent journald storage with retention limits.
- rsyslog and logrotate defaults for common system logs.
- auditd enabled with baseline rules for identity, sudo, SSH, firewall, Fail2Ban, apt, time, hostname, and mount changes.
- sysctl hardening for kernel pointer exposure, dmesg access, ptrace restrictions, protected links/files, redirects, source routing, reverse path filtering, martian logging, and TCP SYN cookies.
The base image intentionally excludes heavy or role-specific software:
- Docker
- Node.js
- PHP
- MariaDB or MySQL
- CyberPanel
- Kubernetes packages
- development toolchains
Those should be added through future role profiles so the base image remains lightweight and broadly reusable.
Base and production profiles default to closed incoming ports except SSH. Role profiles explicitly open the required ports:
- Web Server Profile: Opens ports
80(HTTP) and443(HTTPS). - CyberPanel Profile: Opens ports
21(FTP),25(SMTP),53(DNS TCP/UDP),80(HTTP),443(HTTPS),465(SMTPS),587(Submission),993(IMAPS),995(POP3S),7080(LiteSpeed WebAdmin Console), and8090(CyberPanel console).
The SSH port is configurable via the SF_SSH_PORT build parameter (default 22). Unlike other services, the SSH port uses packet rate-limiting (ufw limit) to mitigate quick brute-force attempts.
Fail2Ban is the primary automated banning layer. It uses UFW actions and configures:
- The SSH jail by default.
- A custom
cyberpaneljail to monitor login failures in/home/cyberpanel/error-logs.txtand block offending IPs (automatically activated when thecyberpanelmodule is included).
For profiles incorporating the docker module, security configurations are standardized to protect the host machine:
- Log Management: A default
/etc/docker/daemon.jsonsets log rotation constraints (max-size: 50m,max-file: 3) to prevent storage exhaustion attacks/bugs. - Availability:
live-restoreis enabled to keep running containers alive during daemon restarts or updates. - Access Control: A dedicated
dockergroup is pre-configured, adding the default administrativeubuntuuser to it, eliminating the requirement for sudo prefixing when managing containers locally while isolating non-sudo users from the docker socket.
Security improvements should usually land in reusable modules. OS-specific behavior can branch inside a module or use OS-specific module implementations later, but profile names should stay role-oriented rather than distribution-script-oriented.