SOS(CLEAN) | SOS(CLEAN) |
sos clean - Obfuscate sensitive data from one or more sosreports
sos clean TARGET [options]
[--domains]
[--disable-parsers]
[--skip-cleaning-files|--skip-masking-files]
[--keywords]
[--keyword-file]
[--map-file]
[--jobs]
[--no-update]
[--keep-binary-files]
[--archive-type]
sos clean or sos mask is an sos subcommand used to obfuscate sensitive information from previously generated sosreports that is not covered by the standard plugin-based post processing executed during report generation, for example IP addresses.
Data obfuscated via this utility is done so consistently, meaning for example an IP address of 192.168.1.1 in an unprocessed sosreport that gets obfuscated to, for example, 100.0.0.1, will be changed to 100.0.0.1 in all occurrences found in the report.
Additionally, by default all such obfuscations are stored in "maps" that will be persistently saved to /etc/sos/cleaner/default_mapping and be re-used on subsequent runs.
This utility may also be used in-line with sos report and sos collect by specifying the --clean or --mask option.
When called directly via sos clean, the obfuscated archive is written as an additional file, meaning the original unprocessed report still remains on the filesystem. When called via report or collect, the changes are done in-line and thus only an obfuscated archive is written and available. In either case, a mapping file containing the relationships between unprocessed and obfuscated elements will be written in the same location as the resulting archive. This mapping file should be kept private by system administrators.
TARGET
For example, if --domains redhat.com is specified, then 'redhat.com' will be obfuscated, as will 'www.redhat.com' and subdomains such as 'foo.redhat.com'.
Note that using this option is very likely to leave sensitive information in place in the target archive, so only use this option when absolutely necessary or you have complete trust in the party/parties that may handle the generated report.
Valid values for this option are currently: hostname, ip, ipv6, mac, keyword, and username.
Globs like asterisk are supported, so sos_commands/host/hostname* will match all three usual filenames in that directory (hostname, hostnamectl_status and hostname_-f).
Use this option with caution, only when being certain the given files do not contain any sensitive information.
Keywords provided by this option will be obfuscated as "obfuscatedwordX" where X is an integer based on the keyword's index in the parser. Note that keywords will be replaced as both standalone words and in substring matches.
Default: /etc/sos/cleaner/default_mapping
Default: 4
Note that binary files cannot be obfuscated, and thus keeping them in the archive may result in otherwise sensitive information being included in the final archive. Users should review any archive that keeps binary files in place before sending to a third party.
Default: False (remove encountered binary files)
This option may be useful if a given TARGET archive is known to be of a specific type, but due to unknown reasons or some malformed/missing information in the archive directly, that is not properly identified by sos.
The following are accepted values for this option:
auto Automatically detect the archive type
report An archive generated by sos report
collect An archive generated by sos collect
insights An archive generated by the insights-client
package
The following may also be used, however note that these do not attempt to pre-load any information from the archives into the parsers. This means that, among other limitations, items like host and domain names may not be obfuscated unless an obfuscated mapping already exists on the system from a previous execution.
data-dir A plain directory on the filesystem.
tarball A generic tar archive not associated with any known
tool
sos(1) sos-report(1) sos-collect(1) sos.conf(5)
Maintained on GitHub at https://github.com/sosreport/sos
See AUTHORS file in the package documentation.
1 | Thu May 21 2020 |