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 (tested on Debian 12 and 13). A rpcbind unit that does not exist
counts as compliant. The NFS client package nfs-common is handled by CB-DEB-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), Debian manual pages Debian, vendor-doc, accessed 2026-10-18
- nfsd(8), Debian manual pages Debian, vendor-doc, accessed 2026-10-18
- systemctl(1), Debian manual pages Debian, vendor-doc, accessed 2026-10-18
- ANSSI-BP-028 v2.0 - Recommandations de configuration d'un système GNU/Linux (R62) ANSSI, guide, accessed 2026-10-18
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-DEB-SVC-027Remove the NFS client utilities when no NFS share is mounted
People and lifecycle
| Authors |
|
| Verified | 2026-10-18 by Sn0wAlice on 12, Proxmox VM, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64. Fresh image passes; with nfs-kernel-server and rpcbind installed, fix purges the NFS server and masks rpcbind, audit passes after reboot. Masking nfs-server.service was rejected: it breaks purge of nfs-kernel-server. |
| Verified | 2026-10-18 by Sn0wAlice on 13, Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64. Fresh image passes; with nfs-kernel-server and rpcbind installed, fix purges the NFS server and masks rpcbind, audit passes after reboot. Masking nfs-server.service was rejected: it breaks purge of nfs-kernel-server. |
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-18, 2026-10-18 |
| Translations | fr |