{
  "id": "CB-UBU-SVC-027",
  "standard": "ubuntu",
  "version": "0.1.0",
  "url": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-027",
  "json": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-027.json",
  "yaml": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-027.yml",
  "profiles_effective": [
    "server-hardened"
  ],
  "license": "Text CC BY 4.0, code Apache-2.0",
  "attribution": "CIRSEC Baselines, https://baselines.cirsec.org",
  "control": {
    "id": "CB-UBU-SVC-027",
    "title": "Remove the NFS client utilities when no NFS share is mounted",
    "finding": {
      "title": "NFS client utilities are installed on a system that mounts no NFS share",
      "description": "The NFS client stack adds setuid helpers and RPC daemons that are not needed."
    },
    "status": "active",
    "profiles": [
      "server-hardened"
    ],
    "risk": {
      "severity": "low"
    },
    "assessment": "automated",
    "tags": [
      "packages",
      "nfs",
      "attack-surface"
    ],
    "description": "`nfs-common` provides the NFS client tools: the `mount.nfs` setuid helper, `rpc.statd` (NFSv3\nlocking), `rpc.gssd` and `rpc.idmapd`. It is only needed to mount NFS shares.\n",
    "rationale": "Unneeded software is extra code to patch. `mount.nfs` runs with root privileges, and\n`rpc.statd` listens for RPC requests when it is started.\n",
    "impact": "NFS shares can no longer be mounted. Removing `nfs-common` also removes `nfs-kernel-server` if it\nis installed. Systems that mount NFS shares must exclude this control in their tailoring file.\n",
    "notes": "Not installed on Ubuntu cloud images; often pulled in by full server installs or by `autofs`. The NFS server\nand rpcbind are handled by CB-UBU-SVC-003.\n",
    "audit": {
      "manual": "Run `dpkg-query -W -f='${Status}\\n' nfs-common`. It must not print `install ok installed`.\n",
      "checks": [
        {
          "id": "nfs-common",
          "engine": "package",
          "description": "NFS client utilities.",
          "spec": {
            "name": "nfs-common",
            "state": "absent"
          }
        }
      ]
    },
    "remediation": {
      "manual": "Check that `findmnt -t nfs,nfs4` lists nothing and that no NFS entry remains in `/etc/fstab`,\nthen run `apt purge nfs-common`.\n",
      "effects": {
        "restart": "none",
        "disruption": "low",
        "lockout_risk": false
      },
      "rollback": "Run `apt install nfs-common`.\n",
      "scripts": [
        {
          "id": "nfs-common",
          "from_check": "nfs-common"
        }
      ]
    },
    "references": [
      {
        "title": "nfs(5), Ubuntu manual pages",
        "url": "https://manpages.ubuntu.com/manpages/noble/man5/nfs.5.html",
        "publisher": "Canonical",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      },
      {
        "title": "ANSSI-BP-028 v2.0 - Recommandations de configuration d'un système GNU/Linux (R58)",
        "url": "https://messervices.cyber.gouv.fr/documents-guides/fr_np_linux_configuration-v2.0.pdf",
        "publisher": "ANSSI",
        "kind": "guide",
        "accessed": "2026-10-19"
      }
    ],
    "mappings": [
      {
        "framework": "anssi-linux",
        "framework_version": "2.0",
        "id": "R58",
        "relation": "partial",
        "note": "R58 asks to install only the packages that are strictly needed; this control covers nfs-common."
      },
      {
        "framework": "nist-800-53r5",
        "framework_version": "5.1.1",
        "id": "CM-7",
        "relation": "partial"
      }
    ],
    "threats": [
      {
        "framework": "mitre-attack",
        "id": "T1210"
      }
    ],
    "related_controls": [
      {
        "id": "CB-UBU-SVC-003",
        "type": "related"
      }
    ],
    "authors": [
      {
        "name": "Alice",
        "github": "Sn0wAlice"
      }
    ],
    "verified": [
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "20.04"
        ],
        "environment": "Proxmox VM, Ubuntu 20.04 cloud image, kernel 5.4.0-216-generic",
        "notes": "Stock image passes; with nfs-common installed the check fails, fix purges it (after CB-UBU-SVC-003 removed the NFS server), audit passes after reboot."
      },
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "22.04"
        ],
        "environment": "Proxmox VM, Ubuntu 22.04 cloud image, kernel 5.15.0-198-generic",
        "notes": "Stock image passes; with nfs-common installed the check fails, fix purges it (after CB-UBU-SVC-003 removed the NFS server), audit passes after reboot."
      },
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "24.04"
        ],
        "environment": "Proxmox VM, Ubuntu 24.04 cloud image, kernel 6.8.0-147-generic",
        "notes": "Stock image passes; with nfs-common installed the check fails, fix purges it (after CB-UBU-SVC-003 removed the NFS server), audit passes after reboot."
      },
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "26.04"
        ],
        "environment": "Proxmox VM, Ubuntu 26.04 cloud image, kernel 7.0.0-38-generic",
        "notes": "Stock image passes; with nfs-common installed the check fails, fix purges it (after CB-UBU-SVC-003 removed the NFS server), audit passes after reboot."
      }
    ],
    "introduced_in": "0.1.0",
    "created": "2026-10-19",
    "updated": "2026-10-19"
  }
}