journald is systemd’s structured log buffer. Out of the box it lives in volatile storage and a user with sudo can rewrite or delete it. For a host that matters in an incident timeline, that is not the configuration you want. This article covers persistent storage, append-only mode, Forward Secure Sealing (FSS) so tampering is detectable, and remote forwarding so the log survives the host.
How to verify
Inspect the journal configuration, the storage mode, and the disk usage:
sudo journalctl --disk-usage
sudo cat /etc/systemd/journald.conf | grep -vE '^#|^$'
sudo ls -la /var/log/journal/ 2>/dev/null
sudo journalctl --verify
sudo systemctl status systemd-journal-upload systemd-journald-audit
journalctl --verify checks the cryptographic chain when FSS is enabled — any tampering with sealed journals breaks the verification.
What’s happening
By default on Debian/Ubuntu the journal lives in /run/log/journal/ (tmpfs, lost on reboot) unless /var/log/journal/ exists. systemd-journald has four storage modes: volatile (only in /run), persistent (write to /var, fall back to /run if /var is unavailable), auto (use /var if the directory exists, otherwise /run), and none (drop everything).
FSS (Forward Secure Sealing) periodically appends a cryptographic seal computed from the previous seal and the new log entries. Any tampering with sealed entries breaks the chain at the next seal. The seal key is generated once on the host and printed for the operator to store off-box — journalctl --verify then validates the chain on demand. FSS does not prevent tampering; it makes it visible.
The strongest guarantee is to ship every entry off the host as it is written. systemd-journal-upload does this over HTTPS to a systemd-journal-remote listener. Once the entry leaves the box, it is on someone else’s disk; rewriting locally no longer hides anything.
The procedure
- Enable persistent storage.
sudo mkdir -p /var/log/journal && sudo systemd-tmpfiles --create --prefix /var/log/journal && sudo systemctl restart systemd-journald. The directory’s existence is what triggers persistence; the config file is optional. - Tune the journal limits in
/etc/systemd/journald.conf.Storage=persistent,Compress=yes,Seal=yes,SystemMaxUse=2G,SystemKeepFree=1G,SystemMaxFileSize=128M,MaxRetentionSec=90day. Reload withsudo systemctl restart systemd-journald— the daemon does not pick up config changes on reload alone. - Generate a seal key.
sudo journalctl --setup-keys --interval=1h. The output is a long alphanumeric string that ends with/PT1H— that string is the verification key. Print it, store it off-host (a vault or a printed safe), andjournalctl --verify --verify-key=<key>later confirms whether any sealed segment was modified. - Restrict who can read the journal. journald respects the
systemd-journalgroup: members read every entry without sudo.getent group systemd-journaland remove anyone who shouldn’t be there. - Add audit log capture.
Audit=yesin journald.conf makes journald subscribe to the kernel audit netlink, so auditd events arrive in the journal too. Useful for one-pane querying; not a substitute for auditd’s own dispatcher when compliance requires plaintext audit logs. - Set up remote forwarding. On the collector: install
systemd-journal-remoteand runsystemd-journal-remote --listen-https=:19532 --output=/var/log/journal/remote/. On the sender: installsystemd-journal-upload, setURL=https://collector.example.com:19532in/etc/systemd/journal-upload.conf, and use client certificates for mutual TLS — never bare HTTP. - Enable and start the uploader.
sudo systemctl enable --now systemd-journal-upload. Verify withsudo systemctl status systemd-journal-uploadand confirm the collector receives entries (journalctl --directory /var/log/journal/remote/). - Schedule a periodic verification. A weekly cron:
journalctl --verify 2>&1 | mail -s "journald verify $(hostname)" sec@example.com. A break in the seal chain is silent unless someone is looking.
Common pitfalls
- A
Storage=persistentsetting without the/var/log/journal/directory falls back to volatile — the config alone is not enough. Always verify the directory exists. journalctl --vacuum-time=30dis operator-friendly but a compromised root user can run the same command and erase forensic evidence. Remote forwarding is what defends against this; local quotas do not.- FSS verification against a wrong key returns “FAIL” with no specific diagnostic — keep the key paired with the host it came from.
- Log entries from a kernel oops can saturate the journal and trigger rotation that loses earlier entries. Set
SystemMaxFilesto limit the number of historical files retained. - The
systemd-journal-uploadservice is a single point of failure — if it stalls, the host queues entries locally until disk fills. Monitor the service and the queue depth (journalctl -u systemd-journal-uploadfor the upload state).
In the engagements we run, journald is configured for persistence, sealed, and forwarded to a remote collector that the host cannot reach for writes — only reads. That separation is part of Managed Operations and is the difference between an investigation that succeeds and one that ends with “the logs are gone.”