We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
crash introduce by https://github.com/bridgecrewio/checkov/pull/2356
**Describe the issue**

```
checkov -d test1/
```

**Examples**
test1/job.tf
```hcl
resource "aws_batch_job_definition" "foobar" {
  name                 = "foobar"
  type                 = "container"
  container_properties = file("${path.module}/job_definition.json")
}
```

**Exception Trace**
Please share the trace for the exception and all relevant output by checkov.
To maximize the understanding, please run checkov with LOG_LEVEL set to debug
as follows:
```sh
2022-02-08 16:55:00,816 [MainThread  ] [DEBUG]  Checkov version: 2.0.809
2022-02-08 16:55:00,816 [MainThread  ] [DEBUG]  Python executable: /usr/bin/python3
2022-02-08 16:55:00,816 [MainThread  ] [DEBUG]  Python version: 3.10.2 (main, Jan 17 2022, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)]
2022-02-08 16:55:00,816 [MainThread  ] [DEBUG]  Checkov executable (argv[0]): /home/foobar/.local/bin/checkov
2022-02-08 16:55:00,816 [MainThread  ] [DEBUG]  Command Line Args:   -d test1/
Config File (/home/foobar/git/production/.checkov.yaml):
  framework:         terraform
  baseline:          .checkov.baseline
  evaluate-variables:True
  compact:           True
  quiet:             True
Defaults:
  --branch:          master
  --download-external-modules:False
  --external-modules-download-path:.external_modules
  --min-cve-severity:none

2022-02-08 16:55:00,817 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): terraform
2022-02-08 16:55:00,817 [MainThread  ] [DEBUG]  terraform_runner declares no system dependency checks required.
2022-02-08 16:55:00,817 [MainThread  ] [DEBUG]  No API key found. Scanning locally only.
2022-02-08 16:55:01,377 [MainThread  ] [DEBUG]  Got checkov mappings from Bridgecrew BE
2022-02-08 16:55:01,378 [MainThread  ] [INFO ]  Scanning root folder and producing fresh tf_definitions and context
2022-02-08 16:55:01,378 [MainThread  ] [INFO ]  Parsing HCL files in source dir
2022-02-08 16:55:01,379 [MainThread  ] [DEBUG]  Parsing /home/foobar/git/production/test1/job.tf
2022-02-08 16:55:01,383 [MainThread  ] [DEBUG]  Module load loop 0
2022-02-08 16:55:01,384 [MainThread  ] [INFO ]  Building graph from parsed module
2022-02-08 16:55:01,384 [MainThread  ] [INFO ]  Creating vertices
2022-02-08 16:55:01,384 [MainThread  ] [INFO ]  Creating edges
2022-02-08 16:55:01,385 [MainThread  ] [INFO ]  Rendering variables, graph has 1 vertices and 0 edges
2022-02-08 16:55:01,385 [MainThread  ] [INFO ]  done evaluating edges
2022-02-08 16:55:01,385 [MainThread  ] [INFO ]  done evaluate_non_rendered_values
2022-02-08 16:55:01,386 [MainThread  ] [DEBUG]  created context for aws_batch_job_definition foobar
2022-02-08 16:55:01,386 [MainThread  ] [DEBUG]  Created definitions context
2022-02-08 16:55:01,386 [MainThread  ] [DEBUG]  Scanning file: /job.tf
2022-02-08 16:55:01,386 [MainThread  ] [DEBUG]  Running check: Batch job does not define a privileged container on file /job.tf
2022-02-08 16:55:01,386 [MainThread  ] [ERROR]  Failed to run check: Batch job does not define a privileged container for configuration: {'container_properties': ['file("path.module/job_definition.json")'], 'name': ['foobar'], 'type': ['container']} at file: /job.tf
Traceback (most recent call last):
  File "/home/foobar/.local/bin/checkov", line 9, in <module>
    sys.exit(run())
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/main.py", line 223, in run
    scan_reports = runner_registry.run(root_folder=root_folder, external_checks_dir=external_checks_dir,
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/common/runners/runner_registry.py", line 59, in run
    reports = [self.runners[0].run(root_folder, external_checks_dir=external_checks_dir, files=files,
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/runner.py", line 119, in run
    self.check_tf_definition(report, root_folder, runner_filter, collect_skip_comments)
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/runner.py", line 212, in check_tf_definition
    self.run_all_blocks(definition, self.context, full_file_path, root_folder, report,
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/runner.py", line 222, in run_all_blocks
    self.run_block(definition[block_type], definitions_context,
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/runner.py", line 294, in run_block
    results = registry.scan(scanned_file, entity, skipped_checks, runner_filter)
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/common/checks/base_check_registry.py", line 121, in scan
    result = self.run_check(check, entity_configuration, entity_name, entity_type, scanned_file, skip_info)
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/common/checks/base_check_registry.py", line 135, in run_check
    result = check.run(
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/common/checks/base_check.py", line 81, in run
    raise e
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/common/checks/base_check.py", line 68, in run
    check_result["result"] = self.scan_entity_conf(entity_configuration, entity_type)
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/checks/resource/base_resource_check.py", line 54, in scan_entity_conf
    return self.scan_resource_conf(conf)
  File "/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py", line 17, in scan_resource_conf
    container = json.loads(conf.get("container_properties")[0])
  File "/usr/lib64/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
```

