From c5a8008cd44aac8fba3daf58ac50a244870b4ac1 Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Thu, 18 Feb 2021 13:51:51 -0500 Subject: [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 --- sos/cleaner/mappings/hostname_map.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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]) -- cgit