diff --git a/detect_secrets/core/usage.py b/detect_secrets/core/usage.py index 7b2fca2fa..4f51f6756 100644 --- a/detect_secrets/core/usage.py +++ b/detect_secrets/core/usage.py @@ -444,6 +444,12 @@ class PluginOptions: disable_help_text='Disable scanning for IBM Cloud Object Storage HMAC keys', is_default=True, ), + PluginDescriptor( + classname='BoxDetector', + disable_flag_text='--no-box-scan', + disable_help_text='Disable scanning for Box API credentials', + is_default=True, + ), ] default_plugins_list = [ diff --git a/detect_secrets/plugins/common/initialize.py b/detect_secrets/plugins/common/initialize.py index 7000889ba..899212dd7 100644 --- a/detect_secrets/plugins/common/initialize.py +++ b/detect_secrets/plugins/common/initialize.py @@ -7,6 +7,7 @@ from ..aws import AWSKeyDetector # noqa: F401 from ..base import BasePlugin from ..basic_auth import BasicAuthDetector # noqa: F401 +from ..box import BoxDetector # noqa: F401 from ..common.util import get_mapping_from_secret_type_to_class_name from ..db2 import DB2Detector # noqa: F401 from ..gh import GHDetector # noqa: F401 diff --git a/detect_secrets/plugins/common/util.py b/detect_secrets/plugins/common/util.py index 3ee211883..ab5885097 100644 --- a/detect_secrets/plugins/common/util.py +++ b/detect_secrets/plugins/common/util.py @@ -9,6 +9,7 @@ from ..aws import AWSKeyDetector # noqa: F401 from ..base import BasePlugin from ..basic_auth import BasicAuthDetector # noqa: F401 +from ..box import BoxDetector # noqa: F401 from ..db2 import DB2Detector # noqa: F401 from ..high_entropy_strings import Base64HighEntropyString # noqa: F401 from ..high_entropy_strings import HexHighEntropyString # noqa: F401 diff --git a/tests/core/usage_test.py b/tests/core/usage_test.py index c7ab604a6..1be501bcf 100644 --- a/tests/core/usage_test.py +++ b/tests/core/usage_test.py @@ -45,6 +45,7 @@ def test_consolidates_output_basic(self): 'KeywordDetector': {}, 'PrivateKeyDetector': {}, 'AWSKeyDetector': {}, + 'BoxDetector': {}, 'IBMCloudIAMDetector': {}, 'IBMCosHmacDetector': {}, 'SlackDetector': {}, diff --git a/tests/main_test.py b/tests/main_test.py index a29ce443f..cdb149417 100644 --- a/tests/main_test.py +++ b/tests/main_test.py @@ -193,6 +193,7 @@ def test_scan_string_basic( ArtifactoryDetector : False Base64HighEntropyString: {} BasicAuthDetector : False + BoxDetector : False DB2Detector : False GHDetector : False HexHighEntropyString : {} @@ -224,6 +225,7 @@ def test_scan_string_basic_default( AWSKeyDetector : False ArtifactoryDetector: False BasicAuthDetector : False + BoxDetector : False DB2Detector : False GHDetector : False IBMCloudIAMDetector: False @@ -248,6 +250,7 @@ def test_scan_string_cli_overrides_stdin(self): ArtifactoryDetector : False Base64HighEntropyString: False (2.585) BasicAuthDetector : False + BoxDetector : False DB2Detector : False GHDetector : False HexHighEntropyString : False (2.121) @@ -385,6 +388,9 @@ def test_old_baseline_ignored_with_update_flag( { 'name': 'BasicAuthDetector', }, + { + 'name': 'BoxDetector', + }, { 'name': 'DB2Detector', }, @@ -437,6 +443,9 @@ def test_old_baseline_ignored_with_update_flag( { 'name': 'BasicAuthDetector', }, + { + 'name': 'BoxDetector', + }, { 'name': 'DB2Detector', }, @@ -546,6 +555,9 @@ def test_old_baseline_ignored_with_update_flag( { 'name': 'BasicAuthDetector', }, + { + 'name': 'BoxDetector', + }, { 'name': 'DB2Detector', }, @@ -597,6 +609,9 @@ def test_old_baseline_ignored_with_update_flag( { 'name': 'BasicAuthDetector', }, + { + 'name': 'BoxDetector', + }, { 'name': 'DB2Detector', }, @@ -748,6 +763,9 @@ def test_scan_with_default_plugin(self): { 'name': 'BasicAuthDetector', }, + { + 'name': 'BoxDetector', + }, { 'name': 'DB2Detector', }, diff --git a/tests/pre_commit_hook_test.py b/tests/pre_commit_hook_test.py index f71bee651..c55ae1d00 100644 --- a/tests/pre_commit_hook_test.py +++ b/tests/pre_commit_hook_test.py @@ -196,6 +196,9 @@ def test_baseline_gets_updated( { 'name': 'BasicAuthDetector', }, + { + 'name': 'BoxDetector', + }, { 'name': 'DB2Detector', },