Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-35945

sos clean on an existing archive fails to clean anything

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Critical Critical
    • rhel-9.4.z
    • rhel-8.9.0.z, rhel-9.3.0.z
    • sos
    • None
    • sos-4.7.1-3.el8_9
    • None
    • Important
    • rhel-sst-cee-supportability
    • None
    • False
    • Hide

      None

      Show
      None
    • Yes
    • None
    • Bug Fix
    • Hide
      .The `sos clean` on an existing archive no longer fails

      Previously, an existing archive could not be cleaned by running `sos clean` due to a regression in the `sos` code that incorrectly detected the root directory of a tarball and prevented it from cleaning data. As a consequence, `sos clean` running on an existing sosreport tarball does not clean anything within the tarball. This update adds an implementation of a proper detection of the root directory in the reordered tarball content. As a result, `sos clean` performs sensitive data obfuscation on an existing sosreport tarball correctly.
      Show
      .The `sos clean` on an existing archive no longer fails Previously, an existing archive could not be cleaned by running `sos clean` due to a regression in the `sos` code that incorrectly detected the root directory of a tarball and prevented it from cleaning data. As a consequence, `sos clean` running on an existing sosreport tarball does not clean anything within the tarball. This update adds an implementation of a proper detection of the root directory in the reordered tarball content. As a result, `sos clean` performs sensitive data obfuscation on an existing sosreport tarball correctly.
    • Done
    • All
    • None

      What were you trying to do that didn't work?

       

      See https://github.com/sosreport/sos/pull/3616 and reproducer there. We need to backport that to RHEL8 and RHEL9.

      Please provide the package NVR for which bug is seen:

      sos-4.5.2 or newer

       

      How reproducible:

      100%

       

      Steps to reproduce

      1. # sos report -o host --batch
        ..
        Your sosreport has been generated and saved in:
                /var/tmp/sosreport-pmoravec-rhel8-2024-04-23-dxyytjg.tar.xz
        # rm -f /etc/sos/cleaner/default_mapping
        # sos clean --batch -vv /var/tmp/sosreport-pmoravec-rhel8-2024-04-23-dxyytjg.tar.xz
        ..
        [cleaner:sosreport-pmoravec-rhel8-2024-04-23-dxyytjg] Loaded /var/tmp/sosreport-pmoravec-rhel8-2024-04-23-dxyytjg.tar.xz as type sos report archive
        [cleaner] Pre-loading all archives into obfuscation maps
        [cleaner:sosreport-pmoravec-rhel8-2024-04-23-dxyytjg] Unable to retrieve sos_commands/host/hostname: no such file in archive
        ..
        # 
      1. .. and check if/what was cleaned inside the archive (at least hostnames should)
      2. .. and check if /etc/sos/cleaner/default_mapping was created with that mapping

      Expected results

      2. and 3.: at least hosts cleaning applied

      Actual results

      2. and 3.: no cleaning applied at all

       

              rhn-support-pmoravec Pavel Moravec
              rhn-support-pmoravec Pavel Moravec
              Pavel Moravec Pavel Moravec
              Miroslav Hradilek Miroslav Hradilek
              Gabriela Necasova Gabriela Necasova
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: