Red Hat, Rocky, Alma
The commands for AlmaLinux, Rocky Linux, RHEL and Oracle Linux 8 to 10: prerequisites, installer, firewalld, SELinux in enforcing mode, check, upgrade and uninstall.
Quale versione installi
La versione pubblica è una versione di sviluppo, chiamata 0.3.0-dev. Il suo nome non cambia: ogni pubblicazione sostituisce la precedente e un identificativo di build distingue due build. Non esiste ancora una versione stabile: sarà pubblicata solo quando ogni sistema e ogni pacchetto saranno stati testati end to end. I comandi di questa pagina installano quindi dal canale dev. Una versione di sviluppo può contenere difetti: provala su un sito di prova prima di farci affidamento.
At a glance
- AlmaLinux, Rocky Linux, Oracle Linux and RHEL 8, 9 and 10 use the same installer and the same steps. It detects the family in /etc/os-release and refuses a version below 8.
- Keep SELinux enforcing: the installer labels the binaries, configuration, data and logs, labels ports 9443 and 9444 and turns on the httpd_can_network_connect boolean.
- firewalld is the default firewall: open 80 and 443, and port 9443 for your admin network only.
- No subscription is needed for ToutWAF itself, but dnf needs access to BaseOS and AppStream to install the prerequisites; on an isolated host, use the offline procedure.
The commands, step by step
Aggiorna il sistema e installa i prerequisiti
sudo dnf -y update
sudo dnf -y install curl tar ca-certificates firewalld policycoreutils-python-utilsInstalla con l'installer in una riga
Lo script scarica i binari nativi per la tua architettura, crea un utente dedicato senza privilegi e installa i servizi systemd rafforzati toutwaf-dp (data plane, porte 80 e 443) e toutwaf-cp (control plane e console, porta 9443), poi mostra le informazioni per il primo accesso.
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bashPreferisci leggere prima lo script?
Scaricalo, controllalo, poi eseguilo. Consigliato per i server di produzione.
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh -o install.sh
less install.sh
sudo bash install.shOpzioni dell'installer
Una nuova installazione risiede in un'unica cartella, /var/toutwaf (bin, conf, data e logs; cambiala con --home DIR o TOUTWAF_HOME), e gli strumenti da riga di comando sono collegati in /usr/local/bin. Un'installazione precedente mantiene i propri percorsi (/etc/toutwaf, /var/lib/toutwaf) e non viene mai spostata.
# only let your admin network reach the console (port 9443)
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --console-from 203.0.113.0/24
# do not touch the host firewall / choose the installation home
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --no-firewall
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --home /opt/toutwaf
# name the channel explicitly (the installer of the dev branch already takes the dev channel; no stable version exists yet)
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --channel devApri il firewall
L'installer apre queste porte per impostazione predefinita quando firewalld o ufw è attivo: 80 e 443, e la porta 9443 della console (limitala alla tua rete di amministrazione con --console-from). La porta 9444 degli agent non viene mai aperta al pubblico. Questi comandi servono solo con --no-firewall, con un altro firewall o per farlo a mano.
sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.0/24" port port="9443" protocol="tcp" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-allSELinux
Mantieni SELinux in modalità enforcing. Etichetta le directory di ToutWAF e verifica che non venga registrato alcun rifiuto AVC.
getenforce
sudo restorecon -Rv /var/toutwaf
sudo ausearch -m avc -ts recentGestisci i servizi
Entrambi i servizi si avviano al boot. Usa questi comandi per avviarli, fermarli o riavviarli.
sudo systemctl enable --now toutwaf-cp toutwaf-dp
sudo systemctl restart toutwaf-cp toutwaf-dp
sudo systemctl stop toutwaf-dp toutwaf-cpVerifica i servizi
sudo systemctl status toutwaf-cp toutwaf-dp --no-pager
toutwafctl doctor
curl -kI https://127.0.0.1:9443/
curl -s http://127.0.0.1:9101/healthz
sudo journalctl -u toutwaf-dp -u toutwaf-cp -n 50 --no-pagerAggiorna
Fai il backup della configurazione e dei dati, poi riesegui l'installer: mantiene le tue impostazioni e torna indietro da solo se la nuova versione non diventa sana. I percorsi mostrati sono quelli di una nuova installazione (/var/toutwaf); un'installazione precedente mantiene /etc/toutwaf e /var/lib/toutwaf. Puoi anche aggiornare dalla console, nella pagina Aggiornamenti.
sudo mkdir -p /var/toutwaf.bak
sudo cp -a /var/toutwaf/conf /var/toutwaf/data /var/toutwaf.bak/
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --update --yes
curl -s http://127.0.0.1:9101/healthzDisinstalla
Il primo blocco rimuove i servizi, i binari e le regole del firewall aggiunte da ToutWAF, e conserva i tuoi dati. Il secondo elimina anche configurazione, dati e log.
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh -o install.sh
sudo bash install.sh --uninstallsudo bash install.sh --uninstall --purgeWhat is not verified
We prefer to say it plainly.
- “Tested” means the full installation passed in a container with systemd; real SELinux enforcement was not exercised, and RHEL was validated on Red Hat UBI images.
- No stable version exists yet: the public version is the development version 0.3.0-dev.