**Desktop (please complete the following information):**
 - OS: Fedora 35
 - Checkov Version: 2.0.809

**Additional context**
This issue appears from https://github.com/bridgecrewio/checkov/pull/2356

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py`
Content:
```
1 import json
2 from checkov.common.models.enums import CheckResult, CheckCategories
3 from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
4 
5 
6 class BatchJobIsNotPrivileged(BaseResourceCheck):
7     def __init__(self):
8         name = "Batch job does not define a privileged container"
9         id = "CKV_AWS_210"
10         supported_resources = ['aws_batch_job_definition']
11         categories = [CheckCategories.GENERAL_SECURITY]
12         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
13 
14     def scan_resource_conf(self, conf):
15         if conf.get("container_properties"):
16             if type(conf.get("container_properties")[0]) is str:
17                 container = json.loads(conf.get("container_properties")[0])
18             else:
19                 container = conf.get("container_properties")[0]
20             if container.get("privileged"):
21                 return CheckResult.FAILED
22             return CheckResult.PASSED
23         return CheckResult.UNKNOWN
24 
25 
26 check = BatchJobIsNotPrivileged()
27
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py b/checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py
--- a/checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py
+++ b/checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py
@@ -14,7 +14,10 @@
     def scan_resource_conf(self, conf):
         if conf.get("container_properties"):
             if type(conf.get("container_properties")[0]) is str:
-                container = json.loads(conf.get("container_properties")[0])
+                try:
+                    container = json.loads(conf.get("container_properties")[0])
+                except json.JSONDecodeError as e:
+                    return CheckResult.UNKNOWN
             else:
                 container = conf.get("container_properties")[0]
             if container.get("privileged"):

