Skip to content

Commit 778dc1f

Browse files
XIANJUN ZHUjustineyster
XIANJUN ZHU
authored andcommitted
One more regex for iam (Yelp#317)
* One more regex for iam * missing args
1 parent a522564 commit 778dc1f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

detect_secrets/plugins/ibm_cloud_iam.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class IbmCloudIamDetector(RegexBasedDetector):
1616
r'ibm(?:_|-|)cloud|ibm(?:_|-|)iam|ibm|iam|cloud|)'
1717
opt_dash_undrscr = r'(?:_|-|)'
1818
opt_api = r'(?:api|)'
19-
key_or_pass = r'(?:key|pwd|password|pass|token)'
19+
key_or_pass = r'(?:key|keyid|pwd|password|pass|token)'
2020
secret = r'([a-zA-Z0-9_\-]{44})'
2121
denylist = [
2222
RegexBasedDetector.assign_regex_generator(
@@ -26,7 +26,7 @@ class IbmCloudIamDetector(RegexBasedDetector):
2626
),
2727
]
2828

29-
def verify(self, token, **kwargs):
29+
def verify(self, token, *args, **kwargs):
3030
response = verify_cloud_iam_api_key(token)
3131
try:
3232
if response.status_code != 200:

tests/plugins/ibm_cloud_iam_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class TestIbmCloudIamDetector(object):
1515
'payload, should_flag',
1616
[
1717
('ibm-cloud_api_key: {cloud_iam_key}'.format(cloud_iam_key=CLOUD_IAM_KEY), True),
18+
('apikeyid: {cloud_iam_key}'.format(cloud_iam_key=CLOUD_IAM_KEY), True),
1819
('ibm_cloud_iam-key : {cloud_iam_key}'.format(cloud_iam_key=CLOUD_IAM_KEY), True),
1920
('IBM-API-KEY : "{cloud_iam_key}"'.format(cloud_iam_key=CLOUD_IAM_KEY), True),
2021
('"iam_api_key" : "{cloud_iam_key}"'.format(cloud_iam_key=CLOUD_IAM_KEY), True),

0 commit comments

Comments
 (0)