SV-257529r960930_rule
V-257529
SRG-APP-000118-CTR-000240
CNTR-OS-000270
CAT II
10
Correct journal file ownership by executing the following:
for node in $(oc get node -oname); do oc debug $node -- chroot /host /bin/bash -c 'echo -n "$HOSTNAME "; machine_id=$(systemd-machine-id-setup --print); chown root:systemd-journal /var/log/journal/$machine_id/system.journal' 2>/dev/null; done
Verify the "system journal" file is group-owned by systemd-journal and owned by root by executing the following:
for node in $(oc get node -oname); do oc debug $node -- chroot /host /bin/bash -c 'echo -n "$HOSTNAME "; machine_id=$(systemd-machine-id-setup --print); stat -c "%U %G" /var/log/journal/$machine_id/system.journal' 2>/dev/null; done
Example output:
ip-10-0-150-1 root systemd-journal
If "root" is not returned as the owner, this is a finding.
If "systemd-journald" is not returned as the group owner, this is a finding.
V-257529
False
CNTR-OS-000270
Verify the "system journal" file is group-owned by systemd-journal and owned by root by executing the following:
for node in $(oc get node -oname); do oc debug $node -- chroot /host /bin/bash -c 'echo -n "$HOSTNAME "; machine_id=$(systemd-machine-id-setup --print); stat -c "%U %G" /var/log/journal/$machine_id/system.journal' 2>/dev/null; done
Example output:
ip-10-0-150-1 root systemd-journal
If "root" is not returned as the owner, this is a finding.
If "systemd-journald" is not returned as the group owner, this is a finding.
M
5547