# yaml-language-server: $schema=../../../../schema/control.schema.json id: CB-DEB-AUDIT-002 title: Forward the journal to rsyslog only when rsyslog is the chosen logger finding: title: The journal forwarding setting does not match the logging system in use description: Messages are either sent to a syslog daemon that does not exist, or not given to the rsyslog daemon that is supposed to store and forward them. status: active profiles: [core] risk: severity: low assessment: automated tags: [journald, rsyslog, logging] description: | A Debian system should use one logging system: the systemd journal alone, or the journal feeding rsyslog, which then writes text files and forwards messages. The journald setting `ForwardToSyslog=` decides whether each message is also handed to a syslog daemon. - When the `rsyslog` package is installed, `ForwardToSyslog=yes` is required, so that rsyslog receives every message. - When it is not installed, `ForwardToSyslog=no` is required, since nothing reads the forwarded messages. rationale: | A mismatch either loses messages in the files and remote copies managed by rsyslog, or wastes resources on a socket nobody reads. Choosing one system keeps the log pipeline simple to review. impact: | None known. The journal keeps every message in both cases. notes: | Debian 13 ships `/usr/lib/systemd/journald.conf.d/syslog.conf` with `ForwardToSyslog=yes`, even when no syslog daemon is installed. The fix writes `/etc/systemd/journald.conf.d/syslog.conf`, which replaces that vendor file. On Debian 12 the default is `no`. setting: location: /etc/systemd/journald.conf.d/syslog.conf default_value: "Debian 12: no; Debian 13: yes" recommended_value: yes when rsyslog is installed, no otherwise audit: manual: | 1. Run `dpkg-query -W -f='${Status}\n' rsyslog` to know whether rsyslog is installed. 2. Run `systemd-analyze cat-config systemd/journald.conf`. The last `ForwardToSyslog=` must be `yes` if rsyslog is installed, and `no` (or absent) otherwise. checks: - id: forward engine: shell description: Effective ForwardToSyslog= compared with the presence of rsyslog. spec: script: | v=$(systemd-analyze cat-config systemd/journald.conf 2>/dev/null | sed -n 's/^[[:space:]]*ForwardToSyslog=//p' | tail -n 1) case ${v:-no} in yes | true | on | 1) v=yes ;; *) v=no ;; esac case $(dpkg-query -W -f='${Status}' rsyslog 2>/dev/null) in *' installed') want=yes ;; *) want=no ;; esac echo "ForwardToSyslog=$v, expected $want" [ "$v" = "$want" ] remediation: manual: | Create `/etc/systemd/journald.conf.d/syslog.conf` with `[Journal]` and `ForwardToSyslog=yes` if rsyslog is installed, `ForwardToSyslog=no` otherwise, then run `systemctl restart systemd-journald`. effects: restart: service services: [systemd-journald] disruption: none lockout_risk: false rollback: | Delete `/etc/systemd/journald.conf.d/syslog.conf` and run `systemctl restart systemd-journald`. scripts: - id: dropin engine: shell content: | case $(dpkg-query -W -f='${Status}' rsyslog 2>/dev/null) in *' installed') v=yes ;; *) v=no ;; esac f=/etc/systemd/journald.conf.d/syslog.conf mkdir -p /etc/systemd/journald.conf.d cb_backup "$f" printf '%s\n' '# Written by CIRSEC Baselines CB-DEB-AUDIT-002' '[Journal]' "ForwardToSyslog=$v" >"$f" chmod 644 "$f" references: - title: journald.conf(5), Debian manual pages url: https://manpages.debian.org/trixie/systemd/journald.conf.5.en.html publisher: Debian kind: vendor-doc accessed: 2026-10-18 - title: rsyslogd(8), Debian manual pages url: https://manpages.debian.org/trixie/rsyslog/rsyslogd.8.en.html publisher: Debian kind: vendor-doc accessed: 2026-10-18 mappings: - framework: anssi-linux framework_version: "2.0" id: R71 relation: related - framework: nist-800-53r5 framework_version: "5.1.1" id: AU-6(4) relation: related - framework: cis-debian-12 framework_version: "2.0.0" id: "6.1.1.1.3" relation: stricter note: Ours also turns forwarding off when rsyslog is absent. - framework: cis-debian-13 framework_version: "1.1.0" id: "6.1.1.1.3" relation: stricter note: Ours also turns forwarding off when rsyslog is absent. threats: - framework: cwe id: CWE-778 related_controls: - id: CB-DEB-AUDIT-001 type: related - id: CB-DEB-AUDIT-005 type: related 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, BIOS boot notes: "Passes on fresh install (no rsyslog, default no); after installing rsyslog fails, fix writes ForwardToSyslog=yes and passes." - date: 2026-10-18 by: Sn0wAlice versions: ["13"] environment: Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64, BIOS boot notes: "Fails on fresh install (vendor syslog.conf sets yes without rsyslog); fix masks it with no; with rsyslog installed the fix sets yes." introduced_in: 0.1.0 created: 2026-10-18 updated: 2026-10-18