Skip to content

Commit 258cfad

Browse files
harcoded for the sake of checking codeQL
1 parent c137a25 commit 258cfad

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/sagemaker/config/config_utils.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,24 @@ def _log_sagemaker_config_single_substitution(source_value, config_value, config
7575
config_value_log_copy = deepcopy(config_value)
7676

7777

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+
7888
if isinstance(source_value_log_copy, dict):
7989
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:
8191
source_value_log_copy[key] = '***'
8292

8393
if isinstance(config_value_log_copy, dict):
8494
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:
8696
config_value_log_copy[key] = '***'
8797

8898
if config_value is not None:

0 commit comments

Comments
 (0)