Description of problem: The journalctl option "--no-hostname" removes most instances of the hostname from the output, but not all of them. If the "--no-hostname" option is intended to protect confidential information in a user's hostname, the output should not contain the hostname anywhere. This is a security concern for people who are asked to attach logs to bug reports. If the intent of the "--no-hostname" option is simply to make the output more concise, then the journalctl man page should clearly state that the option does not remove all instances of the hostname from the output. In which case, this bug may be converted to a documentation bug. Version-Release number of selected component (if applicable): systemd-245.3-1.fc32.x86_64 How reproducible: Always. Steps to Reproduce: $ hostname f32-efi-test $ journalctl -b --no-hostname | grep 'f32-efi-test' | grep -v 'audit' Mar 31 16:07:08 systemd[1]: Set hostname to <f32-efi-test>. Mar 31 16:07:15 systemd[1]: Set hostname to <f32-efi-test>. Mar 31 16:07:22 avahi-daemon[762]: Server startup complete. Host name is f32-efi-test.local. Local service cookie is 80927380. Mar 31 16:07:24 NetworkManager[821]: <info> [1585670844.1846] hostname: hostname changed from (none) to "f32-efi-test" For brevity, I have removed the audit records that also have the hostname. Actual results: The hostname appears in the output. Expected results: The hostname is removed from the output. This: Mar 31 16:07:08 systemd[1]: Set hostname to <f32-efi-test>. Is changed to this: Mar 31 16:07:08 systemd[1]: Set hostname to <removed>. Additional info: The template for reporting new kernel bugs explicitly cites the "--no-hostname" option: 7. Please attach the kernel logs. You can get the complete kernel log for a boot with ``journalctl --no-hostname -k > dmesg.txt``. If the issue occurred on a previous boot, use the journalctl ``-b`` flag.
There is a complication when the hostname changes: $ journalctl -b -31 --no-hostname -q --full --no-pager -g 'hostname changed' Mar 27 12:08:13 NetworkManager[705]: <info> [1585336093.8611] hostname: hostname changed from (none) to "f31-f32-test" Mar 27 12:12:37 NetworkManager[705]: <info> [1585336357.4614] hostname: hostname changed from "f31-f32-test" to "f32-test" That leaks both the old hostname and the new hostname. I'm changing this to a documentation bug ...
For kernel bugs, the "-k" option is always specified, in which case, the NetworkManager records are not in the output: $ journalctl -b -31 -k --no-hostname -q --full --no-pager -g 'hostname changed' $ So we are left with two records from systemd: $ journalctl -b -31 -k --no-hostname -q --full --no-pager -g 'f32-test' Mar 27 12:08:03 systemd[1]: Set hostname to <f31-f32-test>. Mar 27 12:08:08 systemd[1]: Set hostname to <f31-f32-test>.
> If the "--no-hostname" option is intended to protect confidential information in a user's hostname No, not at all. The option simply removes the "column" with the hostname. It is intended to save space. No effort whatsoever is made to remove the hostname or other information from the log contents. I'll add a note to the docs.
https://github.com/systemd/systemd/pull/15290
(In reply to Zbigniew Jędrzejewski-Szmek from comment #4) > https://github.com/systemd/systemd/pull/15290 Thanks. However: occurences -> occurrences
FEDORA-2020-dd43dd05b1 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-dd43dd05b1
FEDORA-2020-dd43dd05b1 has been pushed to the Fedora 32 testing repository. In short time you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-dd43dd05b1` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-dd43dd05b1 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2020-dd43dd05b1 has been pushed to the Fedora 32 stable repository. If problem still persists, please make note of it in this bug report.