prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  False positive for check CKV_AZURE_5: "Ensure RBAC is enabled on AKS clusters"
  **Describe the issue**
  The check CKV_AZURE_5 for terraform resource `azurerm_kubernetes_cluster` ensures that RBAC is enabled in the kubernetes cluster.
  Depending on how the `role_based_access_control_enabled` property is set, the check result is exact or not :
  - `role_based_access_control_enabled = true`: the check passes. It's ok.
  - `role_based_access_control_enabled = false`: the check fails. It's ok.
  - `role_based_access_control_enabled` not defined : check fails. It's NOT ok as default value of this property is `true` (see https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#role_based_access_control_enabled)
  
  **Examples**
  This example will fails but it shouldn't:
  ```
  resource "azurerm_resource_group" "foo" {
    name     = "foo"
    location = "West Europe"
  }
  
  resource "azurerm_kubernetes_cluster" "foo" {
    name                = "foo"
    resource_group_name = azurerm_resource_group.foo.name
    location            = azurerm_resource_group.foo.location
    dns_prefix          = "foo"
  
    default_node_pool {
      name       = "default"
      node_count = 1
      vm_size    = "Standard_D2_v2"
    }
  
    identity {
      type = "SystemAssigned"
    }
  
    # role_based_access_control_enabled = true
  }
  ```
  
  **Version (please complete the following information):**
   - Checkov Version : `2.2.252` (latest docker image)
  
  **Additional context**
  The problem is in this source file : https://github.com/bridgecrewio/checkov/blob/48abe40926c97bd2e6f8c80491369be462ce3edd/checkov/terraform/checks/resource/azure/AKSRbacEnabled.py#L19-L29
  
  It returns `false` if the property is not found in the resource. It shouldn't be the case as the default value of the property is `true`
  
  
  </issue>
  <code>
  [start of checkov/terraform/checks/resource/azure/AKSRbacEnabled.py]
  1 import dpath.util
  2 from checkov.common.models.enums import CheckCategories, CheckResult
  3 from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
  4 
  5 
  6 class AKSRbacEnabled(BaseResourceCheck):
  7     def __init__(self):
  8         name = "Ensure RBAC is enabled on AKS clusters"
  9         id = "CKV_AZURE_5"
  10         supported_resources = ["azurerm_kubernetes_cluster"]
  11         categories = [CheckCategories.KUBERNETES]
  12         super().__init__(
  13             name=name,
  14             id=id,
  15             categories=categories,
  16             supported_resources=supported_resources,
  17         )
  18 
  19     def scan_resource_conf(self, conf):
  20         self.evaluated_keys = [
  21             "role_based_access_control/[0]/enabled",  # azurerm < 2.99.0
  22             "role_based_access_control_enabled",  # azurerm >= 2.99.0
  23         ]
  24 
  25         for key in self.evaluated_keys:
  26             if dpath.search(conf, key) and dpath.get(conf, key)[0]:
  27                 return CheckResult.PASSED
  28 
  29         return CheckResult.FAILED
  30 
  31 
  32 check = AKSRbacEnabled()
  33
  [end of checkov/terraform/checks/resource/azure/AKSRbacEnabled.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/checkov/terraform/checks/resource/azure/AKSRbacEnabled.py b/checkov/terraform/checks/resource/azure/AKSRbacEnabled.py
  --- a/checkov/terraform/checks/resource/azure/AKSRbacEnabled.py
  +++ b/checkov/terraform/checks/resource/azure/AKSRbacEnabled.py
  @@ -23,10 +23,10 @@
           ]
   
           for key in self.evaluated_keys:
  -            if dpath.search(conf, key) and dpath.get(conf, key)[0]:
  -                return CheckResult.PASSED
  +            if dpath.search(conf, key):
  +                return CheckResult.PASSED if dpath.get(conf, key)[0] else CheckResult.FAILED
   
  -        return CheckResult.FAILED
  +        return CheckResult.PASSED
   
   
   check = AKSRbacEnabled()
  
