File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def spider_closed(self, spider):
5454 if spider .settings .getbool ("MASKED_SENSITIVE_SETTINGS_ENABLED" , True ):
5555 default_regexes = [
5656 ".*(?i)(api[\W_]*key).*" , # apikey and possible variations e.g: shub_apikey or SC_APIKEY
57- ".*(?i)(AWS[\W_]*(SECRET[\W_]*)?ACCESS[\W_]*KEY).* " , # AWS_SECRET_ACCESS_KEY and possible variations
57+ ".*(?i)(AWS[\W_]*(SECRET[\W_]*)?( ACCESS)? [\W_]*( KEY|ACCESS[\W_]*KEY)) " , # AWS_SECRET_ACCESS_KEY and possible variations
5858 ".*(?i)([\W_]*password[\W_]*).*" # password word
5959 ]
6060 regex_list = spider .settings .getlist ("MASKED_SENSITIVE_SETTINGS_REGEX_LIST" , default_regexes )
Original file line number Diff line number Diff line change @@ -145,6 +145,8 @@ def test_log_all_should_not_return_aws_secret_key_value_by_default(caplog):
145145 "AWS_SECRET_ACCESS_KEY" : 'secret_value1' ,
146146 "aws_secret_access_key" : 'secret_value2' ,
147147 "aws_access_key" : 'secret_value2' ,
148+ "AWS_SECRET_KEY" : 'secret_value2' ,
149+ "aws_secret_key" : 'secret_value2' ,
148150 }
149151
150152 spider = MockSpider (settings )
@@ -155,6 +157,8 @@ def test_log_all_should_not_return_aws_secret_key_value_by_default(caplog):
155157 assert '"AWS_SECRET_ACCESS_KEY": "**********"' in caplog .text
156158 assert '"aws_secret_access_key": "**********"' in caplog .text
157159 assert '"aws_access_key": "**********"' in caplog .text
160+ assert '"AWS_SECRET_KEY": "**********"' in caplog .text
161+ assert '"aws_secret_key": "**********"' in caplog .text
158162 assert 'secret_value' not in caplog .text
159163
160164
You can’t perform that action at this time.
0 commit comments