Repository: bridgecrewio/checkov

Issue:
Consider replacing some terms
**Is your feature request related to a problem? Please describe.**
Let's replace blacklist with blocklist and whitelist with allowlist. This is similar to what other projects are doing atm.

**Describe the solution you'd like**
Find and replace should be enough

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.



Discussion:
we will accept a contribution there, should be easy

Resolving patch:
diff --git a/checkov/common/checks/base_check_registry.py b/checkov/common/checks/base_check_registry.py
--- a/checkov/common/checks/base_check_registry.py
+++ b/checkov/common/checks/base_check_registry.py
@@ -7,12 +7,12 @@
 
 class BaseCheckRegistry(object):
     checks = {}
-    check_id_whitelist = None
+    check_id_allowlist = None
 
     def __init__(self):
         self.logger = logging.getLogger(__name__)
         self.checks = {}
-        self.check_id_whitelist = None
+        self.check_id_allowlist = None
 
     def register(self, check):
         for entity in check.supported_entities:
@@ -33,9 +33,9 @@ def get_checks(self, entity):
             return self.checks[entity]
         return []
 
-    def set_checks_whitelist(self,runner_filter):
+    def set_checks_allowlist(self,runner_filter):
         if runner_filter.checks:
-            self.check_id_whitelist = runner_filter.checks
+            self.check_id_allowlist = runner_filter.checks
 
     @abstractmethod
     def extract_entity_details(self, entity):
@@ -45,19 +45,19 @@ def scan(self, scanned_file, entity, skipped_checks, runner_filter=None):
         (entity_type, entity_name, entity_configuration) = self.extract_entity_details(entity)
         results = {}
         checks = self.get_checks(entity_type)
-        check_id_whitelist = runner_filter.checks
-        check_id_blacklist = runner_filter.skip_checks
+        check_id_allowlist = runner_filter.checks
+        check_id_denylist = runner_filter.skip_checks
         for check in checks:
             skip_info = {}
             if skipped_checks:
                 if check.id in [x['id'] for x in skipped_checks]:
                     skip_info = [x for x in skipped_checks if x['id'] == check.id][0]
-            if check_id_whitelist:
-                if check.id in check_id_whitelist:
+            if check_id_allowlist:
+                if check.id in check_id_allowlist:
                     result = self.run_check(check, entity_configuration, entity_name, entity_type, scanned_file, skip_info)
                     results[check] = result
-            elif check_id_blacklist:
-                if check.id not in check_id_blacklist:
+            elif check_id_denylist:
+                if check.id not in check_id_denylist:
                     result = self.run_check(check, entity_configuration, entity_name, entity_type, scanned_file, skip_info)
                     results[check] = result
             else:
diff --git a/checkov/kubernetes/base_registry.py b/checkov/kubernetes/base_registry.py
--- a/checkov/kubernetes/base_registry.py
+++ b/checkov/kubernetes/base_registry.py
@@ -15,22 +15,22 @@ def scan(self, scanned_file, entity, skipped_checks, runner_filter=None):
         (entity_type, entity_configuration) = self.extract_entity_details(entity)
         results = {}
         checks = self.get_checks(entity_type)
-        check_id_whitelist = runner_filter.checks
-        check_id_blacklist = runner_filter.skip_checks
+        check_id_allowlist = runner_filter.checks
+        check_id_denylist = runner_filter.skip_checks
         for check in checks:
             skip_info = {}
             if skipped_checks:
                 if check.id in [x['id'] for x in skipped_checks]:
                     skip_info = [x for x in skipped_checks if x['id'] == check.id][0]
-            if check_id_whitelist:
-                if check.id in check_id_whitelist:
+            if check_id_allowlist:
+                if check.id in check_id_allowlist:
                     self.logger.debug("Running check: {} on file {}".format(check.name, scanned_file))
 
                     result = check.run(scanned_file=scanned_file, entity_configuration=entity_configuration,
                                        entity_name=entity_type, entity_type=entity_type, skip_info=skip_info)
                     results[check] = result
-            elif check_id_blacklist:
-                if check.id not in check_id_blacklist:
+            elif check_id_denylist:
+                if check.id not in check_id_denylist:
                     result = check.run(scanned_file=scanned_file, entity_configuration=entity_configuration,
                                        entity_name=entity_type, entity_type=entity_type, skip_info=skip_info)
                     results[check] = result
