Hide Forgot
Description of problem: Default hostname obfuscation provided by "sos clean" only works when sosreport contains files from "host" plugin of "sos report" component. The cleanup is not performed despite default mapping containing the obfuscation of such hostname. Usage of the default mapping is confirmed by such hostname being included even in private mapping produced by cleaner run. Version-Release number of selected component (if applicable): sos-4.0-7.el8.noarch How reproducible: 100% Steps to Reproduce: # rpm -q sos sos-4.0-7.el8.noarch # hostname sostesthost.sossubdomain.redhat.com # mkdir /etc/sos/cleaner/ # Overcome BZ#1923937 # sosreport -o logs -o host --batch . . . # tar -xf /var/tmp/sosreport-sostesthost-2021-02-16-iktgdbf.tar.xz # cat sosreport-sostesthost-2021-02-16-iktgdbf/sos_commands/host/hostname sostesthost.sossubdomain.redhat.com # tail -n 2 sosreport-sostesthost-2021-02-16-iktgdbf/var/log/messages Feb 16 13:51:23 sostesthost systemd[1]: Started Hostname Service. Feb 16 13:51:53 sostesthost systemd[1]: systemd-hostnamed.service: Succeeded. # sos clean --batch /var/tmp/sosreport-sostesthost-2021-02-16-iktgdbf.tar.xz . . . # tar -xf /var/tmp/sosreport-host0-2021-02-16-iktgdbf-obfuscated.tar.xz # cat sosreport-host0-2021-02-16-iktgdbf/sos_commands/host/hostname host0.obfuscateddomain1.com # tail -n 2 sosreport-host0-2021-02-16-iktgdbf/var/log/messages Feb 16 13:51:23 host0 systemd[1]: Started Hostname Service. Feb 16 13:51:53 host0 systemd[1]: systemd-hostnamed.service: Succeeded. # # At this point it correctly replaced hostnames and adds the hostname into mapping. # cat /etc/sos/cleaner/default_mapping { "hostname_map": { "redhat.com": "obfuscateddomain0.com", "sostesthost.sossubdomain.redhat.com": "host0.obfuscateddomain1.com", . . . "sostesthost": "host0", . . . # sosreport -o logs --batch . . . # tar -xf /var/tmp/sosreport-sostesthost-2021-02-16-qzbkssg.tar.xz # tail -n 2 sosreport-sostesthost-2021-02-16-qzbkssg/var/log/messages Feb 16 14:53:03 sostesthost systemd[1]: Started Network Manager Script Dispatcher Service. Feb 16 14:53:14 sostesthost systemd[1]: NetworkManager-dispatcher.service: Succeeded. # sos clean --batch /var/tmp/sosreport-sostesthost-2021-02-16-qzbkssg.tar.xz . . . # cat /var/tmp/sosreport-host0-2021-02-16-qzbkssg-private_map { "hostname_map": { "redhat.com": "obfuscateddomain0.com", "sostesthost.sossubdomain.redhat.com": "host0.obfuscateddomain1.com", . . . "sostesthost": "host0", . . . # tar -xf /var/tmp/sosreport-host0-2021-02-16-qzbkssg-obfuscated.tar.xz . . . # tail -n 2 sosreport-host0-2021-02-16-qzbkssg/var/log/messages Feb 16 14:53:03 sostesthost systemd[1]: Started Network Manager Script Dispatcher Service. Feb 16 14:53:14 sostesthost systemd[1]: NetworkManager-dispatcher.service: Succeeded. # # At this point hostname is not replaced (is still sostesthost) despite private mapping containing it.
This should be resolved by upstream PR #2406 - https://github.com/sosreport/sos/pull/2406. As of right now this PR has not been merged as it is still awaiting further testing in upstream.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (sos bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2021:4388