This example considers the installation of “Uncomplicated Firewall” with the following rules:
- Disallow incoming connections
- Disallow outgoing connections
- Exceptionally allowing inccoming connections for SSH
- Exceptionally allowing outgoing connections for server update (Gentoo)
- Exceptionally allowing outgoing connections for an external private docker registry
sudo ufw enable
sudo ufw logging off
sudo ufw allow ssh
sudo ufw default deny outgoing
suod ufw default deny incoming
sudo ufw allow dns
sudo ufw allow out http
sudo ufw allow out https