From 3ac15d880f89dd6e6f938bfa6bd189e1352e01ae Mon Sep 17 00:00:00 2001 From: Noam Date: Tue, 1 Mar 2016 10:40:22 +0200 Subject: [PATCH] Scrub Local Windows User Path - Scrub Windows user path from logs --- headphones/deluge.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/headphones/deluge.py b/headphones/deluge.py index 79104bc9..bde7856f 100644 --- a/headphones/deluge.py +++ b/headphones/deluge.py @@ -60,8 +60,10 @@ def _scrubber(text): text = re.sub('\:\/\/.*\:' , '://REMOVED:' , text) # Session cookie text = re.sub("_session_id'\: '.*'", "_session_id': 'REMOVED'", text) - # Local Windows path - # TODO + # Local Windows user path + if text.lower().startswith('c:\\users\\'): + k = text.split('\\') + text = '\\'.join([k[0], k[1], '.....', k[-1]]) #partial_link = re.sub('(auth.*?)=.*&','\g<1>=SECRETZ&', link) #partial_link = re.sub('(\w)=[0-9a-zA-Z]*&*','\g<1>=REMOVED&', link) except Exception as e: