Skip to content

Commit

Permalink
Enable Box detector (Yelp#217)
Browse files Browse the repository at this point in the history
Supports git-defenders/detect-secrets-discuss#205
  • Loading branch information
justineyster committed Jun 24, 2020
1 parent 7b91d0e commit 99f2b42
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions detect_secrets/core/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
1 change: 1 addition & 0 deletions detect_secrets/plugins/common/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions detect_secrets/plugins/common/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/core/usage_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def test_consolidates_output_basic(self):
'KeywordDetector': {},
'PrivateKeyDetector': {},
'AWSKeyDetector': {},
'BoxDetector': {},
'IBMCloudIAMDetector': {},
'IBMCosHmacDetector': {},
'SlackDetector': {},
Expand Down
18 changes: 18 additions & 0 deletions tests/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def test_scan_string_basic(
ArtifactoryDetector : False
Base64HighEntropyString: {}
BasicAuthDetector : False
BoxDetector : False
DB2Detector : False
GHDetector : False
HexHighEntropyString : {}
Expand Down Expand Up @@ -224,6 +225,7 @@ def test_scan_string_basic_default(
AWSKeyDetector : False
ArtifactoryDetector: False
BasicAuthDetector : False
BoxDetector : False
DB2Detector : False
GHDetector : False
IBMCloudIAMDetector: False
Expand All @@ -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)
Expand Down Expand Up @@ -385,6 +388,9 @@ def test_old_baseline_ignored_with_update_flag(
{
'name': 'BasicAuthDetector',
},
{
'name': 'BoxDetector',
},
{
'name': 'DB2Detector',
},
Expand Down Expand Up @@ -437,6 +443,9 @@ def test_old_baseline_ignored_with_update_flag(
{
'name': 'BasicAuthDetector',
},
{
'name': 'BoxDetector',
},
{
'name': 'DB2Detector',
},
Expand Down Expand Up @@ -546,6 +555,9 @@ def test_old_baseline_ignored_with_update_flag(
{
'name': 'BasicAuthDetector',
},
{
'name': 'BoxDetector',
},
{
'name': 'DB2Detector',
},
Expand Down Expand Up @@ -597,6 +609,9 @@ def test_old_baseline_ignored_with_update_flag(
{
'name': 'BasicAuthDetector',
},
{
'name': 'BoxDetector',
},
{
'name': 'DB2Detector',
},
Expand Down Expand Up @@ -748,6 +763,9 @@ def test_scan_with_default_plugin(self):
{
'name': 'BasicAuthDetector',
},
{
'name': 'BoxDetector',
},
{
'name': 'DB2Detector',
},
Expand Down
3 changes: 3 additions & 0 deletions tests/pre_commit_hook_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ def test_baseline_gets_updated(
{
'name': 'BasicAuthDetector',
},
{
'name': 'BoxDetector',
},
{
'name': 'DB2Detector',
},
Expand Down

0 comments on commit 99f2b42

Please sign in to comment.