# yaml-language-server: $schema=../../../../schema/control.schema.json id: CB-DEB-BOOT-003 title: Restrict the kernel log buffer to privileged users finding: title: Unprivileged users can read the kernel log buffer description: The kernel log can reveal addresses, hardware details and errors useful to an attacker. status: draft profiles: [core] risk: severity: low assessment: automated tags: [kernel, sysctl, information-disclosure] description: | The `kernel.dmesg_restrict` sysctl controls who can read the kernel ring buffer with `dmesg` or `/dev/kmsg`. With `1`, only processes with the `CAP_SYSLOG` capability can read it. rationale: | Kernel messages often contain memory addresses, driver and firmware versions, and traces of failed operations. Reading them helps a local attacker tune a kernel exploit. impact: | Unprivileged users can no longer run `dmesg`. Administrators use `sudo dmesg` or `journalctl -k`, which needs membership of the `adm` or `systemd-journal` group. notes: | Debian kernels are built with this restriction on by default, so the check usually passes on a fresh install. The control guards against it being turned off. setting: location: sysctl `kernel.dmesg_restrict`, persisted in `/etc/sysctl.d/` default_value: "1" recommended_value: "1" audit: manual: | Run `sysctl kernel.dmesg_restrict`. The value must be `1`. Then check that no sysctl configuration file sets it to `0`. checks: - id: running engine: sysctl description: Running value of kernel.dmesg_restrict. spec: { key: kernel.dmesg_restrict, value: 1 } remediation: manual: | Create `/etc/sysctl.d/60-cirsec.conf` containing `kernel.dmesg_restrict = 1`, remove any other assignment of this key, then run `sysctl --system`. effects: restart: none disruption: low lockout_risk: false rollback: | Remove the line from `/etc/sysctl.d/60-cirsec.conf` and run `sysctl -w kernel.dmesg_restrict=0`. scripts: - id: set from_check: running references: - title: Linux kernel documentation - Documentation for /proc/sys/kernel/ (dmesg_restrict) url: https://docs.kernel.org/admin-guide/sysctl/kernel.html publisher: The Linux Kernel Organization kind: vendor-doc accessed: 2026-10-18 - 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-18 mappings: - framework: anssi-linux framework_version: "2.0" id: R9 relation: partial note: R9 lists several kernel settings; this control covers kernel.dmesg_restrict. - framework: nist-800-53r5 framework_version: "5.1.1" id: SI-11 relation: related - framework: cis-debian-12 framework_version: "2.0.0" id: "1.5.5" relation: equivalent - framework: cis-debian-13 framework_version: "1.1.0" id: "1.5.5" relation: equivalent threats: - framework: mitre-attack id: T1082 - framework: cwe id: CWE-200 authors: - name: Alice github: Sn0wAlice verified: - date: 2026-10-18 by: Sn0wAlice versions: ["12"] environment: Proxmox VM, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64 notes: Generated check, fix and check again for profiles core and server-hardened; values kept after reboot; fix idempotent. - date: 2026-10-18 by: Sn0wAlice versions: ["13"] environment: Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64 notes: Generated check, fix and check again for profiles core and server-hardened; values kept after reboot; fix idempotent. introduced_in: 0.1.0 created: 2026-10-18 updated: 2026-10-18