From d13393020c1159acda2bdc51b925c900444075b8 Mon Sep 17 00:00:00 2001 From: Taylor <28880387+tsmithv11@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:48:59 -0700 Subject: [PATCH] Add nessus key (#217) --- detect_secrets/plugins/keyword.py | 1 + tests/plugins/keyword_test.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/detect_secrets/plugins/keyword.py b/detect_secrets/plugins/keyword.py index 3b50d655..1414ffbf 100644 --- a/detect_secrets/plugins/keyword.py +++ b/detect_secrets/plugins/keyword.py @@ -64,6 +64,7 @@ 'contraseƱa', 'contrasena', 'recaptcha_.*key', + 'nessus_?key', ) # Includes ], ', " as closing CLOSING = r'[]\'"]{0,2}' diff --git a/tests/plugins/keyword_test.py b/tests/plugins/keyword_test.py index 41199db0..839ad6fa 100644 --- a/tests/plugins/keyword_test.py +++ b/tests/plugins/keyword_test.py @@ -48,6 +48,7 @@ ('private_key "hopenobodyfindsthisone\';', None), # Double-quote does not match single-quote) ('api.key = {}'.format(COMMON_SECRET), COMMON_SECRET), ('API-KEY = {}'.format(COMMON_SECRET), COMMON_SECRET), + ('nessus_key: {}'.format(COMMON_SECRET), COMMON_SECRET), (LONG_LINE, None), # Long line test ] @@ -88,6 +89,7 @@ ('password := "somefakekey"', None), # 'fake' in the secret ('some_key = "real_secret"', None), # We cannot make 'key' a Keyword, too noisy) ('private_key "hopenobodyfindsthisone\';', None), # Double-quote does not match single-quote) + ('nessus_key = {}"'.format(COMMON_SECRET), COMMON_SECRET), # Last character is ignored (LONG_LINE, None), # Long line test ]