Hardening the operating system for rConfig
Hardening the operating system for rConfig
Section titled “Hardening the operating system for rConfig”These are the operating system settings that matter most for an rConfig server, taken from the CIS Benchmarks for RHEL 9 (which Rocky and AlmaLinux follow) and Ubuntu 24.04. From V8.5.0, Security Center checks what the web user can see; the root server check covers sshd, sudo and pending updates.
Firewall (os.firewall)
Section titled “Firewall (os.firewall)”Allow SSH, HTTPS and only the rConfig services you use (xFTP, SNMP traps on 162/udp).
sudo systemctl enable --now firewalldsudo firewall-cmd --permanent --add-service=ssh --add-service=httpssudo firewall-cmd --reloadsudo ufw allow OpenSSHsudo ufw allow 443/tcpsudo ufw enableSELinux (os.selinux, RHEL family)
Section titled “SELinux (os.selinux, RHEL family)”Keep SELinux enforcing. rConfig’s install scripts set the labels it needs. Check for denials before you switch from permissive:
sudo ausearch -m avc -ts recentsudo setenforce 1sudo sed -i 's/^SELINUX=.*/SELINUX=enforcing/' /etc/selinux/configUpdates (os.auto_updates, os.reboot_required, server.os.security_updates)
Section titled “Updates (os.auto_updates, os.reboot_required, server.os.security_updates)”sudo dnf install dnf-automatic# In /etc/dnf/automatic.conf: upgrade_type = security, apply_updates = yessudo systemctl enable --now dnf-automatic.timersudo apt install unattended-upgradessudo dpkg-reconfigure -plow unattended-upgradesRestart PHP-FPM and Horizon after PHP updates, and reboot after kernel updates.
Time and audit (os.time_sync, os.auditd)
Section titled “Time and audit (os.time_sync, os.auditd)”sudo systemctl enable --now chronyd # chrony on Ubuntusudo systemctl enable --now auditd# Watch rConfig's secrets fileecho "-w /var/www/html/rconfig8/.env -p rwa -k rconfig-env" | sudo tee /etc/audit/rules.d/rconfig.rulessudo augenrules --loadSSH and sudo (server.os.sshd_, server.os.sudoers_)
Section titled “SSH and sudo (server.os.sshd_, server.os.sudoers_)”In /etc/ssh/sshd_config, after setting up SSH keys for named users:
PermitRootLogin noPasswordAuthentication noThen sudo systemctl reload sshd. The web user (apache or www-data) must never have NOPASSWD: ALL; rConfig needs only its own helper rules.
.env and its backups must not be readable by other users (app.env_file_perms, app.env_backups), saved configs are 0440 with folders 0750 (data.config_file_modes), and nothing in the rConfig folder may be world-writable (server.os.app_world_writable).
sudo chmod o-rwx /var/www/html/rconfig8/.envcd /var/www/html/rconfig8 && sudo php artisan rconfig:set-config-permissionsversions.os_eol warns six months before your OS release stops getting security updates.
Standards: CIS Red Hat Enterprise Linux 9 Benchmark, CIS Ubuntu Linux 24.04 LTS Benchmark, DISA STIGs, NIST SP 800-53 AC-6, AU-2, AU-8, CM-6, SC-7, SI-2.