Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding AWS credential types #91

Merged
merged 7 commits into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions pywhat/Data/regex.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,30 @@
"Networking"
]
},
{
"Name": "Amazon Web Services Access Key",
"Regex": "(?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])",
"plural_name": false,
"Description": "Access key used to authenticate with the AWS API",
"Rarity": 1,
"URL": null,
"Tags": [
"Credentials",
bee-san marked this conversation as resolved.
Show resolved Hide resolved
"Cyber Security"
]
},
{
"Name": "Amazon Web Services Secret Access Key",
"Regex": "(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])",
"plural_name": false,
"Description": "Secret access key used to authenticate with the AWS API",
"Rarity": 1,
"URL": null,
"Tags": [
"Credentials",
"Cyber Security"
]
},
{
"Name": "Internet Protocol (IP) Address Version 6",
"Regex": "(?=.*[0-9])\\[?(?:(?:[0-9a-f]{1,4}:){7,7}[0-9a-f]{1,4}|([0-9a-f]{4}:){1,7}:|([0-9a-f]{1,4}:){1,6}:[0-9a-f]{1,4}|([0-9a-f]{1,4}:){1,5}(:[0-9a-f]{1,4}){1,2}|([0-9a-f]{1,4}:){1,4}(:[0-9a-f]{1,4}){1,3}|([0-9a-f]{1,4}:){1,3}(:[0-9a-f]{1,4}){1,4}|([0-9a-fA]{1,4}:){1,2}(:[0-9a-f]{1,4}){1,5}|[0-9a-f]{1,4}:((:[0-9a-f]{1,4}){1,6})|:((:[0-9a-f]{1,4}){1,7}|:)|fe80:(:[0-9a-f]{0,4}){0,4}%[0-9a-z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|(?:[0-9a-f]{1,4}:){1,4}:(?:(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(?:2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\]?(?::[0-9]{1,5})?",
Expand Down
10 changes: 10 additions & 0 deletions tests/test_regex_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,13 @@ def test_ssh_ed25519_key():
]
)
assert "SSH ED25519" in str(res)

def test_aws_access_key():
r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)

def test_aws_secret_access_key():
r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)