@@ -75,14 +75,24 @@ 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
+
78
88
if isinstance (source_value_log_copy , dict ):
79
89
for key in source_value_log_copy .keys ():
80
- if re . search ( r'( secret| password| key)' , key , re . IGNORECASE ) :
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 :
81
91
source_value_log_copy [key ] = '***'
82
92
83
93
if isinstance (config_value_log_copy , dict ):
84
94
for key in config_value_log_copy .keys ():
85
- if re . search ( r'( secret| password| key)' , key , re . IGNORECASE ) :
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 :
86
96
config_value_log_copy [key ] = '***'
87
97
88
98
if config_value is not None :
0 commit comments