{
  "id": "CB-UBU-DESK-002",
  "standard": "ubuntu",
  "version": "0.1.1",
  "url": "https://baselines.cirsec.org/b/ubuntu/v0.1.1/CB-UBU-DESK-002",
  "json": "https://baselines.cirsec.org/b/ubuntu/v0.1.1/CB-UBU-DESK-002.json",
  "yaml": "https://baselines.cirsec.org/b/ubuntu/v0.1.1/CB-UBU-DESK-002.yml",
  "profiles_effective": [
    "desktop",
    "desktop-hardened"
  ],
  "license": "Text CC BY 4.0, code Apache-2.0",
  "attribution": "CIRSEC Baselines, https://baselines.cirsec.org",
  "control": {
    "id": "CB-UBU-DESK-002",
    "title": "Show a warning banner and hide the user list on the GDM login screen",
    "finding": {
      "title": "The GDM login screen lists local accounts and shows no warning",
      "description": "Anyone in front of the machine sees valid account names, and users get no notice that access is restricted and monitored."
    },
    "status": "active",
    "profiles": [
      "desktop"
    ],
    "risk": {
      "severity": "medium"
    },
    "assessment": "automated",
    "tags": [
      "gdm",
      "banner",
      "login",
      "dconf"
    ],
    "applicability": {
      "facts": [
        "gdm"
      ]
    },
    "description": "Two settings of the GDM login screen (`org.gnome.login-screen`):\n\n- `banner-message-enable` and `banner-message-text`: show a warning text above the password\n  field;\n- `disable-user-list`: do not list local accounts; users type their login name.\n\nOn Ubuntu, the login screen reads a dconf database that GDM rebuilds at each start from\n`/usr/share/gdm/dconf/`. That directory links `/etc/gdm3/greeter.dconf-defaults`, the file\nwhere the administrator sets these keys.\n",
    "rationale": "A list of accounts gives an attacker with physical or remote display access half of the\ncredentials. A warning banner states that access is restricted and monitored, which supports\nlegal action against intruders in many jurisdictions.\n",
    "impact": "Users type their login name instead of clicking it. The banner appears on every login.\n",
    "notes": "The check reads the database the login screen actually uses\n(`DCONF_PROFILE=gdm dconf read`, with a temporary home so that the GDM account's own user\ndatabase is ignored and no file is created in its home), so it only passes after GDM rebuilt it; the fix runs\n`/usr/share/gdm/generate-config`, which GDM also runs at each start. The check requires a\nnon-empty banner, not a specific text. `/etc/gdm3/greeter.dconf-defaults` is a configuration\nfile managed by ucf: package upgrades merge local changes. The fix runs on every remediation\nand rewrites the three keys.\n",
    "setting": {
      "location": "/etc/gdm3/greeter.dconf-defaults, section [org/gnome/login-screen]",
      "default_value": "No banner, user list shown",
      "recommended_value": "banner-message-enable=true, banner-message-text='{{ banner_text }}', disable-user-list=true"
    },
    "parameters": [
      {
        "name": "banner_text",
        "type": "string",
        "description": "Text of the warning shown on the login screen.",
        "default": "Authorized use only. Activity on this system is monitored and recorded."
      }
    ],
    "audit": {
      "manual": "Run as root:\n```\nDCONF_PROFILE=gdm dconf read /org/gnome/login-screen/banner-message-enable\nDCONF_PROFILE=gdm dconf read /org/gnome/login-screen/banner-message-text\nDCONF_PROFILE=gdm dconf read /org/gnome/login-screen/disable-user-list\n```\nThe first and last must print `true`, the second a non-empty warning text.\n",
      "checks": [
        {
          "id": "banner",
          "engine": "shell",
          "description": "The login screen shows a non-empty warning banner.",
          "facts": [
            "gdm"
          ],
          "spec": {
            "script": "# Temporary HOME: dconf must not create root-owned cache files in GDM's home.\nd=$(mktemp -d) || exit 3\nr() { env -u XDG_CONFIG_HOME HOME=\"$d\" XDG_RUNTIME_DIR=\"$d\" DCONF_PROFILE=gdm dconf read \"/org/gnome/login-screen/$1\" 2>/dev/null; }\ne=$(r banner-message-enable)\nt=$(r banner-message-text)\nrm -rf \"$d\"\necho \"banner-message-enable=${e:-unset} banner-message-text=${t:-unset}\"\n[ \"$e\" = true ] && [ -n \"$t\" ] && [ \"$t\" != \"''\" ]\n"
          }
        },
        {
          "id": "user-list",
          "engine": "shell",
          "description": "The login screen does not list local accounts.",
          "facts": [
            "gdm"
          ],
          "spec": {
            "script": "d=$(mktemp -d) || exit 3\nv=$(env -u XDG_CONFIG_HOME HOME=\"$d\" XDG_RUNTIME_DIR=\"$d\" DCONF_PROFILE=gdm dconf read /org/gnome/login-screen/disable-user-list 2>/dev/null)\nrm -rf \"$d\"\necho \"disable-user-list=${v:-unset}\"\n[ \"$v\" = true ]\n"
          }
        }
      ]
    },
    "remediation": {
      "manual": "1. In `/etc/gdm3/greeter.dconf-defaults`, under the `[org/gnome/login-screen]` section, set:\n   ```\n   banner-message-enable=true\n   banner-message-text='{{ banner_text }}'\n   disable-user-list=true\n   ```\n2. Run `/usr/share/gdm/generate-config` (or restart GDM) to rebuild the login screen database.\n",
      "effects": {
        "restart": "none",
        "disruption": "low",
        "lockout_risk": false
      },
      "rollback": "Remove the three lines from `/etc/gdm3/greeter.dconf-defaults` and run\n`/usr/share/gdm/generate-config`.\n",
      "scripts": [
        {
          "id": "greeter-defaults",
          "engine": "shell",
          "facts": [
            "gdm"
          ],
          "file": "fix.sh"
        }
      ]
    },
    "references": [
      {
        "title": "GNOME System Administration Guide - Display a text banner on the login screen",
        "url": "https://help.gnome.org/admin/system-admin-guide/stable/login-banner.html.en",
        "publisher": "The GNOME Project",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      },
      {
        "title": "GNOME System Administration Guide - Disable the user list",
        "url": "https://help.gnome.org/admin/system-admin-guide/stable/login-userlist-disable.html.en",
        "publisher": "The GNOME Project",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      }
    ],
    "mappings": [
      {
        "framework": "nist-800-53r5",
        "framework_version": "5.1.1",
        "id": "AC-8",
        "relation": "partial",
        "note": "Covers the graphical login screen only; console and SSH banners are separate controls."
      }
    ],
    "threats": [
      {
        "framework": "mitre-attack",
        "id": "T1087.001"
      }
    ],
    "related_controls": [
      {
        "id": "CB-UBU-AUTH-001",
        "type": "related"
      }
    ],
    "authors": [
      {
        "name": "Alice",
        "github": "Sn0wAlice"
      }
    ],
    "verified": [
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "20.04"
        ],
        "environment": "Proxmox VM with Ubuntu Desktop (GNOME 3.36, gdm3), Ubuntu 20.04.6, kernel 5.4.0-216-generic",
        "notes": "Generated check and fix (desktop-hardened) on GDM; greeter database rebuilt by generate-config and read back with DCONF_PROFILE=gdm; banner shown and user list hidden on the login screen (screen capture after reboot); second remediation reported compliant."
      },
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "22.04"
        ],
        "environment": "Proxmox VM with Ubuntu Desktop (GNOME 42, gdm3), Ubuntu 22.04.5, kernel 5.15.0-198-generic",
        "notes": "Generated check and fix (desktop-hardened) on GDM; greeter database rebuilt by generate-config and read back with DCONF_PROFILE=gdm; banner shown and user list hidden on the login screen (screen capture after reboot); second remediation reported compliant."
      },
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "24.04"
        ],
        "environment": "Proxmox VM with Ubuntu Desktop (GNOME 46, gdm3), Ubuntu 24.04.5, kernel 6.8.0-147-generic",
        "notes": "Generated check and fix (desktop-hardened) on GDM; greeter database rebuilt by generate-config and read back with DCONF_PROFILE=gdm; banner shown and user list hidden on the login screen (screen capture after reboot); second remediation reported compliant."
      },
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "26.04"
        ],
        "environment": "Proxmox VM with Ubuntu Desktop (GNOME 50, gdm3), Ubuntu 26.04.1, kernel 7.0.0-38-generic",
        "notes": "Generated check and fix (desktop-hardened) on GDM; greeter database rebuilt by generate-config and read back with DCONF_PROFILE=gdm; banner shown and user list hidden on the login screen (screen capture after reboot); second remediation reported compliant."
      }
    ],
    "introduced_in": "0.1.0",
    "created": "2026-10-19",
    "updated": "2026-10-19"
  }
}