Skip to content

Commit 74ba49d

Browse files
authored
Update aws access keys (#221)
1 parent 0a65383 commit 74ba49d

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

detect_secrets/plugins/aws.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ class AWSKeyDetector(RegexBasedDetector):
2525
secret_keyword = r'(?:key|pwd|pw|password|pass|token)'
2626

2727
denylist = (
28-
re.compile(r'AKIA[0-9A-Z]{16}'),
28+
re.compile(r'(?:A3T[A-Z0-9]|ABIA|ACCA|AKIA|ASIA)[0-9A-Z]{16}'),
2929

3030
# This examines the variable name to identify AWS secret tokens.
31-
# The order is important since we want to prefer finding `AKIA`-based
31+
# The order is important since we want to prefer finding access
3232
# keys (since they can be verified), rather than the secret tokens.
3333

3434
re.compile(
@@ -99,7 +99,10 @@ def verify_aws_secret_access_key(key: str, secret: str) -> bool: # pragma: no c
9999
}
100100

101101
# Step #1: Canonical Request
102-
signed_headers = ';'.join(header.lower() for header in headers)
102+
signed_headers = ';'.join(
103+
header.lower()
104+
for header in headers
105+
)
103106
canonical_request = textwrap.dedent("""
104107
POST
105108
/

tests/plugins/aws_key_test.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ def setup_method(self):
3232
'AKIAZZZ',
3333
False,
3434
),
35+
(
36+
'A3T0ZZZZZZZZZZZZZZZZ',
37+
True,
38+
),
39+
(
40+
'ABIAZZZZZZZZZZZZZZZZ',
41+
True,
42+
),
43+
(
44+
'ACCAZZZZZZZZZZZZZZZZ',
45+
True,
46+
),
47+
(
48+
'ASIAZZZZZZZZZZZZZZZZ',
49+
True,
50+
),
3551
(
3652
'aws_access_key = "{}"'.format(EXAMPLE_SECRET),
3753
True,

0 commit comments

Comments
 (0)