Description
systemd-journald collects the messages of the kernel, of services and of programs that use
syslog. Its settings live in /etc/systemd/journald.conf and drop-in files in
/etc/systemd/journald.conf.d/. This control requires:
- the
systemd-journaldservice to run; Storage=persistent, so the journal is written to/var/log/journal/and survives reboots;Compress=yes(the default), so large entries are compressed;- an explicit size budget:
SystemMaxUse={{ max_use }}andSystemKeepFree={{ keep_free }}. journald removes the oldest archived files to stay within these limits.
On Debian 12 and 13 the default is Storage=auto and /var/log/journal/ exists, so the journal
is already persistent; the control asks for an explicit setting so that removing the directory
does not silently switch to memory-only logging.
Rationale
Logs are the first source when investigating an incident. A journal kept only in memory is lost at every reboot, which is also what an intruder triggers to erase traces. An explicit size budget makes rotation predictable and keeps the journal from filling the file system.
Impact
Journal files use up to {{ max_use }} on the file system holding /var/log. The oldest entries
are removed when the budget is reached; keep a remote copy (CB-DEB-AUDIT-008) when a longer
history is required.
Setting
| Location | /etc/systemd/journald.conf.d/60-cirsec.conf |
| Default | Storage=auto, Compress=yes, size limits computed from the file system size |
| Recommended | Storage=persistent, Compress=yes, SystemMaxUse={{ max_use }}, SystemKeepFree={{ keep_free }} |
Parameters
| Parameter | Core | Server | Server hardened | Desktop | Desktop hardened | Bounds |
|---|---|---|---|---|---|---|
max_usestring. Maximum disk space used by the persistent journal (journald size syntax, for example 1G or 500M). | 1G | 1G | 1G | 1G | 1G | |
keep_freestring. Disk space journald leaves free on the file system holding /var/log/journal. | 1G | 1G | 1G | 1G | 1G |
The value used is your override (tailoring file), else the profile's, else the one of the profile it extends, else the default. Bounds limit what an override may set.
Audit
- Run
systemctl is-active systemd-journald. It must printactive. - Run
systemd-analyze cat-config systemd/journald.conf. The last value of each setting must beStorage=persistent,Compress=yes(or noCompress=line),SystemMaxUse={{ max_use }}andSystemKeepFree={{ keep_free }}.
Automated: every check must pass. Scanners report each check by its id.
active
State of the systemd-journald service.
script: |
o=$(systemctl is-active systemd-journald 2>/dev/null)
echo "systemd-journald: ${o:-unknown}"
[ "$o" = active ]
storage
Effective Storage= of journald.
script: |
v=$(systemd-analyze cat-config systemd/journald.conf 2>/dev/null | sed -n 's/^[[:space:]]*Storage=//p' | tail -n 1)
echo "Storage=${v:-auto (default)}"
[ "$v" = persistent ]
compress
Effective Compress= of journald.
script: |
v=$(systemd-analyze cat-config systemd/journald.conf 2>/dev/null | sed -n 's/^[[:space:]]*Compress=//p' | tail -n 1)
echo "Compress=${v:-yes (default)}"
case ${v:-yes} in yes | true | on | 1) exit 0 ;; esac
exit 1
size
Effective SystemMaxUse= and SystemKeepFree= of journald.
script: |
c=$(systemd-analyze cat-config systemd/journald.conf 2>/dev/null)
m=$(printf '%s\n' "$c" | sed -n 's/^[[:space:]]*SystemMaxUse=//p' | tail -n 1)
k=$(printf '%s\n' "$c" | sed -n 's/^[[:space:]]*SystemKeepFree=//p' | tail -n 1)
echo "SystemMaxUse=${m:-default} SystemKeepFree=${k:-default}"
[ "$m" = "$CB_MAX_USE" ] && [ "$k" = "$CB_KEEP_FREE" ]
Remediation
- Create
/etc/systemd/journald.conf.d/60-cirsec.confwith:[Journal] Storage=persistent Compress=yes SystemMaxUse={{ max_use }} SystemKeepFree={{ keep_free }} - Run
systemctl restart systemd-journald.
| Restart | service: systemd-journald |
| Disruption | none |
Rollback
Delete /etc/systemd/journald.conf.d/60-cirsec.conf and run systemctl restart systemd-journald.
dropin
f=/etc/systemd/journald.conf.d/60-cirsec.conf
mkdir -p /etc/systemd/journald.conf.d
cb_backup "$f"
printf '%s\n' '# Written by CIRSEC Baselines CB-DEB-AUDIT-001' '[Journal]' 'Storage=persistent' 'Compress=yes' \
"SystemMaxUse=$CB_MAX_USE" "SystemKeepFree=$CB_KEEP_FREE" >"$f"
chmod 644 "$f"
systemctl start systemd-journald
Handwritten code reads parameters from CB_<NAME> environment variables. Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.
References
- journald.conf(5), Debian manual pages Debian, vendor-doc, accessed 2026-10-18
- ANSSI-BP-028 v2.0 - Recommandations de configuration d'un système GNU/Linux (R71) ANSSI, guide, accessed 2026-10-18
Mappings
| Framework | ID | Relation | Note |
|---|---|---|---|
| ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0 | R71 | partial | R71 asks for a logging system; this control covers the local journal. |
| NIST SP 800-53 Rev. 55.1.1 | AU-4 | related | |
| NIST SP 800-53 Rev. 55.1.1 | AU-11 | related |
How this control relates to the other framework's: equivalent, stricter, looser, partial or related.
Threats mitigated
Related controls
- related
CB-DEB-AUDIT-002Forward the journal to rsyslog only when rsyslog is the chosen logger - related
CB-DEB-AUDIT-008Send system logs to a remote log server
People and lifecycle
| Authors |
|
| Verified | 2026-10-18 by Sn0wAlice on 12, Proxmox VM, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64, BIOS boot. Storage and size checks fail on fresh install (Storage=auto); drop-in fixes them, journald restarted; kept after reboot. |
| Verified | 2026-10-18 by Sn0wAlice on 13, Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64, BIOS boot. Storage and size checks fail on fresh install (Storage=auto); drop-in fixes them, journald restarted; kept after reboot. |
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-18, 2026-10-18 |
| Translations | fr |