{
  "id": "CB-UBU-SVC-001",
  "standard": "ubuntu",
  "version": "0.1.1",
  "url": "https://baselines.cirsec.org/b/ubuntu/v0.1.1/CB-UBU-SVC-001",
  "json": "https://baselines.cirsec.org/b/ubuntu/v0.1.1/CB-UBU-SVC-001.json",
  "yaml": "https://baselines.cirsec.org/b/ubuntu/v0.1.1/CB-UBU-SVC-001.yml",
  "profiles_effective": [
    "core",
    "server",
    "server-hardened",
    "desktop",
    "desktop-hardened"
  ],
  "license": "Text CC BY 4.0, code Apache-2.0",
  "attribution": "CIRSEC Baselines, https://baselines.cirsec.org",
  "control": {
    "id": "CB-UBU-SVC-001",
    "title": "Disable DHCP and DNS server services the system does not provide",
    "finding": {
      "title": "DHCP or DNS server services can run on a system that does not provide them",
      "description": "An unneeded DHCP or DNS server answers on the network and can hand out wrong addresses or names."
    },
    "status": "active",
    "profiles": [
      "core"
    ],
    "risk": {
      "severity": "medium"
    },
    "assessment": "automated",
    "tags": [
      "services",
      "dhcp",
      "dns",
      "attack-surface"
    ],
    "description": "Ubuntu packages several network infrastructure servers:\n\n- DHCP: `isc-dhcp-server` (`isc-dhcp-server`, `isc-dhcp-server6`) and Kea (`kea-dhcp4-server`,\n  `kea-dhcp6-server`, `kea-dhcp-ddns-server`);\n- DNS: BIND (`named`);\n- dnsmasq, a combined DNS forwarder and DHCP server (`dnsmasq`).\n\nThe control passes when each unit is masked or not installed at all.\n",
    "rationale": "These daemons answer requests from any host on the network. A rogue or forgotten DHCP or DNS\nserver can redirect clients to an attacker, and every running daemon is code that can be\nexploited remotely.\n",
    "impact": "Masking a unit stops it and prevents it from starting again, even as a dependency. Systems\nwhose role is to provide DHCP or DNS must exclude this control in their tailoring file.\nThe dnsmasq binary used by libvirt or NetworkManager (`dnsmasq-base`) is not affected: only the\nstand-alone `dnsmasq` service is masked.\n",
    "notes": "The check reads `systemctl is-enabled`: a unit that does not exist counts as compliant, so\nremoving the package (`apt purge`) is an equally valid fix. The packages are not installed on\na default Ubuntu install (server, desktop or cloud image).\n",
    "audit": {
      "manual": "For each unit, run `systemctl is-enabled <unit>`. It must print `masked`, or fail because the\nunit does not exist: `isc-dhcp-server.service`, `isc-dhcp-server6.service`,\n`kea-dhcp4-server.service`, `kea-dhcp6-server.service`, `kea-dhcp-ddns-server.service`,\n`named.service`, `dnsmasq.service`.\n",
      "logic": "all",
      "checks": [
        {
          "id": "isc-dhcp-server",
          "engine": "systemd-unit",
          "description": "ISC DHCPv4 server.",
          "spec": {
            "unit": "isc-dhcp-server.service",
            "state": "masked"
          }
        },
        {
          "id": "isc-dhcp-server6",
          "engine": "systemd-unit",
          "description": "ISC DHCPv6 server.",
          "spec": {
            "unit": "isc-dhcp-server6.service",
            "state": "masked"
          }
        },
        {
          "id": "kea-dhcp4",
          "engine": "systemd-unit",
          "description": "Kea DHCPv4 server.",
          "spec": {
            "unit": "kea-dhcp4-server.service",
            "state": "masked"
          }
        },
        {
          "id": "kea-dhcp6",
          "engine": "systemd-unit",
          "description": "Kea DHCPv6 server.",
          "spec": {
            "unit": "kea-dhcp6-server.service",
            "state": "masked"
          }
        },
        {
          "id": "kea-dhcp-ddns",
          "engine": "systemd-unit",
          "description": "Kea dynamic DNS update server.",
          "spec": {
            "unit": "kea-dhcp-ddns-server.service",
            "state": "masked"
          }
        },
        {
          "id": "named",
          "engine": "systemd-unit",
          "description": "BIND DNS server.",
          "spec": {
            "unit": "named.service",
            "state": "masked"
          }
        },
        {
          "id": "dnsmasq",
          "engine": "systemd-unit",
          "description": "dnsmasq DNS and DHCP server.",
          "spec": {
            "unit": "dnsmasq.service",
            "state": "masked"
          }
        }
      ]
    },
    "remediation": {
      "manual": "Stop and mask each unit that is installed: `systemctl mask --now <unit>`. If the package is not\nneeded at all, remove it instead: `apt purge isc-dhcp-server kea-dhcp4-server kea-dhcp6-server\nkea-dhcp-ddns-server bind9 dnsmasq`.\n",
      "effects": {
        "restart": "none",
        "disruption": "low",
        "lockout_risk": false
      },
      "rollback": "Run `systemctl unmask <unit>` then `systemctl enable --now <unit>`.\n",
      "scripts": [
        {
          "id": "isc-dhcp-server",
          "from_check": "isc-dhcp-server"
        },
        {
          "id": "isc-dhcp-server6",
          "from_check": "isc-dhcp-server6"
        },
        {
          "id": "kea-dhcp4",
          "from_check": "kea-dhcp4"
        },
        {
          "id": "kea-dhcp6",
          "from_check": "kea-dhcp6"
        },
        {
          "id": "kea-dhcp-ddns",
          "from_check": "kea-dhcp-ddns"
        },
        {
          "id": "named",
          "from_check": "named"
        },
        {
          "id": "dnsmasq",
          "from_check": "dnsmasq"
        }
      ]
    },
    "references": [
      {
        "title": "systemctl(1), Ubuntu manual pages",
        "url": "https://manpages.ubuntu.com/manpages/noble/man1/systemctl.1.html",
        "publisher": "Canonical",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      },
      {
        "title": "dhcpd(8), Ubuntu manual pages",
        "url": "https://manpages.ubuntu.com/manpages/noble/man8/dhcpd.8.html",
        "publisher": "Canonical",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      },
      {
        "title": "named(8), Ubuntu manual pages",
        "url": "https://manpages.ubuntu.com/manpages/noble/man8/named.8.html",
        "publisher": "Canonical",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      },
      {
        "title": "dnsmasq(8), Ubuntu manual pages",
        "url": "https://manpages.ubuntu.com/manpages/noble/man8/dnsmasq.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 DHCP and DNS servers."
      },
      {
        "framework": "nist-800-53r5",
        "framework_version": "5.1.1",
        "id": "CM-7",
        "relation": "partial"
      }
    ],
    "threats": [
      {
        "framework": "mitre-attack",
        "id": "T1210"
      },
      {
        "framework": "mitre-attack",
        "id": "T1557"
      }
    ],
    "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 isc-dhcp-server, kea-dhcp4-server, bind9 and dnsmasq 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 isc-dhcp-server, kea-dhcp4-server, bind9 and dnsmasq 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 isc-dhcp-server, kea-dhcp4-server, bind9 and dnsmasq 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 isc-dhcp-server, kea-dhcp4-server, bind9 and dnsmasq 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"
  }
}