Description
The NFS server (package nfs-kernel-server) exports local directories over NFS.
rpcbind maps ONC RPC program numbers to ports; it listens on port 111 through
rpcbind.socket and rpcbind.service, and is needed by NFSv3 and NIS.
The control requires nfs-kernel-server to be absent, and the rpcbind units to be masked or not
installed at all.
The NFS server is removed rather than masked: its maintainer scripts manage the unit through
the nfs-kernel-server.service alias, and with nfs-server.service masked, removing or
upgrading the package fails. A rpcbind unit that does not exist
counts as compliant. The NFS client package nfs-common is handled by CB-UBU-SVC-027 in the
hardened server profile.
Rationale
NFS trusts client addresses and user IDs, so a misconfigured export gives remote access to files. rpcbind tells any host which RPC services run, and has been abused for traffic amplification and remote code execution.
Impact
Removing the NFS server stops every export. Masking rpcbind breaks NFSv3 client mounts and file locking (rpc.statd) and NIS. NFSv4
mounts do not need it. NFS servers, and clients that still mount NFSv3 shares, must exclude this
control in their tailoring file.
Audit
dpkg-query -W -f='${Status}\n' nfs-kernel-servermust not printinstall ok installed.systemctl is-enabled rpcbind.service rpcbind.socketmust printmasked, or fail because the units do not exist.
Automated: every check must pass. Scanners report each check by its id.
nfs-server
NFS kernel server package.
name: nfs-kernel-server
state: absent
rpcbind
rpcbind service.
unit: rpcbind.service
state: masked
rpcbind-socket
rpcbind socket activation.
unit: rpcbind.socket
state: masked
Remediation
Run apt purge nfs-kernel-server, then systemctl mask --now rpcbind.socket rpcbind.service
(or apt purge rpcbind if nothing depends on it).
| Restart | none |
| Disruption | low |
Rollback
Run systemctl unmask rpcbind.socket rpcbind.service, systemctl enable --now rpcbind.socket,
and reinstall the NFS server with apt install nfs-kernel-server.
nfs-server
Generated from check nfs-server: the engine writes the fix for every output, it sets the expected value and the check runs again after.
rpcbind-socket
Generated from check rpcbind-socket: the engine writes the fix for every output, it sets the expected value and the check runs again after.
rpcbind
Generated from check rpcbind: the engine writes the fix for every output, it sets the expected value and the check runs again after.
Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.
References
- rpcbind(8), Ubuntu manual pages Canonical, vendor-doc, accessed 2026-10-19
- nfsd(8), Ubuntu manual pages Canonical, vendor-doc, accessed 2026-10-19
- systemctl(1), Ubuntu manual pages Canonical, vendor-doc, accessed 2026-10-19
- ANSSI-BP-028 v2.0 - Recommandations de configuration d'un système GNU/Linux (R62) ANSSI, guide, accessed 2026-10-19
Mappings
| Framework | ID | Relation | Note |
|---|---|---|---|
| ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0 | R62 | partial | R62 asks to disable every unneeded service; this control covers the NFS server and rpcbind. |
| NIST SP 800-53 Rev. 55.1.1 | CM-7 | partial |
How this control relates to the other framework's: equivalent, stricter, looser, partial or related.
Threats mitigated
| Taxonomy | ID |
|---|---|
| MITRE ATT&CK | T1210 |
| MITRE ATT&CK | T1046 |
Related controls
- related
CB-UBU-SVC-027Remove the NFS client utilities when no NFS share is mounted
People and lifecycle
| Authors |
|
| Verified | 2026-10-19 by Sn0wAlice on 20.04, Proxmox VM, Ubuntu 20.04 cloud image, kernel 5.4.0-216-generic. Stock image passes; with nfs-kernel-server installed the checks fail, fix purges the server and masks rpcbind, audit passes, unchanged on a second run and after reboot. |
| Verified | 2026-10-19 by Sn0wAlice on 22.04, Proxmox VM, Ubuntu 22.04 cloud image, kernel 5.15.0-198-generic. Stock image passes; with nfs-kernel-server installed the checks fail, fix purges the server and masks rpcbind, audit passes, unchanged on a second run and after reboot. |
| Verified | 2026-10-19 by Sn0wAlice on 24.04, Proxmox VM, Ubuntu 24.04 cloud image, kernel 6.8.0-147-generic. Stock image passes; with nfs-kernel-server installed the checks fail, fix purges the server and masks rpcbind, audit passes, unchanged on a second run and after reboot. |
| Verified | 2026-10-19 by Sn0wAlice on 26.04, Proxmox VM, Ubuntu 26.04 cloud image, kernel 7.0.0-38-generic. Stock image passes; with nfs-kernel-server installed the checks fail, fix purges the server and masks rpcbind, audit passes, unchanged on a second run and after reboot. |
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-19, 2026-10-19 |
| Translations | fr |