Bug 1748894

Summary: [RFE] Add soscleaner functionality to sosreport
Product: Red Hat Enterprise Linux 8 Reporter: Rainer Beyel <rbeyel>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Miroslav HradĂ­lek <mhradile>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.2CC: agk, apverma, bmr, briasmit, bugzilla-redhat, cww, dgross, jhunsaker, kasmith, mhradile, mlinden, plambri, pmoravec, sbradley, sfroemer, timothy.s.swan.ctr
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: 8.4   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sos-4.0-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 14:47:21 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1203710, 1797896, 1894575    

Description Rainer Beyel 2019-09-04 11:55:13 UTC
Description of problem:
  Sometimes customers are not allowed to share sosreports, as their security policy prohibits it. A workaround is to run soscleaner on the already created (sosreport) archive.
  sosreport is an official Red Hat tool, while soscleaner is not. We like to request the soscleaner functionality within the sosreport tool.

Version-Release number of selected component (if applicable):
  RHEL 8

Actual results:
  Running sosreport creates a sosreport archive, including sensitive data (e.g. usernames, IPs, hostnames)

Expected results:
  Run sosreport with an option (e.g. --clean) so the resulting sosreport archive doesn't contain any sensitive data (e.g. like the outcome of soscleaner)

Comment 8 Pavel Moravec 2019-09-23 18:24:51 UTC
*** Bug 1122207 has been marked as a duplicate of this bug. ***

Comment 10 Pavel Moravec 2020-05-11 12:35:21 UTC
deferring to 8.4 where we will rebase to sos 4.0 where sos cleaner might be finally implemented natively.

Comment 15 Pavel Moravec 2020-06-16 11:19:00 UTC
Current plan is to provide a cleaner functionality since RHEL8.4. It will be achieved by a new implementation under "sos" umbrella. For current almost-complete PR, see:

https://github.com/sosreport/sos/pull/2093

One could either:

- run "sos report --clean" to obfuscate sensitive data on just-being generated sosreport
- run "sos clean <sosreport-archive>" to apply the cleanup on a previously generated archive

Mapping what was obfuscated by what will be available for the user (and re-used automatically during next runs of sos).


Currently, these types of data will be obfuscated:
- MAC addresses
- IP addresses (not sure of status of IPv6)
- hostnames and domainnames
- any user-defined keywords

Comment 18 Pavel Moravec 2020-08-17 06:54:03 UTC
As sos-4.0 will have a new implementation of soscleaner, the functionality might differ from the soscleaner one. It would be great if anyone interested in the feature tests the upstream bits and provide any feedback. Such feedback could still be incorporated in 8.4 / 9.0 where we plan to include the sos clean in.

Ways of testing the feature:

current upstream:

rm -rf master.zip sos-master
curl -L -O https://github.com/sosreport/sos/archive/master.zip
unzip master.zip
cd sos-master
python3 bin/sos --help
python3 bin/sos report --clean
..


sos-4.0 once released (very soon):

rm -rf 4.0.zip sos-4.0
https://github.com/sosreport/sos/archive/4.0.zip
unzip 4.0.zip
cd sos-4.0
python3 bin/sos --help
python3 bin/sos report --clean
..

Comment 19 Jens Kuehnel 2020-08-24 17:05:31 UTC
Hi,


this looks very nice. But "username" are very personal information and under strict protection under GDPR. 
Is it possible to replace username the same way as hostname and networks? The current tool looks really nice, but in the current form it is not helping.

Thanks
CU
Jens

P.S.: I'm one of Rainer's aforementioned customer.

Comment 21 Jake Hunsaker 2020-08-24 18:02:27 UTC
(In reply to Jens Kuehnel from comment #19)
> Is it possible to replace username the same way as hostname and networks?

You can provide the usernames via the keyword option, and you'll get the same functionality. We can look at adding a dedicated parser for usernames for sos-4.1, i.e. automatic detection of usernames from /etc/passwd.

E.G.

# sos clean --keywords=user1,tom,user24601 $archive

or

# sos report --clean --keywords=user1,tom,user24601

Comment 36 errata-xmlrpc 2021-05-18 14:47:21 UTC
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:1604