diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2021-02-18 13:51:51 -0500 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2021-02-22 10:33:26 -0500 |
commit | c5a8008cd44aac8fba3daf58ac50a244870b4ac1 (patch) | |
tree | 354312f43d2c5a0ca27d6d84fc8b80296d9132bf | |
parent | beac1212fe34634e0ee218ccfaef9720b0e7e529 (diff) | |
download | sos-c5a8008cd44aac8fba3daf58ac50a244870b4ac1.tar.gz |
[cleaner|hostname] Match uppercase domains for kerberos
Previously, kerberos realms would not be obfuscated due to the
convention that those are written in all uppercase. While the parser
would match these, the hostname parser would not obfuscate them due to
the use of intermediary dicts that were case sensitive.
Now, match this convention and if it is found, obfuscate as a whole
domain rather than a potential FQDN with a hostname.
Closes: #2254
Resolves: #2416
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/cleaner/mappings/hostname_map.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sos/cleaner/mappings/hostname_map.py b/sos/cleaner/mappings/hostname_map.py index 8739cb4e..e0b7bf1d 100644 --- a/sos/cleaner/mappings/hostname_map.py +++ b/sos/cleaner/mappings/hostname_map.py @@ -111,12 +111,16 @@ class SoSHostnameMap(SoSMap): if item.startswith(('.', '_')): item = item.lstrip('._') item = item.strip() - if not self.domain_name_in_loaded_domains(item): + if not self.domain_name_in_loaded_domains(item.lower()): return item return super(SoSHostnameMap, self).get(item) def sanitize_item(self, item): host = item.split('.') + if all([h.isupper() for h in host]): + # by convention we have just a domain + _host = [h.lower() for h in host] + return self.sanitize_domain(_host).upper() if len(host) == 1: # we have a shortname for a host return self.sanitize_short_name(host[0]) |