{
  "id": "CB-UBU-SVC-021",
  "standard": "ubuntu",
  "version": "0.1.0",
  "url": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-021",
  "json": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-021.json",
  "yaml": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-021.yml",
  "profiles_effective": [
    "server",
    "server-hardened",
    "desktop-hardened"
  ],
  "license": "Text CC BY 4.0, code Apache-2.0",
  "attribution": "CIRSEC Baselines, https://baselines.cirsec.org",
  "control": {
    "id": "CB-UBU-SVC-021",
    "title": "Disable the autofs automounter",
    "finding": {
      "title": "The autofs automounter can mount file systems on demand",
      "description": "Removable media or network shares get mounted whenever someone accesses a path."
    },
    "status": "active",
    "profiles": [
      "server",
      "desktop-hardened"
    ],
    "risk": {
      "severity": "medium"
    },
    "assessment": "automated",
    "tags": [
      "services",
      "autofs",
      "removable-media"
    ],
    "description": "`autofs` mounts file systems (local devices, NFS or SMB shares) when a path under its maps is\naccessed, and unmounts them when idle.\n\nThe control passes when `autofs.service` is masked or not installed at all.\n",
    "rationale": "Automatic mounting of removable media lets anyone with physical access bring in files or\nmalicious file system images; automatic network mounts reach shares that the administrator may\nnot expect.\n",
    "impact": "File systems listed in the autofs maps are no longer mounted on demand: mount them through\n`/etc/fstab` instead. Systems that rely on autofs, such as home directories on NFS, must exclude\nthis control in their tailoring file.\n",
    "notes": "The control is in the server profile and in the hardened desktop profile: on standard\ndesktops, on-demand mounts are an expected feature.\n",
    "audit": {
      "manual": "Run `systemctl is-enabled autofs.service`. It must print `masked`, or fail because the unit does\nnot exist.\n",
      "checks": [
        {
          "id": "autofs",
          "engine": "systemd-unit",
          "description": "autofs automounter.",
          "spec": {
            "unit": "autofs.service",
            "state": "masked"
          }
        }
      ]
    },
    "remediation": {
      "manual": "Run `systemctl mask --now autofs.service`, or `apt purge autofs` if the package is not needed.\n",
      "effects": {
        "restart": "none",
        "disruption": "low",
        "lockout_risk": false
      },
      "rollback": "Run `systemctl unmask autofs.service` then `systemctl enable --now autofs.service`.\n",
      "scripts": [
        {
          "id": "autofs",
          "from_check": "autofs"
        }
      ]
    },
    "references": [
      {
        "title": "autofs(8), Ubuntu manual pages",
        "url": "https://manpages.ubuntu.com/manpages/noble/man8/autofs.8.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 (R62)",
        "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": "R62",
        "relation": "partial",
        "note": "R62 asks to disable every unneeded service; this control covers autofs."
      },
      {
        "framework": "nist-800-53r5",
        "framework_version": "5.1.1",
        "id": "CM-7",
        "relation": "partial"
      },
      {
        "framework": "nist-800-53r5",
        "framework_version": "5.1.1",
        "id": "MP-7",
        "relation": "related"
      }
    ],
    "threats": [
      {
        "framework": "mitre-attack",
        "id": "T1091"
      },
      {
        "framework": "mitre-attack",
        "id": "T1200"
      }
    ],
    "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 (units absent); with autofs installed the check fails, server-hardened remediation masks the units, audit passes, unchanged on a second run and 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 (units absent); with autofs installed the check fails, server-hardened remediation masks the units, audit passes, unchanged on a second run and 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 (units absent); with autofs installed the check fails, server-hardened remediation masks the units, audit passes, unchanged on a second run and 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 (units absent); with autofs installed the check fails, server-hardened remediation masks the units, audit passes, unchanged on a second run and after reboot."
      }
    ],
    "introduced_in": "0.1.0",
    "created": "2026-10-19",
    "updated": "2026-10-19"
  }
}