diff --git a/checkov/main.py b/checkov/main.py
--- a/checkov/main.py
+++ b/checkov/main.py
@@ -36,10 +36,10 @@ def run(banner=checkov_banner):
     parser.add_argument('--framework', help='filter scan to run only on a specific infrastructure code frameworks',
                         choices=['cloudformation', 'terraform', 'kubernetes', 'all'], default='all')
     parser.add_argument('-c', '--check',
-                        help='filter scan to run only on a specific check identifier(whitelist), You can '
+                        help='filter scan to run only on a specific check identifier(allowlist), You can '
                              'specify multiple checks separated by comma delimiter', default=None)
     parser.add_argument('--skip-check',
-                        help='filter scan to run on all check but a specific check identifier(blacklist), You can '
+                        help='filter scan to run on all check but a specific check identifier(denylist), You can '
                              'specify multiple checks separated by comma delimiter', default=None)
     parser.add_argument('-s', '--soft-fail',
                         help='Runs checks but suppresses error code', action='store_true')


Test patch:
diff --git a/tests/kubernetes/checks/example_ShareHost/jenkinsDeployment-PASSED.yaml b/tests/kubernetes/checks/example_ShareHost/jenkinsDeployment-PASSED.yaml
--- a/tests/kubernetes/checks/example_ShareHost/jenkinsDeployment-PASSED.yaml
+++ b/tests/kubernetes/checks/example_ShareHost/jenkinsDeployment-PASSED.yaml
@@ -99,7 +99,7 @@ spec:
             - containerPort: 8080
               name: http
             - containerPort: 50000
-              name: slavelistener
+              name: agentlistener
           livenessProbe:
             httpGet:
               path: "/login"
@@ -154,4 +154,4 @@ spec:
           emptyDir: {}
         - name: jenkins-home
           persistentVolumeClaim:
-            claimName: RELEASE-NAME-jenkins
\ No newline at end of file
+            claimName: RELEASE-NAME-jenkins
diff --git a/tests/terraform/runner/test_runner.py b/tests/terraform/runner/test_runner.py
--- a/tests/terraform/runner/test_runner.py
+++ b/tests/terraform/runner/test_runner.py
@@ -14,8 +14,8 @@ def test_runner_two_checks_only(self):
         current_dir = os.path.dirname(os.path.realpath(__file__))
         valid_dir_path = current_dir + "/resources/example"
         runner = Runner()
-        checks_whitelist = ['CKV_AWS_41', 'CKV_AZURE_1']
-        report = runner.run(root_folder=valid_dir_path, external_checks_dir=None, runner_filter=RunnerFilter(framework='all', checks=checks_whitelist))
+        checks_allowlist = ['CKV_AWS_41', 'CKV_AZURE_1']
+        report = runner.run(root_folder=valid_dir_path, external_checks_dir=None, runner_filter=RunnerFilter(framework='all', checks=checks_allowlist))
         report_json = report.get_json()
         self.assertTrue(isinstance(report_json, str))
         self.assertIsNotNone(report_json)
@@ -23,15 +23,15 @@ def test_runner_two_checks_only(self):
         self.assertEqual(report.get_exit_code(soft_fail=False), 1)
         self.assertEqual(report.get_exit_code(soft_fail=True), 0)
         for record in report.failed_checks:
-            self.assertIn(record.check_id, checks_whitelist)
+            self.assertIn(record.check_id, checks_allowlist)
 
-    def test_runner_blacklist_checks(self):
+    def test_runner_denylist_checks(self):
         current_dir = os.path.dirname(os.path.realpath(__file__))
         valid_dir_path = current_dir + "/resources/example"
         runner = Runner()
-        checks_blacklist = ['CKV_AWS_41', 'CKV_AZURE_1']
+        checks_denylist = ['CKV_AWS_41', 'CKV_AZURE_1']
         report = runner.run(root_folder=valid_dir_path, external_checks_dir=None,
-                            runner_filter=RunnerFilter(framework='all', skip_checks=checks_blacklist))
+                            runner_filter=RunnerFilter(framework='all', skip_checks=checks_denylist))
         report_json = report.get_json()
         self.assertTrue(isinstance(report_json, str))
         self.assertIsNotNone(report_json)
@@ -39,7 +39,7 @@ def test_runner_blacklist_checks(self):
         self.assertEqual(report.get_exit_code(soft_fail=False), 1)
         self.assertEqual(report.get_exit_code(soft_fail=True), 0)
         for record in report.failed_checks:
-            self.assertNotIn(record.check_id, checks_blacklist)
+            self.assertNotIn(record.check_id, checks_denylist)
 
     def test_runner_valid_tf(self):
         current_dir = os.path.dirname(os.path.realpath(__file__))