Secure the rpcbind service
You can secure rpcbind by restricting access to all networks and defining specific exceptions by using firewall rules on the server.
Before you begin
- The
rpcbindpackage is installed. - The
firewalldpackage is installed and the service is running.
About this task
The rpcbind service is a dynamic port-assignment daemon for remote procedure calls (RPC) services such as Network Information Service (NIS) and Network File System (NFS). Because it has weak authentication mechanisms and can assign a wide range of ports for the services it controls, secure rpcbind.
- The
rpcbindservice is required onNFSv3servers. - The
rpcbindservice is not required onNFSv4.
Procedure
Results
- List the firewall rules:
# firewall-cmd --list-rich-rulerule family="ipv4" port port="111" protocol="tcp" source address="192.168.0.0/24" invert="True" drop rule family="ipv4" port port="111" protocol="tcp" source address="127.0.0.1" accept rule family="ipv4" port port="111" protocol="udp" source address="192.168.0.0/24" invert="True" drop
- If NFS clients cannot connect after applying the firewall rules, verify that the client IP addresses are within the allowed subnet:
# firewall-cmd --list-allCheck that the rich rules allow the client’s source address.
- If clients from the allowed subnet still cannot connect, verify that the
rpcbindservice is running:# systemctl status rpcbind - If firewall changes are not taking effect, verify that the rules were made permanent:
# firewall-cmd --permanent --list-rich-rulesIf the rules are missing, re-add them with the
--permanentoption and reload the firewall. - If you added rules without
--permanentand then reloaded, the rules are lost. Use--runtime-to-permanentto save current runtime rules:# firewall-cmd --runtime-to-permanent