verification_info: {"golden_diff": "diff --git a/checkov/terraform/checks/resource/azure/AKSRbacEnabled.py b/checkov/terraform/checks/resource/azure/AKSRbacEnabled.py\n--- a/checkov/terraform/checks/resource/azure/AKSRbacEnabled.py\n+++ b/checkov/terraform/checks/resource/azure/AKSRbacEnabled.py\n@@ -23,10 +23,10 @@\n         ]\n \n         for key in self.evaluated_keys:\n-            if dpath.search(conf, key) and dpath.get(conf, key)[0]:\n-                return CheckResult.PASSED\n+            if dpath.search(conf, key):\n+                return CheckResult.PASSED if dpath.get(conf, key)[0] else CheckResult.FAILED\n \n-        return CheckResult.FAILED\n+        return CheckResult.PASSED\n \n \n check = AKSRbacEnabled()\n", "issue": "False positive for check CKV_AZURE_5: \"Ensure RBAC is enabled on AKS clusters\"\n**Describe the issue**\r\nThe check CKV_AZURE_5 for terraform resource `azurerm_kubernetes_cluster` ensures that RBAC is enabled in the kubernetes cluster.\r\nDepending on how the `role_based_access_control_enabled` property is set, the check result is exact or not :\r\n- `role_based_access_control_enabled = true`: the check passes. It's ok.\r\n- `role_based_access_control_enabled = false`: the check fails. It's ok.\r\n- `role_based_access_control_enabled` not defined : check fails. It's NOT ok as default value of this property is `true` (see https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#role_based_access_control_enabled)\r\n\r\n**Examples**\r\nThis example will fails but it shouldn't:\r\n```\r\nresource \"azurerm_resource_group\" \"foo\" {\r\n  name     = \"foo\"\r\n  location = \"West Europe\"\r\n}\r\n\r\nresource \"azurerm_kubernetes_cluster\" \"foo\" {\r\n  name                = \"foo\"\r\n  resource_group_name = azurerm_resource_group.foo.name\r\n  location            = azurerm_resource_group.foo.location\r\n  dns_prefix          = \"foo\"\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  identity {\r\n    type = \"SystemAssigned\"\r\n  }\r\n\r\n  # role_based_access_control_enabled = true\r\n}\r\n```\r\n\r\n**Version (please complete the following information):**\r\n - Checkov Version : `2.2.252` (latest docker image)\r\n\r\n**Additional context**\r\nThe problem is in this source file : https://github.com/bridgecrewio/checkov/blob/48abe40926c97bd2e6f8c80491369be462ce3edd/checkov/terraform/checks/resource/azure/AKSRbacEnabled.py#L19-L29\r\n\r\nIt returns `false` if the property is not found in the resource. It shouldn't be the case as the default value of the property is `true`\r\n\n", "before_files": [{"content": "import dpath.util\nfrom checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n\nclass AKSRbacEnabled(BaseResourceCheck):\n    def __init__(self):\n        name = \"Ensure RBAC is enabled on AKS clusters\"\n        id = \"CKV_AZURE_5\"\n        supported_resources = [\"azurerm_kubernetes_cluster\"]\n        categories = [CheckCategories.KUBERNETES]\n        super().__init__(\n            name=name,\n            id=id,\n            categories=categories,\n            supported_resources=supported_resources,\n        )\n\n    def scan_resource_conf(self, conf):\n        self.evaluated_keys = [\n            \"role_based_access_control/[0]/enabled\",  # azurerm < 2.99.0\n            \"role_based_access_control_enabled\",  # azurerm >= 2.99.0\n        ]\n\n        for key in self.evaluated_keys:\n            if dpath.search(conf, key) and dpath.get(conf, key)[0]:\n                return CheckResult.PASSED\n\n        return CheckResult.FAILED\n\n\ncheck = AKSRbacEnabled()\n", "path": "checkov/terraform/checks/resource/azure/AKSRbacEnabled.py"}]}