-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cleaner] Add option to skip cleaning files #3520
[cleaner] Add option to skip cleaning files #3520
Conversation
I need to add an avocado test before merging. |
A new option --skip-clean-files allows cleaner to skip cleaning files where the user is certain no sensitive information is present. The option supports globs / wildcards. Relevant: sosreport#3469 Closes: sosreport#3520 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
1ccdcf8
to
c4a31ec
Compare
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
A new option --skip-clean-files allows cleaner to skip cleaning files where the user is certain no sensitive information is present. The option supports globs / wildcards. Relevant: sosreport#3469 Closes: sosreport#3520 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
c4a31ec
to
fdb4ec8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, minor notes below.
man/en/sos-clean.1
Outdated
@@ -5,6 +5,7 @@ sos clean - Obfuscate sensitive data from one or more sosreports | |||
.B sos clean TARGET [options] | |||
[\-\-domains] | |||
[\-\-disable-parsers] | |||
[\-\-skip-clean-files] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps --skip-cleaning-files
might be a bit clearer? We could also have an alias for --skip-masking-files
for the downstreams that prefer mask
.
sos/cleaner/__init__.py
Outdated
clean_grp.add_argument('--skip-clean-files', action='extend', | ||
default=[], dest='skip_clean_files', | ||
help=('List of files to skip/ignore during ' | ||
'cleaning. Asterisks are supported.')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Asterisks/Globs in my opinion, as it is more precise.
A new option --skip-cleaning-files / --skip-masking-files allows cleaner to skip cleaning files where the user is certain no sensitive information is present. The option supports globs / wildcards. Relevant: sosreport#3469 Closes: sosreport#3520 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
fdb4ec8
to
50d90d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I was about to write a test for this when I discovered a problem: we can't easily tell cleaner not to obfuscate symbolic links. Check:
Then, https://github.com/sosreport/sos/blob/main/sos/cleaner/__init__.py#L758 causes we skip the decision "shall we obfuscate the file or not?" for a symlink. We can't easily add " I was thinking about this solution: anywere before https://github.com/sosreport/sos/blob/main/sos/cleaner/__init__.py#L676 , traverse the It is bit ugly and lengthy, but I dont see an easier way.. Anyway, that is an independent issue I can deal afterwards. |
Closes: sosreport#3469 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Avocado test added, symlinks issue raised as #3563 . |
A new option --skip-clean-files allows cleaner to skip cleaning files where the user is certain no sensitive information is present.
The option supports globs / wildcards.
Relevant: #3469
Closes: #3520
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines