Hi all,
So I would like to share a recent experience concerning security and firewall, firewalld has been around for a while and honestly IMO its so much better than plain iptables I don’t know how come its not enabled by default.
Anyway in regard to Rockstor I have 1 ethernet card which has 1public IP and on it also a vlan which is connected to a private switch and through which our systems communicate.
As one of the servers is sitting in Germany they have this thing of an AbuseBSI bureau that scans constantly for open-services and you get a warning via your provider that your server has some open ports.
In this case was rpc services on port 111/udp, and our Rockstor servers are only serving nfs shares.
So to fix this, and secure your server, I proceeded with enabling firewalld. I am making this post because I searched about the subject but I didn’t see any post that was precise and about this subject specifically, or if there is I haven’t find it.
Anyway, firewalld is installed by default, but inactive.
So if you have a similar configuration, or any other with multiple interfaces, one thing you’ll want to do first is to define which zone an interface belongs to.
I could add the interface to the “trusted” zone which would accept all, but instead I’ve added it to the internal zone and added allowed services to this zone.
So the commands were:
# nmcli connection modify "connection name" connection.zone "zone name"
nmcli con mod vlan110 connection.zone internal
systemctl start firewalld
firewall-cmd --zone=internal --add-service={rpc-bind,nfs3,mountd}
If all went well, everything should be working. Depending on which connection you use to access the GUI, you’ll also need to add services http and https.
If something is failing you can easily stop firewalld with systemctl stop firewalld
, but I suppose that all should go well.
After testing that is working, you’ll only need two more commands, one to put the current rules on the permanent config, and enabling firewalld to always run on boot:
firewall-cmd --runtime-to-permanent
systemctl enable firewalld