{
  "id": "CB-UBU-BOOT-001",
  "standard": "ubuntu",
  "version": "0.1.2",
  "url": "https://baselines.cirsec.org/b/ubuntu/v0.1.2/CB-UBU-BOOT-001",
  "json": "https://baselines.cirsec.org/b/ubuntu/v0.1.2/CB-UBU-BOOT-001.json",
  "yaml": "https://baselines.cirsec.org/b/ubuntu/v0.1.2/CB-UBU-BOOT-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-BOOT-001",
    "title": "Enable full address space layout randomization",
    "finding": {
      "title": "Memory layout of processes is predictable",
      "description": "Without full randomization, an attacker exploiting a memory bug can guess where code and data live."
    },
    "status": "active",
    "profiles": [
      "core"
    ],
    "risk": {
      "severity": "medium"
    },
    "assessment": "automated",
    "tags": [
      "kernel",
      "sysctl",
      "memory"
    ],
    "description": "The `kernel.randomize_va_space` sysctl controls address space layout randomization (ASLR).\nWith the value `2`, the kernel randomizes the positions of the stack, the virtual dynamic\nshared object page, shared memory regions and the data segment (heap) of every process.\n",
    "rationale": "Most memory corruption exploits need to know the address of the code or data they target.\nRandomizing the layout at every execution turns a reliable exploit into a guess, and makes\nreturn-oriented programming much harder.\n",
    "impact": "None known. `2` is the kernel default and the Ubuntu default.\n",
    "notes": "`1` randomizes everything except the heap, `0` disables ASLR. A program that needs ASLR off\nfor debugging can be started with `setarch -R` instead of changing the system setting.\n",
    "setting": {
      "location": "sysctl `kernel.randomize_va_space`, persisted in `/etc/sysctl.d/`",
      "default_value": "2",
      "recommended_value": "2"
    },
    "audit": {
      "manual": "Run `sysctl kernel.randomize_va_space`. The value must be `2`.\nThen check that no file in `/etc/sysctl.conf`, `/etc/sysctl.d/`, `/run/sysctl.d/`\nor `/usr/lib/sysctl.d/` sets it to another value.\n",
      "checks": [
        {
          "id": "running",
          "engine": "sysctl",
          "description": "Running value of kernel.randomize_va_space.",
          "spec": {
            "key": "kernel.randomize_va_space",
            "value": 2
          }
        }
      ]
    },
    "remediation": {
      "manual": "Create `/etc/sysctl.d/60-cirsec.conf` containing `kernel.randomize_va_space = 2`,\nremove any other assignment of this key, then run `sysctl --system`.\n",
      "effects": {
        "restart": "none",
        "disruption": "none",
        "lockout_risk": false
      },
      "rollback": "Remove the line from `/etc/sysctl.d/60-cirsec.conf` and run `sysctl --system`.\n",
      "scripts": [
        {
          "id": "set",
          "from_check": "running"
        }
      ]
    },
    "references": [
      {
        "title": "Ubuntu Security documentation - Address space layout randomization",
        "url": "https://documentation.ubuntu.com/security/security-features/process-memory/aslr/",
        "publisher": "Canonical",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      },
      {
        "title": "Linux kernel documentation - Documentation for /proc/sys/kernel/ (randomize_va_space)",
        "url": "https://docs.kernel.org/admin-guide/sysctl/kernel.html",
        "publisher": "The Linux Kernel Organization",
        "kind": "vendor-doc",
        "accessed": "2026-10-19"
      },
      {
        "title": "ANSSI-BP-028 v2.0 - Recommandations de configuration d'un système GNU/Linux (R9)",
        "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": "R9",
        "relation": "partial",
        "note": "R9 lists several kernel settings; this control covers kernel.randomize_va_space."
      },
      {
        "framework": "nist-800-53r5",
        "framework_version": "5.1.1",
        "id": "SC-30",
        "relation": "related"
      }
    ],
    "threats": [
      {
        "framework": "mitre-attack",
        "id": "T1068"
      },
      {
        "framework": "cwe",
        "id": "CWE-119"
      }
    ],
    "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": "Passes on a fresh install; audit, remediate, audit for core and server-hardened; still passes 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": "Passes on a fresh install; audit, remediate, audit for core and server-hardened; still passes 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; audit, remediate, audit for core and server-hardened; still passes 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, BIOS boot",
        "notes": "Passes on a fresh install; audit, remediate, audit for core and server-hardened; still passes after reboot."
      }
    ],
    "introduced_in": "0.1.0",
    "created": "2026-10-19",
    "updated": "2026-10-19"
  }
}