diff --git a/tenable/utils.py b/tenable/utils.py index ddfc1a830..5a6d3673c 100644 --- a/tenable/utils.py +++ b/tenable/utils.py @@ -89,8 +89,9 @@ def scrub(value: Any) -> str: """ Scrubs converts the value to a string and then scrubs out any illegal characters. """ + value = str(value) safe_chars = string.ascii_letters + string.digits + '-_%@:' - scrubbed_value = ''.join([c for c in str(value) if c in safe_chars]) + scrubbed_value = ''.join([c for c in value if c in safe_chars]) if value != scrubbed_value: logger.warning( f"Value '{value}' has unsafe chars, scrubbing to '{scrubbed_value}'"