{
  "id": "CB-UBU-BOOT-012",
  "standard": "ubuntu",
  "version": "0.1.0",
  "url": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-BOOT-012",
  "json": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-BOOT-012.json",
  "yaml": "https://baselines.cirsec.org/b/ubuntu/v0.1.0/CB-UBU-BOOT-012.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-BOOT-012",
    "title": "Restrict access to the boot loader configuration",
    "finding": {
      "title": "Users can read the boot loader configuration",
      "description": "The GRUB configuration can hold the boot password hash and reveals the boot parameters of the system."
    },
    "status": "active",
    "profiles": [
      "core"
    ],
    "risk": {
      "severity": "low"
    },
    "assessment": "automated",
    "tags": [
      "grub",
      "boot",
      "permissions"
    ],
    "applicability": {
      "facts": [
        "grub"
      ]
    },
    "description": "`/boot/grub/grub.cfg` is the configuration GRUB reads at boot. It is generated by `update-grub`\nand contains every boot entry, the kernel command lines and, when one is set, the PBKDF2 hash\nof the boot password.\n",
    "rationale": "A readable password hash can be attacked offline. Restricting the file to root also hides the\nboot parameters from local users and stops them from learning which protections are enabled.\n",
    "impact": "None known. GRUB reads the file before the operating system starts.\n",
    "notes": "Ubuntu 24.04 and 26.04 already create the file with mode `0600`; 22.04 ships it `0644` and\n20.04 `0444`. From 22.04 on, `update-grub` keeps the mode of the existing file. On 20.04 it\nreplaces the file and sets `0444` again whenever no GRUB password is configured, which happens\nat every kernel update: there, the restricted mode only lasts with CB-UBU-BOOT-011 applied.\n",
    "setting": {
      "location": "/boot/grub/grub.cfg",
      "default_value": "root:root 0444 (20.04), 0644 (22.04), 0600 (24.04, 26.04)",
      "recommended_value": "root:root, mode 0600 or stricter"
    },
    "audit": {
      "manual": "Run `stat -c '%U:%G %a' /boot/grub/grub.cfg`. It must print `root:root` and a mode of `600` or stricter.\n",
      "checks": [
        {
          "id": "perms",
          "engine": "file-perms",
          "description": "Owner, group and mode of /boot/grub/grub.cfg.",
          "spec": {
            "path": "/boot/grub/grub.cfg",
            "owner": "root",
            "group": "root",
            "mode": "0600"
          }
        }
      ]
    },
    "remediation": {
      "manual": "Run `chown root:root /boot/grub/grub.cfg` and `chmod 600 /boot/grub/grub.cfg`.\n",
      "effects": {
        "restart": "none",
        "disruption": "none",
        "lockout_risk": false
      },
      "rollback": "Run `chmod 644 /boot/grub/grub.cfg`.\n",
      "scripts": [
        {
          "id": "perms",
          "from_check": "perms"
        }
      ]
    },
    "references": [
      {
        "title": "GNU GRUB Manual - Authentication and authorisation",
        "url": "https://www.gnu.org/software/grub/manual/grub/html_node/Authentication-and-authorisation.html",
        "publisher": "GNU Project",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      },
      {
        "title": "ANSSI-BP-028 v2.0 - Recommandations de configuration d'un système GNU/Linux (R29)",
        "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": "R29",
        "relation": "partial",
        "note": "R29 restricts the whole /boot directory; this control covers the GRUB configuration."
      },
      {
        "framework": "nist-800-53r5",
        "framework_version": "5.1.1",
        "id": "AC-3",
        "relation": "related"
      }
    ],
    "threats": [
      {
        "framework": "cwe",
        "id": "CWE-732"
      }
    ],
    "related_controls": [
      {
        "id": "CB-UBU-BOOT-011",
        "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, BIOS boot",
        "notes": "Fails on a fresh install (0444); fix sets 0400; update-grub sets 0444 again without a GRUB password and keeps the mode with one; kept 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, BIOS boot",
        "notes": "Fails on a fresh install (0644); fix sets 0600; mode kept by update-grub 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, BIOS boot",
        "notes": "Passes on a fresh install (0600); mode kept by update-grub."
      },
      {
        "date": "2026-10-19",
        "by": "Sn0wAlice",
        "versions": [
          "26.04"
        ],
        "environment": "Proxmox VM, Ubuntu 26.04 cloud image, kernel 7.0.0-38-generic, BIOS boot",
        "notes": "Passes on a fresh install (0600); mode kept by update-grub."
      }
    ],
    "introduced_in": "0.1.0",
    "created": "2026-10-19",
    "updated": "2026-10-19"
  }
}