We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ERROR]  Failed to run check: Ensure Application Gateway WAF prevents message lookup in Log4j2.
**Describe the issue**
While performing checkov scan on our terraform dir, we are running into this error:

`2022-07-18 10:09:32,794 [MainThread  ] [ERROR]  Failed to run check: Ensure Application Gateway WAF prevents message lookup in Log4j2. See CVE-2021-44228 aka log4jshell for configuration: {'custom_rules': [[]], 'location': ['westeurope'], 'managed_rules': [{'exclusion': [[]], 'managed_rule_set': [{'rule_group_override': [[]], 'type': ['OWASP'], 'version': ['3.1'], '__startline__': [1], '__endline__': [1], 'start_line': [0], 'end_line': [0]}], '__startline__': [1], '__endline__': [1], 'start_line': [0], 'end_line': [0]}], 'name': ['waf-acc-weu-001'], 'policy_settings': [{'enabled': [True], 'file_upload_limit_in_mb': [100], 'max_request_body_size_in_kb': [128], 'mode': ['Prevention'], 'request_body_check': [True], '__startline__': [1], '__endline__': [1], 'start_line': [0], 'end_line': [0]}], 'resource_group_name': ['rg-acceptance-weu-001'], 'tags': [None], 'timeouts': [None], '__startline__': [1], '__endline__': [1], 'start_line': [0], 'end_line': [0], 'references_': ['data.azurerm_resource_group.resourcegroup.name', 'data.azurerm_resource_group.resourcegroup'], '__address__': 'azurerm_web_application_firewall_policy.agw_waf_policy_aks_acc'} at file: /tf/plan.json`

**Examples**
When looking into this page: https://docs.bridgecrew.io/docs/ensure-application-gateway-waf-prevents-message-lookup-in-log4j2, we saw a code example, but the thing is, we have exactly the same code,:

```
resource "azurerm_web_application_firewall_policy" "agw_waf_policy_aks_acc" {
  name                = "waf-acc-weu-001"
  resource_group_name = data.azurerm_resource_group.kbc_acc_resourcegroup.name
  location            = var.location

  policy_settings {
    enabled                     = true
    mode                        = "Prevention"
    request_body_check          = true
    # Set to 200 because ...
    file_upload_limit_in_mb     = 200
    # Set to 2000 because ...
    max_request_body_size_in_kb = 2000
  }

  managed_rules 

    managed_rule_set {
      type    = "OWASP"
      version = "3.2"
      }
    }
  }
}

```

**Version (please complete the following information):**
 - bridgecrew/checkov docker image without version specified

**Additional context**
Traceback:

```
Process ForkProcess-6:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/local/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/site-packages/checkov/common/parallelizer/parallel_runner.py", line 37, in func_wrapper
    result = original_func(item)
  File "/usr/local/lib/python3.8/site-packages/checkov/common/runners/runner_registry.py", line 76, in _parallel_run
    return runner.run(
  File "/usr/local/lib/python3.8/site-packages/checkov/terraform/plan_runner.py", line 72, in run
    self.check_tf_definition(report, root_folder, runner_filter)
  File "/usr/local/lib/python3.8/site-packages/checkov/terraform/plan_runner.py", line 90, in check_tf_definition
    self.run_block(definition[block_type], None, full_file_path, root_folder, report, scanned_file,
  File "/usr/local/lib/python3.8/site-packages/checkov/terraform/plan_runner.py", line 110, in run_block
    results = registry.scan(scanned_file, entity, [], runner_filter)
  File "/usr/local/lib/python3.8/site-packages/checkov/common/checks/base_check_registry.py", line 124, in scan
    result = self.run_check(check, entity_configuration, entity_name, entity_type, scanned_file, skip_info)
  File "/usr/local/lib/python3.8/site-packages/checkov/common/checks/base_check_registry.py", line 138, in run_check
    result = check.run(
  File "/usr/local/lib/python3.8/site-packages/checkov/common/checks/base_check.py", line 75, in run
    check_result["result"] = self.scan_entity_conf(entity_configuration, entity_type)
  File "/usr/local/lib/python3.8/site-packages/checkov/terraform/checks/resource/base_resource_check.py", line 43, in scan_entity_conf
    return self.scan_resource_conf(conf)
  File "/usr/local/lib/python3.8/site-packages/checkov/terraform/checks/resource/azure/AppGatewayWAFACLCVE202144228.py", line 35, in scan_resource_conf
    if rule_override.get("rule_group_name") == ["REQUEST-944-APPLICATION-ATTACK-JAVA"]:
  File "/usr/local/lib/python3.8/site-packages/checkov/common/parsers/node.py", line 189, in __getattr__
    raise TemplateAttributeError(f'{name} is invalid')
checkov.common.parsers.node.TemplateAttributeError: get is invalid

```

