Skip to content

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.

Allow SSH, HTTPS and only the rConfig services you use (xFTP, SNMP traps on 162/udp).

Terminal window
sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service=ssh --add-service=https
sudo firewall-cmd --reload

Keep SELinux enforcing. rConfig’s install scripts set the labels it needs. Check for denials before you switch from permissive:

Terminal window
sudo ausearch -m avc -ts recent
sudo setenforce 1
sudo sed -i 's/^SELINUX=.*/SELINUX=enforcing/' /etc/selinux/config

Updates (os.auto_updates, os.reboot_required, server.os.security_updates)

Section titled “Updates (os.auto_updates, os.reboot_required, server.os.security_updates)”
Terminal window
sudo dnf install dnf-automatic
# In /etc/dnf/automatic.conf: upgrade_type = security, apply_updates = yes
sudo systemctl enable --now dnf-automatic.timer

Restart PHP-FPM and Horizon after PHP updates, and reboot after kernel updates.

Terminal window
sudo systemctl enable --now chronyd # chrony on Ubuntu
sudo systemctl enable --now auditd
# Watch rConfig's secrets file
echo "-w /var/www/html/rconfig8/.env -p rwa -k rconfig-env" | sudo tee /etc/audit/rules.d/rconfig.rules
sudo augenrules --load

SSH 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 no
PasswordAuthentication no

Then 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).

Terminal window
sudo chmod o-rwx /var/www/html/rconfig8/.env
cd /var/www/html/rconfig8 && sudo php artisan rconfig:set-config-permissions

versions.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.