We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`CKV_AZURE_4` cannot work with AzureRM 3.0 provider
**Describe the issue**

Scan an aks resource with AzrueRM 3.0 provider will get the following false error:

```text
terraform scan results:

Passed checks: 0, Failed checks: 1, Skipped checks: 0

Check: CKV_AZURE_4: "Ensure AKS logging to Azure Monitoring is Configured"
        FAILED for resource: azurerm_kubernetes_cluster.example
        File: /main.tf:35-58
        Guide: https://docs.bridgecrew.io/docs/bc_azr_kubernetes_1

                35 | resource "azurerm_kubernetes_cluster" "example" {
                36 |   name                = "example-aks1"
                37 |   location            = azurerm_resource_group.example.location
                38 |   resource_group_name = azurerm_resource_group.example.name
                39 |   dns_prefix          = "exampleaks1"
                40 |
                41 |   default_node_pool {
                42 |     name       = "default"
                43 |     node_count = 1
                44 |     vm_size    = "Standard_D2_v2"
                45 |   }
                46 |
                47 |   oms_agent {
                48 |     log_analytics_workspace_id = azurerm_log_analytics_workspace.main.id
                49 |   }
                50 |
                51 |   identity {
                52 |     type = "SystemAssigned"
                53 |   }
                54 |
                55 |   tags = {
                56 |     Environment = "Production"
                57 |   }
                58 | }
```

**Examples**
```hcl
variable "admin_user" {
  default = null
}

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "example" {
  location = "eastus"
  name     = "checkov-dynamic"
}

resource "azurerm_log_analytics_workspace" "main" {
  name                = "workspace"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku                 = "PerGB2018"
  retention_in_days   = 7
}

resource "azurerm_log_analytics_solution" "main" {
  solution_name         = "ContainerInsights"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  workspace_resource_id = azurerm_log_analytics_workspace.main[0].id
  workspace_name        = azurerm_log_analytics_workspace.main[0].name

  plan {
    publisher = "Microsoft"
    product   = "OMSGallery/ContainerInsights"
  }
}

resource "azurerm_kubernetes_cluster" "example" {
  name                = "example-aks1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  dns_prefix          = "exampleaks1"

  default_node_pool {
    name       = "default"
    node_count = 1
    vm_size    = "Standard_D2_v2"
  }

  oms_agent {
    log_analytics_workspace_id = azurerm_log_analytics_workspace.main.id
  }

  identity {
    type = "SystemAssigned"
  }

  tags = {
    Environment = "Production"
  }
}
```

**Version (please complete the following information):**
 - 2.1.20

**Additional context**

