@@ -75,26 +75,22 @@ def _log_sagemaker_config_single_substitution(source_value, config_value, config
75
75
config_value_log_copy = deepcopy (config_value )
76
76
77
77
78
- # if isinstance(source_value_log_copy, dict):
79
- # for key in source_value_log_copy.keys():
80
- # if re.search(r'(secret|password|key)', key, re.IGNORECASE):
81
- # source_value_log_copy[key] = '***'
82
- #
83
- # if isinstance(config_value_log_copy, dict):
84
- # for key in config_value_log_copy.keys():
85
- # if re.search(r'(secret|password|key)', key, re.IGNORECASE):
86
- # config_value_log_copy[key] = '***'
87
-
88
78
if isinstance (source_value_log_copy , dict ):
89
79
for key in source_value_log_copy .keys ():
90
- if ' secret' in key or ' password' in key or 'key' in key or 'SECRET' in key or 'PASSWORD' in key or 'KEY' in key :
80
+ if re . search ( r'( secret| password| key)' , key , re . IGNORECASE ) :
91
81
source_value_log_copy [key ] = '***'
92
82
93
83
if isinstance (config_value_log_copy , dict ):
94
84
for key in config_value_log_copy .keys ():
95
- if ' secret' in key or ' password' in key or 'key' in key or 'SECRET' in key or 'PASSWORD' in key or 'KEY' in key :
85
+ if re . search ( r'( secret| password| key)' , key , re . IGNORECASE ) :
96
86
config_value_log_copy [key ] = '***'
97
87
88
+ if isinstance (source_value_log_copy , str ):
89
+ source_value_log_copy = '*'
90
+
91
+ if isinstance (config_value_log_copy , str ):
92
+ config_value_log_copy = '*'
93
+
98
94
if config_value is not None :
99
95
100
96
if source_value is None :
0 commit comments