{
  "id": "CB-UBU-SVC-007",
  "standard": "ubuntu",
  "version": "0.1.0",
  "url": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-007",
  "json": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-007.json",
  "yaml": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-SVC-007.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-007",
    "title": "Remove telnet, rsh and talk servers and disable inetd super-servers",
    "finding": {
      "title": "Clear-text remote access servers or an inetd super-server are present",
      "description": "telnet and rsh send passwords and whole sessions in clear text; inetd starts such servers on demand."
    },
    "status": "active",
    "profiles": [
      "core"
    ],
    "risk": {
      "severity": "high"
    },
    "assessment": "automated",
    "tags": [
      "services",
      "telnet",
      "rsh",
      "talk",
      "inetd",
      "attack-surface"
    ],
    "description": "The historical remote access servers are started by an inetd super-server, not by systemd units\nof their own:\n\n- telnet servers: `telnetd`, `inetutils-telnetd`, `telnetd-ssl`;\n- rsh, rlogin and rexec servers: `rsh-server`, `rsh-redone-server` (up to 24.04);\n- talk servers: `talkd`, `inetutils-talkd`.\n\nThe control requires these packages to be absent, and the super-servers that would launch them\n(`xinetd.service`, `inetd.service` from `openbsd-inetd`, `inetutils-inetd.service`) to be masked\nor not installed.\n",
    "rationale": "telnet and rsh carry passwords and every keystroke in clear text, and rsh trusts the client's\naddress and user name. SSH replaces all of them. A super-server accepts connections for every\nservice listed in its configuration, which makes it easy to expose one by mistake.\n",
    "impact": "Removes the listed server packages. Masking an inetd super-server stops every service it\nlaunches; check `/etc/inetd.conf` and `/etc/xinetd.d/` before applying.\n",
    "notes": "`telnetd` is a transitional package that pulls in `inetutils-telnetd`; both are checked. SSH\naccess is not affected.\n",
    "audit": {
      "manual": "1. `dpkg-query -W -f='${Status}\\n' telnetd inetutils-telnetd telnetd-ssl rsh-server\n   rsh-redone-server talkd inetutils-talkd` must not show any `install ok installed`.\n2. `systemctl is-enabled xinetd.service inetd.service inetutils-inetd.service` must print\n   `masked` or fail because the unit does not exist.\n",
      "logic": "all",
      "checks": [
        {
          "id": "telnetd",
          "engine": "package",
          "description": "telnetd transitional package.",
          "spec": {
            "name": "telnetd",
            "state": "absent"
          }
        },
        {
          "id": "inetutils-telnetd",
          "engine": "package",
          "description": "GNU inetutils telnet server.",
          "spec": {
            "name": "inetutils-telnetd",
            "state": "absent"
          }
        },
        {
          "id": "telnetd-ssl",
          "engine": "package",
          "description": "telnet server with SSL.",
          "spec": {
            "name": "telnetd-ssl",
            "state": "absent"
          }
        },
        {
          "id": "rsh-server",
          "engine": "package",
          "description": "rsh, rlogin and rexec servers.",
          "spec": {
            "name": "rsh-server",
            "state": "absent"
          }
        },
        {
          "id": "rsh-redone-server",
          "engine": "package",
          "description": "rsh-redone rsh and rlogin servers.",
          "spec": {
            "name": "rsh-redone-server",
            "state": "absent"
          }
        },
        {
          "id": "talkd",
          "engine": "package",
          "description": "talk server.",
          "spec": {
            "name": "talkd",
            "state": "absent"
          }
        },
        {
          "id": "inetutils-talkd",
          "engine": "package",
          "description": "GNU inetutils talk server.",
          "spec": {
            "name": "inetutils-talkd",
            "state": "absent"
          }
        },
        {
          "id": "xinetd",
          "engine": "systemd-unit",
          "description": "xinetd super-server.",
          "spec": {
            "unit": "xinetd.service",
            "state": "masked"
          }
        },
        {
          "id": "openbsd-inetd",
          "engine": "systemd-unit",
          "description": "OpenBSD inetd super-server.",
          "spec": {
            "unit": "inetd.service",
            "state": "masked"
          }
        },
        {
          "id": "inetutils-inetd",
          "engine": "systemd-unit",
          "description": "GNU inetutils inetd super-server.",
          "spec": {
            "unit": "inetutils-inetd.service",
            "state": "masked"
          }
        }
      ]
    },
    "remediation": {
      "manual": "1. Run `apt purge telnetd inetutils-telnetd telnetd-ssl rsh-server rsh-redone-server talkd\n   inetutils-talkd`.\n2. Run `systemctl mask --now <unit>` for each installed super-server, or remove its package\n   (`apt purge xinetd openbsd-inetd inetutils-inetd`) when nothing else depends on it.\n",
      "effects": {
        "restart": "none",
        "disruption": "low",
        "lockout_risk": false
      },
      "rollback": "Reinstall the needed package with `apt install`, and `systemctl unmask` the super-server.\n",
      "scripts": [
        {
          "id": "telnetd",
          "from_check": "telnetd"
        },
        {
          "id": "inetutils-telnetd",
          "from_check": "inetutils-telnetd"
        },
        {
          "id": "telnetd-ssl",
          "from_check": "telnetd-ssl"
        },
        {
          "id": "rsh-server",
          "from_check": "rsh-server"
        },
        {
          "id": "rsh-redone-server",
          "from_check": "rsh-redone-server"
        },
        {
          "id": "talkd",
          "from_check": "talkd"
        },
        {
          "id": "inetutils-talkd",
          "from_check": "inetutils-talkd"
        },
        {
          "id": "xinetd",
          "from_check": "xinetd"
        },
        {
          "id": "openbsd-inetd",
          "from_check": "openbsd-inetd"
        },
        {
          "id": "inetutils-inetd",
          "from_check": "inetutils-inetd"
        }
      ]
    },
    "references": [
      {
        "title": "telnetd(8), Ubuntu manual pages",
        "url": "https://manpages.ubuntu.com/manpages/noble/man8/telnetd.8.html",
        "publisher": "Canonical",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      },
      {
        "title": "inetd(8), Ubuntu manual pages",
        "url": "https://manpages.ubuntu.com/manpages/noble/man8/inetd.8.html",
        "publisher": "Canonical",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      },
      {
        "title": "xinetd(8), Ubuntu manual pages",
        "url": "https://manpages.ubuntu.com/manpages/noble/man8/xinetd.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 and names telnet, rsh and inetd; this control covers them."
      },
      {
        "framework": "nist-800-53r5",
        "framework_version": "5.1.1",
        "id": "CM-7",
        "relation": "partial"
      },
      {
        "framework": "nist-800-53r5",
        "framework_version": "5.1.1",
        "id": "SC-8",
        "relation": "related"
      }
    ],
    "threats": [
      {
        "framework": "mitre-attack",
        "id": "T1040"
      },
      {
        "framework": "mitre-attack",
        "id": "T1021"
      },
      {
        "framework": "cwe",
        "id": "CWE-319"
      }
    ],
    "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 inetutils-telnetd, rsh-redone-server, talkd and openbsd-inetd installed the checks fail, fix purges the servers and masks inetd, 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; with inetutils-telnetd, rsh-redone-server, talkd and openbsd-inetd installed the checks fail, fix purges the servers and masks inetd, 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; with inetutils-telnetd, rsh-redone-server, talkd, openbsd-inetd and xinetd installed the checks fail, fix purges the servers and masks both super-servers, 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; with inetutils-telnetd, talkd and openbsd-inetd installed the checks fail, fix purges the servers and masks inetd, audit passes, unchanged on a second run and after reboot."
      }
    ],
    "introduced_in": "0.1.0",
    "created": "2026-10-19",
    "updated": "2026-10-19"
  }
}