The [current implemention](https://github.com/bridgecrewio/checkov/blob/master/checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py#L13-L14) are based on 2.x and not work for 3.x.

`CKV_AZURE_4` cannot work with AzureRM 3.0 provider
**Describe the issue**

Scan an aks resource with AzrueRM 3.0 provider will get the following false error:

```text
terraform scan results:

Passed checks: 0, Failed checks: 1, Skipped checks: 0

Check: CKV_AZURE_4: "Ensure AKS logging to Azure Monitoring is Configured"
        FAILED for resource: azurerm_kubernetes_cluster.example
        File: /main.tf:35-58
        Guide: https://docs.bridgecrew.io/docs/bc_azr_kubernetes_1

                35 | resource "azurerm_kubernetes_cluster" "example" {
                36 |   name                = "example-aks1"
                37 |   location            = azurerm_resource_group.example.location
                38 |   resource_group_name = azurerm_resource_group.example.name
                39 |   dns_prefix          = "exampleaks1"
                40 |
                41 |   default_node_pool {
                42 |     name       = "default"
                43 |     node_count = 1
                44 |     vm_size    = "Standard_D2_v2"
                45 |   }
                46 |
                47 |   oms_agent {
                48 |     log_analytics_workspace_id = azurerm_log_analytics_workspace.main.id
                49 |   }
                50 |
                51 |   identity {
                52 |     type = "SystemAssigned"
                53 |   }
                54 |
                55 |   tags = {
                56 |     Environment = "Production"
                57 |   }
                58 | }
```

**Examples**
```hcl
variable "admin_user" {
  default = null
}

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "example" {
  location = "eastus"
  name     = "checkov-dynamic"
}

resource "azurerm_log_analytics_workspace" "main" {
  name                = "workspace"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku                 = "PerGB2018"
  retention_in_days   = 7
}

resource "azurerm_log_analytics_solution" "main" {
  solution_name         = "ContainerInsights"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  workspace_resource_id = azurerm_log_analytics_workspace.main[0].id
  workspace_name        = azurerm_log_analytics_workspace.main[0].name

  plan {
    publisher = "Microsoft"
    product   = "OMSGallery/ContainerInsights"
  }
}

resource "azurerm_kubernetes_cluster" "example" {
  name                = "example-aks1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  dns_prefix          = "exampleaks1"

  default_node_pool {
    name       = "default"
    node_count = 1
    vm_size    = "Standard_D2_v2"
  }

  oms_agent {
    log_analytics_workspace_id = azurerm_log_analytics_workspace.main.id
  }

  identity {
    type = "SystemAssigned"
  }

  tags = {
    Environment = "Production"
  }
}
```

**Version (please complete the following information):**
 - 2.1.20

**Additional context**

The [current implemention](https://github.com/bridgecrewio/checkov/blob/master/checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py#L13-L14) are based on 2.x and not work for 3.x.


--- 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/AKSLoggingEnabled.py`
Content:
```
1 from checkov.common.models.enums import CheckCategories
2 from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
3 
4 
5 class AKSLoggingEnabled(BaseResourceValueCheck):
6     def __init__(self):
7         name = "Ensure AKS logging to Azure Monitoring is Configured"
8         id = "CKV_AZURE_4"
9         supported_resources = ['azurerm_kubernetes_cluster']
10         categories = [CheckCategories.KUBERNETES]
11         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
12 
13     def get_inspected_key(self):
14         return "addon_profile/[0]/oms_agent/[0]/enabled"
15 
16 
17 check = AKSLoggingEnabled()
18
```
--- 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/AKSLoggingEnabled.py b/checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py
--- a/checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py
+++ b/checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py
@@ -1,8 +1,10 @@
-from checkov.common.models.enums import CheckCategories
-from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
+import dpath
 
+from checkov.common.models.enums import CheckCategories, CheckResult
+from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceCheck
 
-class AKSLoggingEnabled(BaseResourceValueCheck):
+
+class AKSLoggingEnabled(BaseResourceCheck):
     def __init__(self):
         name = "Ensure AKS logging to Azure Monitoring is Configured"
         id = "CKV_AZURE_4"
@@ -10,8 +12,17 @@
         categories = [CheckCategories.KUBERNETES]
         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
 
-    def get_inspected_key(self):
-        return "addon_profile/[0]/oms_agent/[0]/enabled"
+    def scan_resource_conf(self, conf):
+        provider_version_2_path = "addon_profile/[0]/oms_agent/[0]/enabled"
+        provider_version_3_path = "oms_agent/[0]"
+        if dpath.search(conf, provider_version_2_path) and dpath.get(conf, provider_version_2_path)[0]:
+            self.evaluated_keys = [provider_version_2_path]
+            return CheckResult.PASSED
+        elif dpath.search(conf, provider_version_3_path):
+            self.evaluated_keys = [provider_version_3_path]
+            return CheckResult.PASSED
+
+        return CheckResult.FAILED
 
 
 check = AKSLoggingEnabled()

{"golden_diff": "diff --git a/checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py b/checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py\n--- a/checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py\n+++ b/checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py\n@@ -1,8 +1,10 @@\n-from checkov.common.models.enums import CheckCategories\n-from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck\n+import dpath\n \n+from checkov.common.models.enums import CheckCategories, CheckResult\n+from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceCheck\n \n-class AKSLoggingEnabled(BaseResourceValueCheck):\n+\n+class AKSLoggingEnabled(BaseResourceCheck):\n     def __init__(self):\n         name = \"Ensure AKS logging to Azure Monitoring is Configured\"\n         id = \"CKV_AZURE_4\"\n@@ -10,8 +12,17 @@\n         categories = [CheckCategories.KUBERNETES]\n         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n \n-    def get_inspected_key(self):\n-        return \"addon_profile/[0]/oms_agent/[0]/enabled\"\n+    def scan_resource_conf(self, conf):\n+        provider_version_2_path = \"addon_profile/[0]/oms_agent/[0]/enabled\"\n+        provider_version_3_path = \"oms_agent/[0]\"\n+        if dpath.search(conf, provider_version_2_path) and dpath.get(conf, provider_version_2_path)[0]:\n+            self.evaluated_keys = [provider_version_2_path]\n+            return CheckResult.PASSED\n+        elif dpath.search(conf, provider_version_3_path):\n+            self.evaluated_keys = [provider_version_3_path]\n+            return CheckResult.PASSED\n+\n+        return CheckResult.FAILED\n \n \n check = AKSLoggingEnabled()\n", "issue": "`CKV_AZURE_4` cannot work with AzureRM 3.0 provider\n**Describe the issue**\r\n\r\nScan an aks resource with AzrueRM 3.0 provider will get the following false error:\r\n\r\n```text\r\nterraform scan results:\r\n\r\nPassed checks: 0, Failed checks: 1, Skipped checks: 0\r\n\r\nCheck: CKV_AZURE_4: \"Ensure AKS logging to Azure Monitoring is Configured\"\r\n        FAILED for resource: azurerm_kubernetes_cluster.example\r\n        File: /main.tf:35-58\r\n        Guide: https://docs.bridgecrew.io/docs/bc_azr_kubernetes_1\r\n\r\n                35 | resource \"azurerm_kubernetes_cluster\" \"example\" {\r\n                36 |   name                = \"example-aks1\"\r\n                37 |   location            = azurerm_resource_group.example.location\r\n                38 |   resource_group_name = azurerm_resource_group.example.name\r\n                39 |   dns_prefix          = \"exampleaks1\"\r\n                40 |\r\n                41 |   default_node_pool {\r\n                42 |     name       = \"default\"\r\n                43 |     node_count = 1\r\n                44 |     vm_size    = \"Standard_D2_v2\"\r\n                45 |   }\r\n                46 |\r\n                47 |   oms_agent {\r\n                48 |     log_analytics_workspace_id = azurerm_log_analytics_workspace.main.id\r\n                49 |   }\r\n                50 |\r\n                51 |   identity {\r\n                52 |     type = \"SystemAssigned\"\r\n                53 |   }\r\n                54 |\r\n                55 |   tags = {\r\n                56 |     Environment = \"Production\"\r\n                57 |   }\r\n                58 | }\r\n```\r\n\r\n**Examples**\r\n```hcl\r\nvariable \"admin_user\" {\r\n  default = null\r\n}\r\n\r\nprovider \"azurerm\" {\r\n  features {}\r\n}\r\n\r\nresource \"azurerm_resource_group\" \"example\" {\r\n  location = \"eastus\"\r\n  name     = \"checkov-dynamic\"\r\n}\r\n\r\nresource \"azurerm_log_analytics_workspace\" \"main\" {\r\n  name                = \"workspace\"\r\n  location            = azurerm_resource_group.example.location\r\n  resource_group_name = azurerm_resource_group.example.name\r\n  sku                 = \"PerGB2018\"\r\n  retention_in_days   = 7\r\n}\r\n\r\nresource \"azurerm_log_analytics_solution\" \"main\" {\r\n  solution_name         = \"ContainerInsights\"\r\n  location            = azurerm_resource_group.example.location\r\n  resource_group_name = azurerm_resource_group.example.name\r\n  workspace_resource_id = azurerm_log_analytics_workspace.main[0].id\r\n  workspace_name        = azurerm_log_analytics_workspace.main[0].name\r\n\r\n  plan {\r\n    publisher = \"Microsoft\"\r\n    product   = \"OMSGallery/ContainerInsights\"\r\n  }\r\n}\r\n\r\nresource \"azurerm_kubernetes_cluster\" \"example\" {\r\n  name                = \"example-aks1\"\r\n  location            = azurerm_resource_group.example.location\r\n  resource_group_name = azurerm_resource_group.example.name\r\n  dns_prefix          = \"exampleaks1\"\r\n\r\n  default_node_pool {\r\n    name       = \"default\"\r\n    node_count = 1\r\n    vm_size    = \"Standard_D2_v2\"\r\n  }\r\n\r\n  oms_agent {\r\n    log_analytics_workspace_id = azurerm_log_analytics_workspace.main.id\r\n  }\r\n\r\n  identity {\r\n    type = \"SystemAssigned\"\r\n  }\r\n\r\n  tags = {\r\n    Environment = \"Production\"\r\n  }\r\n}\r\n```\r\n\r\n**Version (please complete the following information):**\r\n - 2.1.20\r\n\r\n**Additional context**\r\n\r\nThe [current implemention](https://github.com/bridgecrewio/checkov/blob/master/checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py#L13-L14) are based on 2.x and not work for 3.x.\r\n\n`CKV_AZURE_4` cannot work with AzureRM 3.0 provider\n**Describe the issue**\r\n\r\nScan an aks resource with AzrueRM 3.0 provider will get the following false error:\r\n\r\n```text\r\nterraform scan results:\r\n\r\nPassed checks: 0, Failed checks: 1, Skipped checks: 0\r\n\r\nCheck: CKV_AZURE_4: \"Ensure AKS logging to Azure Monitoring is Configured\"\r\n        FAILED for resource: azurerm_kubernetes_cluster.example\r\n        File: /main.tf:35-58\r\n        Guide: https://docs.bridgecrew.io/docs/bc_azr_kubernetes_1\r\n\r\n                35 | resource \"azurerm_kubernetes_cluster\" \"example\" {\r\n                36 |   name                = \"example-aks1\"\r\n                37 |   location            = azurerm_resource_group.example.location\r\n                38 |   resource_group_name = azurerm_resource_group.example.name\r\n                39 |   dns_prefix          = \"exampleaks1\"\r\n                40 |\r\n                41 |   default_node_pool {\r\n                42 |     name       = \"default\"\r\n                43 |     node_count = 1\r\n                44 |     vm_size    = \"Standard_D2_v2\"\r\n                45 |   }\r\n                46 |\r\n                47 |   oms_agent {\r\n                48 |     log_analytics_workspace_id = azurerm_log_analytics_workspace.main.id\r\n                49 |   }\r\n                50 |\r\n                51 |   identity {\r\n                52 |     type = \"SystemAssigned\"\r\n                53 |   }\r\n                54 |\r\n                55 |   tags = {\r\n                56 |     Environment = \"Production\"\r\n                57 |   }\r\n                58 | }\r\n```\r\n\r\n**Examples**\r\n```hcl\r\nvariable \"admin_user\" {\r\n  default = null\r\n}\r\n\r\nprovider \"azurerm\" {\r\n  features {}\r\n}\r\n\r\nresource \"azurerm_resource_group\" \"example\" {\r\n  location = \"eastus\"\r\n  name     = \"checkov-dynamic\"\r\n}\r\n\r\nresource \"azurerm_log_analytics_workspace\" \"main\" {\r\n  name                = \"workspace\"\r\n  location            = azurerm_resource_group.example.location\r\n  resource_group_name = azurerm_resource_group.example.name\r\n  sku                 = \"PerGB2018\"\r\n  retention_in_days   = 7\r\n}\r\n\r\nresource \"azurerm_log_analytics_solution\" \"main\" {\r\n  solution_name         = \"ContainerInsights\"\r\n  location            = azurerm_resource_group.example.location\r\n  resource_group_name = azurerm_resource_group.example.name\r\n  workspace_resource_id = azurerm_log_analytics_workspace.main[0].id\r\n  workspace_name        = azurerm_log_analytics_workspace.main[0].name\r\n\r\n  plan {\r\n    publisher = \"Microsoft\"\r\n    product   = \"OMSGallery/ContainerInsights\"\r\n  }\r\n}\r\n\r\nresource \"azurerm_kubernetes_cluster\" \"example\" {\r\n  name                = \"example-aks1\"\r\n  location            = azurerm_resource_group.example.location\r\n  resource_group_name = azurerm_resource_group.example.name\r\n  dns_prefix          = \"exampleaks1\"\r\n\r\n  default_node_pool {\r\n    name       = \"default\"\r\n    node_count = 1\r\n    vm_size    = \"Standard_D2_v2\"\r\n  }\r\n\r\n  oms_agent {\r\n    log_analytics_workspace_id = azurerm_log_analytics_workspace.main.id\r\n  }\r\n\r\n  identity {\r\n    type = \"SystemAssigned\"\r\n  }\r\n\r\n  tags = {\r\n    Environment = \"Production\"\r\n  }\r\n}\r\n```\r\n\r\n**Version (please complete the following information):**\r\n - 2.1.20\r\n\r\n**Additional context**\r\n\r\nThe [current implemention](https://github.com/bridgecrewio/checkov/blob/master/checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py#L13-L14) are based on 2.x and not work for 3.x.\r\n\n", "before_files": [{"content": "from checkov.common.models.enums import CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck\n\n\nclass AKSLoggingEnabled(BaseResourceValueCheck):\n    def __init__(self):\n        name = \"Ensure AKS logging to Azure Monitoring is Configured\"\n        id = \"CKV_AZURE_4\"\n        supported_resources = ['azurerm_kubernetes_cluster']\n        categories = [CheckCategories.KUBERNETES]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def get_inspected_key(self):\n        return \"addon_profile/[0]/oms_agent/[0]/enabled\"\n\n\ncheck = AKSLoggingEnabled()\n", "path": "checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py"}], "after_files": [{"content": "import dpath\n\nfrom checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.terraform.checks.resource.base_resource_value_check import BaseResourceCheck\n\n\nclass AKSLoggingEnabled(BaseResourceCheck):\n    def __init__(self):\n        name = \"Ensure AKS logging to Azure Monitoring is Configured\"\n        id = \"CKV_AZURE_4\"\n        supported_resources = ['azurerm_kubernetes_cluster']\n        categories = [CheckCategories.KUBERNETES]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf):\n        provider_version_2_path = \"addon_profile/[0]/oms_agent/[0]/enabled\"\n        provider_version_3_path = \"oms_agent/[0]\"\n        if dpath.search(conf, provider_version_2_path) and dpath.get(conf, provider_version_2_path)[0]:\n            self.evaluated_keys = [provider_version_2_path]\n            return CheckResult.PASSED\n        elif dpath.search(conf, provider_version_3_path):\n            self.evaluated_keys = [provider_version_3_path]\n            return CheckResult.PASSED\n\n        return CheckResult.FAILED\n\n\ncheck = AKSLoggingEnabled()\n", "path": "checkov/terraform/checks/resource/azure/AKSLoggingEnabled.py"}]}