Skip to content

Commit

Permalink
Merge branch 'main' into filter_resource_by_provider_for_all_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
lirshindalman committed Jul 25, 2024
2 parents 7dd21af + 0ea0fc7 commit 7788a85
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion checkov/secrets/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
}

ENTROPY_CHECK_IDS = {'CKV_SECRET_6', 'CKV_SECRET_19', 'CKV_SECRET_80'}
GENERIC_PRIVATE_KEY_CHECK_IDS = {'CKV_SECRET_10', 'CKV_SECRET_13'}
GENERIC_PRIVATE_KEY_CHECK_IDS = {'CKV_SECRET_10', 'CKV_SECRET_13', 'CKV_SECRET_192'}

CHECK_ID_TO_SECRET_TYPE = {v: k for k, v in SECRET_TYPE_TO_ID.items()}

Expand Down
2 changes: 1 addition & 1 deletion checkov/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '3.2.205'
version = '3.2.206'
2 changes: 1 addition & 1 deletion kubernetes/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
checkov==3.2.205
checkov==3.2.206
14 changes: 14 additions & 0 deletions tests/secrets/test_prioritise_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ def setUp(self):
check_result={"result": CheckResult.FAILED}, code_block=[(1, 'baz')],
file_path='qux', file_line_range=[1, 2], resource='resource', evaluations=None,
check_class='CheckClass', file_abs_path='abs_path'),
'key4': SecretsRecord(check_id='CKV_SECRET_192', check_name='foo',
check_result={"result": CheckResult.FAILED}, code_block=[(1, 'baz')],
file_path='qux', file_line_range=[1, 2], resource='resource', evaluations=None,
check_class='CheckClass', file_abs_path='abs_path'),
}
self.ENTROPY_CHECK_IDS = ENTROPY_CHECK_IDS
self.GENERIC_PRIVATE_KEY_CHECK_IDS = GENERIC_PRIVATE_KEY_CHECK_IDS
Expand All @@ -34,6 +38,11 @@ def test_generic_private_key_check_id_removed(self):
self.assertTrue(result)
self.assertNotIn('key2', self.secret_records)

def test_generic_private_key_check_id_192_removed(self):
result = Runner._prioritise_secrets(self.secret_records, 'key4', 'CKV_SECRET_18')
self.assertTrue(result)
self.assertNotIn('key4', self.secret_records)

def test_no_removal_entropy_check_id(self):
result = Runner._prioritise_secrets(self.secret_records, 'key1', 'CKV_SECRET_6')
self.assertFalse(result)
Expand All @@ -44,6 +53,11 @@ def test_no_removal_generic_private_key_check_id(self):
self.assertFalse(result)
self.assertIn('key2', self.secret_records)

def test_no_removal_generic_private_key_check_id_192(self):
result = Runner._prioritise_secrets(self.secret_records, 'key4', 'CKV_SECRET_192')
self.assertFalse(result)
self.assertIn('key4', self.secret_records)

def test_no_removal_other_check_id(self):
result = Runner._prioritise_secrets(self.secret_records, 'key3', 'CKV_SECRET_1000')
self.assertFalse(result)
Expand Down

0 comments on commit 7788a85

Please sign in to comment.