--- 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/azure/AppGatewayWAFACLCVE202144228.py`
Content:
```
1 from typing import Dict, Any
2 
3 from checkov.common.models.enums import CheckCategories, CheckResult
4 from checkov.common.util.type_forcers import force_list
5 from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
6 
7 
8 class AppGatewayWAFACLCVE202144228(BaseResourceCheck):
9     def __init__(self) -> None:
10         name = "Ensure Application Gateway WAF prevents message lookup in Log4j2. See CVE-2021-44228 aka log4jshell"
11         id = "CKV_AZURE_135"
12         supported_resources = ("azurerm_web_application_firewall_policy",)
13         categories = (CheckCategories.APPLICATION_SECURITY,)
14         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
15 
16     def scan_resource_conf(self, conf: Dict[str, Any]) -> CheckResult:
17         self.evaluated_keys = ["managed_rules"]
18         managed_rules = conf.get("managed_rules")
19         if managed_rules:
20             managed_rule_sets = managed_rules[0].get("managed_rule_set") or []
21             for idx_rule_set, rule_set in enumerate(force_list(managed_rule_sets)):
22                 self.evaluated_keys = [
23                     f"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/type",
24                     f"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/version",
25                 ]
26                 if rule_set.get("type", ["OWASP"]) == ["OWASP"] and rule_set.get("version") in (["3.1"], ["3.2"]):
27                     rule_overrides = rule_set.get("rule_group_override") or []
28                     for idx_override, rule_override in enumerate(force_list(rule_overrides)):
29                         self.evaluated_keys.extend(
30                             [
31                                 f"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/rule_group_override/[{idx_override}]/rule_group_name",
32                                 f"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/rule_group_override/[{idx_override}]/disabled_rules",
33                             ]
34                         )
35                         if rule_override.get("rule_group_name") == ["REQUEST-944-APPLICATION-ATTACK-JAVA"]:
36                             disabled_rules = rule_override.get("disabled_rules") or []
37                             if isinstance(disabled_rules, list) and "944240" in force_list(disabled_rules[0]):
38                                 return CheckResult.FAILED
39 
40                     return CheckResult.PASSED
41 
42         return CheckResult.FAILED
43 
44 
45 check = AppGatewayWAFACLCVE202144228()
46
```
--- 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/azure/AppGatewayWAFACLCVE202144228.py b/checkov/terraform/checks/resource/azure/AppGatewayWAFACLCVE202144228.py
--- a/checkov/terraform/checks/resource/azure/AppGatewayWAFACLCVE202144228.py
+++ b/checkov/terraform/checks/resource/azure/AppGatewayWAFACLCVE202144228.py
@@ -32,7 +32,7 @@
                                 f"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/rule_group_override/[{idx_override}]/disabled_rules",
                             ]
                         )
-                        if rule_override.get("rule_group_name") == ["REQUEST-944-APPLICATION-ATTACK-JAVA"]:
+                        if isinstance(rule_override, dict) and rule_override.get("rule_group_name") == ["REQUEST-944-APPLICATION-ATTACK-JAVA"]:
                             disabled_rules = rule_override.get("disabled_rules") or []
                             if isinstance(disabled_rules, list) and "944240" in force_list(disabled_rules[0]):
                                 return CheckResult.FAILED

{"golden_diff": "diff --git a/checkov/terraform/checks/resource/azure/AppGatewayWAFACLCVE202144228.py b/checkov/terraform/checks/resource/azure/AppGatewayWAFACLCVE202144228.py\n--- a/checkov/terraform/checks/resource/azure/AppGatewayWAFACLCVE202144228.py\n+++ b/checkov/terraform/checks/resource/azure/AppGatewayWAFACLCVE202144228.py\n@@ -32,7 +32,7 @@\n                                 f\"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/rule_group_override/[{idx_override}]/disabled_rules\",\n                             ]\n                         )\n-                        if rule_override.get(\"rule_group_name\") == [\"REQUEST-944-APPLICATION-ATTACK-JAVA\"]:\n+                        if isinstance(rule_override, dict) and rule_override.get(\"rule_group_name\") == [\"REQUEST-944-APPLICATION-ATTACK-JAVA\"]:\n                             disabled_rules = rule_override.get(\"disabled_rules\") or []\n                             if isinstance(disabled_rules, list) and \"944240\" in force_list(disabled_rules[0]):\n                                 return CheckResult.FAILED\n", "issue": "[ERROR]  Failed to run check: Ensure Application Gateway WAF prevents message lookup in Log4j2.\n**Describe the issue**\r\nWhile performing checkov scan on our terraform dir, we are running into this error:\r\n\r\n`2022-07-18 10:09:32,794 [MainThread  ] [ERROR]  Failed to run check: Ensure Application Gateway WAF prevents message lookup in Log4j2. See CVE-2021-44228 aka log4jshell for configuration: {'custom_rules': [[]], 'location': ['westeurope'], 'managed_rules': [{'exclusion': [[]], 'managed_rule_set': [{'rule_group_override': [[]], 'type': ['OWASP'], 'version': ['3.1'], '__startline__': [1], '__endline__': [1], 'start_line': [0], 'end_line': [0]}], '__startline__': [1], '__endline__': [1], 'start_line': [0], 'end_line': [0]}], 'name': ['waf-acc-weu-001'], 'policy_settings': [{'enabled': [True], 'file_upload_limit_in_mb': [100], 'max_request_body_size_in_kb': [128], 'mode': ['Prevention'], 'request_body_check': [True], '__startline__': [1], '__endline__': [1], 'start_line': [0], 'end_line': [0]}], 'resource_group_name': ['rg-acceptance-weu-001'], 'tags': [None], 'timeouts': [None], '__startline__': [1], '__endline__': [1], 'start_line': [0], 'end_line': [0], 'references_': ['data.azurerm_resource_group.resourcegroup.name', 'data.azurerm_resource_group.resourcegroup'], '__address__': 'azurerm_web_application_firewall_policy.agw_waf_policy_aks_acc'} at file: /tf/plan.json`\r\n\r\n**Examples**\r\nWhen looking into this page: https://docs.bridgecrew.io/docs/ensure-application-gateway-waf-prevents-message-lookup-in-log4j2, we saw a code example, but the thing is, we have exactly the same code,:\r\n\r\n```\r\nresource \"azurerm_web_application_firewall_policy\" \"agw_waf_policy_aks_acc\" {\r\n  name                = \"waf-acc-weu-001\"\r\n  resource_group_name = data.azurerm_resource_group.kbc_acc_resourcegroup.name\r\n  location            = var.location\r\n\r\n  policy_settings {\r\n    enabled                     = true\r\n    mode                        = \"Prevention\"\r\n    request_body_check          = true\r\n    # Set to 200 because ...\r\n    file_upload_limit_in_mb     = 200\r\n    # Set to 2000 because ...\r\n    max_request_body_size_in_kb = 2000\r\n  }\r\n\r\n  managed_rules \r\n\r\n    managed_rule_set {\r\n      type    = \"OWASP\"\r\n      version = \"3.2\"\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n```\r\n\r\n**Version (please complete the following information):**\r\n - bridgecrew/checkov docker image without version specified\r\n\r\n**Additional context**\r\nTraceback:\r\n\r\n```\r\nProcess ForkProcess-6:\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.8/multiprocessing/process.py\", line 315, in _bootstrap\r\n    self.run()\r\n  File \"/usr/local/lib/python3.8/multiprocessing/process.py\", line 108, in run\r\n    self._target(*self._args, **self._kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/checkov/common/parallelizer/parallel_runner.py\", line 37, in func_wrapper\r\n    result = original_func(item)\r\n  File \"/usr/local/lib/python3.8/site-packages/checkov/common/runners/runner_registry.py\", line 76, in _parallel_run\r\n    return runner.run(\r\n  File \"/usr/local/lib/python3.8/site-packages/checkov/terraform/plan_runner.py\", line 72, in run\r\n    self.check_tf_definition(report, root_folder, runner_filter)\r\n  File \"/usr/local/lib/python3.8/site-packages/checkov/terraform/plan_runner.py\", line 90, in check_tf_definition\r\n    self.run_block(definition[block_type], None, full_file_path, root_folder, report, scanned_file,\r\n  File \"/usr/local/lib/python3.8/site-packages/checkov/terraform/plan_runner.py\", line 110, in run_block\r\n    results = registry.scan(scanned_file, entity, [], runner_filter)\r\n  File \"/usr/local/lib/python3.8/site-packages/checkov/common/checks/base_check_registry.py\", line 124, in scan\r\n    result = self.run_check(check, entity_configuration, entity_name, entity_type, scanned_file, skip_info)\r\n  File \"/usr/local/lib/python3.8/site-packages/checkov/common/checks/base_check_registry.py\", line 138, in run_check\r\n    result = check.run(\r\n  File \"/usr/local/lib/python3.8/site-packages/checkov/common/checks/base_check.py\", line 75, in run\r\n    check_result[\"result\"] = self.scan_entity_conf(entity_configuration, entity_type)\r\n  File \"/usr/local/lib/python3.8/site-packages/checkov/terraform/checks/resource/base_resource_check.py\", line 43, in scan_entity_conf\r\n    return self.scan_resource_conf(conf)\r\n  File \"/usr/local/lib/python3.8/site-packages/checkov/terraform/checks/resource/azure/AppGatewayWAFACLCVE202144228.py\", line 35, in scan_resource_conf\r\n    if rule_override.get(\"rule_group_name\") == [\"REQUEST-944-APPLICATION-ATTACK-JAVA\"]:\r\n  File \"/usr/local/lib/python3.8/site-packages/checkov/common/parsers/node.py\", line 189, in __getattr__\r\n    raise TemplateAttributeError(f'{name} is invalid')\r\ncheckov.common.parsers.node.TemplateAttributeError: get is invalid\r\n\r\n```\n", "before_files": [{"content": "from typing import Dict, Any\n\nfrom checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.common.util.type_forcers import force_list\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n\nclass AppGatewayWAFACLCVE202144228(BaseResourceCheck):\n    def __init__(self) -> None:\n        name = \"Ensure Application Gateway WAF prevents message lookup in Log4j2. See CVE-2021-44228 aka log4jshell\"\n        id = \"CKV_AZURE_135\"\n        supported_resources = (\"azurerm_web_application_firewall_policy\",)\n        categories = (CheckCategories.APPLICATION_SECURITY,)\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf: Dict[str, Any]) -> CheckResult:\n        self.evaluated_keys = [\"managed_rules\"]\n        managed_rules = conf.get(\"managed_rules\")\n        if managed_rules:\n            managed_rule_sets = managed_rules[0].get(\"managed_rule_set\") or []\n            for idx_rule_set, rule_set in enumerate(force_list(managed_rule_sets)):\n                self.evaluated_keys = [\n                    f\"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/type\",\n                    f\"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/version\",\n                ]\n                if rule_set.get(\"type\", [\"OWASP\"]) == [\"OWASP\"] and rule_set.get(\"version\") in ([\"3.1\"], [\"3.2\"]):\n                    rule_overrides = rule_set.get(\"rule_group_override\") or []\n                    for idx_override, rule_override in enumerate(force_list(rule_overrides)):\n                        self.evaluated_keys.extend(\n                            [\n                                f\"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/rule_group_override/[{idx_override}]/rule_group_name\",\n                                f\"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/rule_group_override/[{idx_override}]/disabled_rules\",\n                            ]\n                        )\n                        if rule_override.get(\"rule_group_name\") == [\"REQUEST-944-APPLICATION-ATTACK-JAVA\"]:\n                            disabled_rules = rule_override.get(\"disabled_rules\") or []\n                            if isinstance(disabled_rules, list) and \"944240\" in force_list(disabled_rules[0]):\n                                return CheckResult.FAILED\n\n                    return CheckResult.PASSED\n\n        return CheckResult.FAILED\n\n\ncheck = AppGatewayWAFACLCVE202144228()\n", "path": "checkov/terraform/checks/resource/azure/AppGatewayWAFACLCVE202144228.py"}], "after_files": [{"content": "from typing import Dict, Any\n\nfrom checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.common.util.type_forcers import force_list\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n\nclass AppGatewayWAFACLCVE202144228(BaseResourceCheck):\n    def __init__(self) -> None:\n        name = \"Ensure Application Gateway WAF prevents message lookup in Log4j2. See CVE-2021-44228 aka log4jshell\"\n        id = \"CKV_AZURE_135\"\n        supported_resources = (\"azurerm_web_application_firewall_policy\",)\n        categories = (CheckCategories.APPLICATION_SECURITY,)\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf: Dict[str, Any]) -> CheckResult:\n        self.evaluated_keys = [\"managed_rules\"]\n        managed_rules = conf.get(\"managed_rules\")\n        if managed_rules:\n            managed_rule_sets = managed_rules[0].get(\"managed_rule_set\") or []\n            for idx_rule_set, rule_set in enumerate(force_list(managed_rule_sets)):\n                self.evaluated_keys = [\n                    f\"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/type\",\n                    f\"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/version\",\n                ]\n                if rule_set.get(\"type\", [\"OWASP\"]) == [\"OWASP\"] and rule_set.get(\"version\") in ([\"3.1\"], [\"3.2\"]):\n                    rule_overrides = rule_set.get(\"rule_group_override\") or []\n                    for idx_override, rule_override in enumerate(force_list(rule_overrides)):\n                        self.evaluated_keys.extend(\n                            [\n                                f\"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/rule_group_override/[{idx_override}]/rule_group_name\",\n                                f\"managed_rules/[0]/managed_rule_set[{idx_rule_set}]/rule_group_override/[{idx_override}]/disabled_rules\",\n                            ]\n                        )\n                        if isinstance(rule_override, dict) and rule_override.get(\"rule_group_name\") == [\"REQUEST-944-APPLICATION-ATTACK-JAVA\"]:\n                            disabled_rules = rule_override.get(\"disabled_rules\") or []\n                            if isinstance(disabled_rules, list) and \"944240\" in force_list(disabled_rules[0]):\n                                return CheckResult.FAILED\n\n                    return CheckResult.PASSED\n\n        return CheckResult.FAILED\n\n\ncheck = AppGatewayWAFACLCVE202144228()\n", "path": "checkov/terraform/checks/resource/azure/AppGatewayWAFACLCVE202144228.py"}]}