{"golden_diff": "diff --git a/checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py b/checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py\n--- a/checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py\n+++ b/checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py\n@@ -14,7 +14,10 @@\n     def scan_resource_conf(self, conf):\n         if conf.get(\"container_properties\"):\n             if type(conf.get(\"container_properties\")[0]) is str:\n-                container = json.loads(conf.get(\"container_properties\")[0])\n+                try:\n+                    container = json.loads(conf.get(\"container_properties\")[0])\n+                except json.JSONDecodeError as e:\n+                    return CheckResult.UNKNOWN\n             else:\n                 container = conf.get(\"container_properties\")[0]\n             if container.get(\"privileged\"):\n", "issue": "crash introduce by https://github.com/bridgecrewio/checkov/pull/2356\n**Describe the issue**\r\n\r\n```\r\ncheckov -d test1/\r\n```\r\n\r\n**Examples**\r\ntest1/job.tf\r\n```hcl\r\nresource \"aws_batch_job_definition\" \"foobar\" {\r\n  name                 = \"foobar\"\r\n  type                 = \"container\"\r\n  container_properties = file(\"${path.module}/job_definition.json\")\r\n}\r\n```\r\n\r\n**Exception Trace**\r\nPlease share the trace for the exception and all relevant output by checkov.\r\nTo maximize the understanding, please run checkov with LOG_LEVEL set to debug\r\nas follows:\r\n```sh\r\n2022-02-08 16:55:00,816 [MainThread  ] [DEBUG]  Checkov version: 2.0.809\r\n2022-02-08 16:55:00,816 [MainThread  ] [DEBUG]  Python executable: /usr/bin/python3\r\n2022-02-08 16:55:00,816 [MainThread  ] [DEBUG]  Python version: 3.10.2 (main, Jan 17 2022, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)]\r\n2022-02-08 16:55:00,816 [MainThread  ] [DEBUG]  Checkov executable (argv[0]): /home/foobar/.local/bin/checkov\r\n2022-02-08 16:55:00,816 [MainThread  ] [DEBUG]  Command Line Args:   -d test1/\r\nConfig File (/home/foobar/git/production/.checkov.yaml):\r\n  framework:         terraform\r\n  baseline:          .checkov.baseline\r\n  evaluate-variables:True\r\n  compact:           True\r\n  quiet:             True\r\nDefaults:\r\n  --branch:          master\r\n  --download-external-modules:False\r\n  --external-modules-download-path:.external_modules\r\n  --min-cve-severity:none\r\n\r\n2022-02-08 16:55:00,817 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): terraform\r\n2022-02-08 16:55:00,817 [MainThread  ] [DEBUG]  terraform_runner declares no system dependency checks required.\r\n2022-02-08 16:55:00,817 [MainThread  ] [DEBUG]  No API key found. Scanning locally only.\r\n2022-02-08 16:55:01,377 [MainThread  ] [DEBUG]  Got checkov mappings from Bridgecrew BE\r\n2022-02-08 16:55:01,378 [MainThread  ] [INFO ]  Scanning root folder and producing fresh tf_definitions and context\r\n2022-02-08 16:55:01,378 [MainThread  ] [INFO ]  Parsing HCL files in source dir\r\n2022-02-08 16:55:01,379 [MainThread  ] [DEBUG]  Parsing /home/foobar/git/production/test1/job.tf\r\n2022-02-08 16:55:01,383 [MainThread  ] [DEBUG]  Module load loop 0\r\n2022-02-08 16:55:01,384 [MainThread  ] [INFO ]  Building graph from parsed module\r\n2022-02-08 16:55:01,384 [MainThread  ] [INFO ]  Creating vertices\r\n2022-02-08 16:55:01,384 [MainThread  ] [INFO ]  Creating edges\r\n2022-02-08 16:55:01,385 [MainThread  ] [INFO ]  Rendering variables, graph has 1 vertices and 0 edges\r\n2022-02-08 16:55:01,385 [MainThread  ] [INFO ]  done evaluating edges\r\n2022-02-08 16:55:01,385 [MainThread  ] [INFO ]  done evaluate_non_rendered_values\r\n2022-02-08 16:55:01,386 [MainThread  ] [DEBUG]  created context for aws_batch_job_definition foobar\r\n2022-02-08 16:55:01,386 [MainThread  ] [DEBUG]  Created definitions context\r\n2022-02-08 16:55:01,386 [MainThread  ] [DEBUG]  Scanning file: /job.tf\r\n2022-02-08 16:55:01,386 [MainThread  ] [DEBUG]  Running check: Batch job does not define a privileged container on file /job.tf\r\n2022-02-08 16:55:01,386 [MainThread  ] [ERROR]  Failed to run check: Batch job does not define a privileged container for configuration: {'container_properties': ['file(\"path.module/job_definition.json\")'], 'name': ['foobar'], 'type': ['container']} at file: /job.tf\r\nTraceback (most recent call last):\r\n  File \"/home/foobar/.local/bin/checkov\", line 9, in <module>\r\n    sys.exit(run())\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/main.py\", line 223, in run\r\n    scan_reports = runner_registry.run(root_folder=root_folder, external_checks_dir=external_checks_dir,\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/common/runners/runner_registry.py\", line 59, in run\r\n    reports = [self.runners[0].run(root_folder, external_checks_dir=external_checks_dir, files=files,\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/runner.py\", line 119, in run\r\n    self.check_tf_definition(report, root_folder, runner_filter, collect_skip_comments)\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/runner.py\", line 212, in check_tf_definition\r\n    self.run_all_blocks(definition, self.context, full_file_path, root_folder, report,\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/runner.py\", line 222, in run_all_blocks\r\n    self.run_block(definition[block_type], definitions_context,\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/runner.py\", line 294, in run_block\r\n    results = registry.scan(scanned_file, entity, skipped_checks, runner_filter)\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/common/checks/base_check_registry.py\", line 121, in scan\r\n    result = self.run_check(check, entity_configuration, entity_name, entity_type, scanned_file, skip_info)\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/common/checks/base_check_registry.py\", line 135, in run_check\r\n    result = check.run(\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/common/checks/base_check.py\", line 81, in run\r\n    raise e\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/common/checks/base_check.py\", line 68, in run\r\n    check_result[\"result\"] = self.scan_entity_conf(entity_configuration, entity_type)\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/checks/resource/base_resource_check.py\", line 54, in scan_entity_conf\r\n    return self.scan_resource_conf(conf)\r\n  File \"/home/foobar/.local/lib/python3.10/site-packages/checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py\", line 17, in scan_resource_conf\r\n    container = json.loads(conf.get(\"container_properties\")[0])\r\n  File \"/usr/lib64/python3.10/json/__init__.py\", line 346, in loads\r\n    return _default_decoder.decode(s)\r\n  File \"/usr/lib64/python3.10/json/decoder.py\", line 337, in decode\r\n    obj, end = self.raw_decode(s, idx=_w(s, 0).end())\r\n  File \"/usr/lib64/python3.10/json/decoder.py\", line 355, in raw_decode\r\n    raise JSONDecodeError(\"Expecting value\", s, err.value) from None\r\njson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\r\n```\r\n\r\n**Desktop (please complete the following information):**\r\n - OS: Fedora 35\r\n - Checkov Version: 2.0.809\r\n\r\n**Additional context**\r\nThis issue appears from https://github.com/bridgecrewio/checkov/pull/2356\n", "before_files": [{"content": "import json\nfrom checkov.common.models.enums import CheckResult, CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n\nclass BatchJobIsNotPrivileged(BaseResourceCheck):\n    def __init__(self):\n        name = \"Batch job does not define a privileged container\"\n        id = \"CKV_AWS_210\"\n        supported_resources = ['aws_batch_job_definition']\n        categories = [CheckCategories.GENERAL_SECURITY]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf):\n        if conf.get(\"container_properties\"):\n            if type(conf.get(\"container_properties\")[0]) is str:\n                container = json.loads(conf.get(\"container_properties\")[0])\n            else:\n                container = conf.get(\"container_properties\")[0]\n            if container.get(\"privileged\"):\n                return CheckResult.FAILED\n            return CheckResult.PASSED\n        return CheckResult.UNKNOWN\n\n\ncheck = BatchJobIsNotPrivileged()\n", "path": "checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py"}], "after_files": [{"content": "import json\nfrom checkov.common.models.enums import CheckResult, CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n\nclass BatchJobIsNotPrivileged(BaseResourceCheck):\n    def __init__(self):\n        name = \"Batch job does not define a privileged container\"\n        id = \"CKV_AWS_210\"\n        supported_resources = ['aws_batch_job_definition']\n        categories = [CheckCategories.GENERAL_SECURITY]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf):\n        if conf.get(\"container_properties\"):\n            if type(conf.get(\"container_properties\")[0]) is str:\n                try:\n                    container = json.loads(conf.get(\"container_properties\")[0])\n                except json.JSONDecodeError as e:\n                    return CheckResult.UNKNOWN\n            else:\n                container = conf.get(\"container_properties\")[0]\n            if container.get(\"privileged\"):\n                return CheckResult.FAILED\n            return CheckResult.PASSED\n        return CheckResult.UNKNOWN\n\n\ncheck = BatchJobIsNotPrivileged()\n", "path": "checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py"}]}