From ecca6c2c1cd6535fe8a912c165f4b308a99959a9 Mon Sep 17 00:00:00 2001 From: XIANJUN ZHU Date: Wed, 22 Apr 2020 13:15:55 -0400 Subject: [PATCH] Catch api_key for SL token (#292) --- detect_secrets/plugins/softlayer.py | 2 +- tests/plugins/softlayer_test.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/detect_secrets/plugins/softlayer.py b/detect_secrets/plugins/softlayer.py index 9f6857b48..fa87b0316 100644 --- a/detect_secrets/plugins/softlayer.py +++ b/detect_secrets/plugins/softlayer.py @@ -14,7 +14,7 @@ class SoftlayerDetector(RegexBasedDetector): secret_type = 'SoftLayer Credentials' # opt means optional - sl = r'(?:softlayer|sl)(?:_|-|)(?:api|)' + sl = r'(?:softlayer|sl|)(?:_|-|)(?:api|)' key_or_pass = r'(?:key|pwd|password|pass|token)' secret = r'([a-z0-9]{64})' denylist = [ diff --git a/tests/plugins/softlayer_test.py b/tests/plugins/softlayer_test.py index ee6358afd..4a7300b19 100644 --- a/tests/plugins/softlayer_test.py +++ b/tests/plugins/softlayer_test.py @@ -26,6 +26,7 @@ class TestSoftlayerDetector(object): ('http://api.softlayer.com/soap/v3/{sl_token}'.format(sl_token=SL_TOKEN), True), ('http://api.softlayer.com/soap/v3.1/{sl_token}'.format(sl_token=SL_TOKEN), True), ('softlayer_api_key: {sl_token}'.format(sl_token=SL_TOKEN), True), + ('api_key: {sl_token}'.format(sl_token=SL_TOKEN), True), ('softlayer-key : {sl_token}'.format(sl_token=SL_TOKEN), True), ('SOFTLAYER-API-KEY : "{sl_token}"'.format(sl_token=SL_TOKEN), True), ('"softlayer_api_key" : "{sl_token}"'.format(sl_token=SL_TOKEN), True),