prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [CKV_AZURE_6] AKS API Server White Tests Failing with Correct Code
  **Describe the issue**
  [CKV_AZURE_6](https://github.com/bridgecrewio/checkov/tree/master/checkov/arm/checks/resource/AKSApiServerAuthorizedIpRanges.py)
  
  This check should trigger when an API Server whitelist IP isn't found in the TF code. 
  
  **Examples**
  Please share an example code sample (in the IaC of your choice) + the expected outcomes.
  
  Sample (Pre 3.39.0 Provider Version):
  ```
  resource "azurerm_kubernetes_cluster" "aks_k2" {
    name = var.cluster_name
    location = azurerm_resource_group.rg_aks.location
    resource_group_name = azurerm_resource_group.rg_aks.name
    sku_tier = var.sku_tier
    dns_prefix = var.dns_name
    api_server_authorized_ip_ranges = [my_ip_list]
  }
  ```
  Sample (Post 3.39.0):
  ```
  resource "azurerm_kubernetes_cluster" "aks_k2" {
    name = var.cluster_name
    location = azurerm_resource_group.rg_aks.location
    resource_group_name = azurerm_resource_group.rg_aks.name
    sku_tier = var.sku_tier
    dns_prefix = var.dns_name
    api_server_access_profile {
      authorized_ip_ranges = [my_ip_list]
    }
  }
  ```
  
  Both have expected outcome of passing this test, as we list 4 IP's for whitelisting.
  We are failing tests
  ![image](https://github.com/bridgecrewio/checkov/assets/6209424/5a7a32d7-d9bb-4759-b7f1-32e206b4bd70)
  
  **Version (please complete the following information):**
   - Checkov Version: checkov-2.3.272
  
  
  </issue>
  <code>
  [start of checkov/terraform/checks/resource/azure/AKSApiServerAuthorizedIpRanges.py]
  1 from __future__ import annotations
  2 
  3 from typing import Any
  4 
  5 from checkov.common.models.consts import ANY_VALUE
  6 from checkov.common.models.enums import CheckCategories, CheckResult
  7 from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
  8 
  9 
  10 class AKSApiServerAuthorizedIpRanges(BaseResourceValueCheck):
  11     def __init__(self) -> None:
  12         name = "Ensure AKS has an API Server Authorized IP Ranges enabled"
  13         id = "CKV_AZURE_6"
  14         supported_resources = ("azurerm_kubernetes_cluster",)
  15         categories = (CheckCategories.KUBERNETES,)
  16         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
  17 
  18     def get_inspected_key(self) -> str:
  19         return "api_server_authorized_ip_ranges/[0]"
  20 
  21     def get_expected_value(self) -> Any:
  22         return ANY_VALUE
  23 
  24     def scan_resource_conf(self, conf: dict[str, list[Any]]) -> CheckResult:
  25         # can't be set for private cluster
  26         private_cluster_enabled = conf.get("private_cluster_enabled", [False])[0]
  27         if private_cluster_enabled:
  28             return CheckResult.PASSED
  29         return super().scan_resource_conf(conf)
  30 
  31 
  32 check = AKSApiServerAuthorizedIpRanges()
  33
  [end of checkov/terraform/checks/resource/azure/AKSApiServerAuthorizedIpRanges.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/AKSApiServerAuthorizedIpRanges.py b/checkov/terraform/checks/resource/azure/AKSApiServerAuthorizedIpRanges.py
  --- a/checkov/terraform/checks/resource/azure/AKSApiServerAuthorizedIpRanges.py
  +++ b/checkov/terraform/checks/resource/azure/AKSApiServerAuthorizedIpRanges.py
  @@ -16,7 +16,7 @@
           super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
   
       def get_inspected_key(self) -> str:
  -        return "api_server_authorized_ip_ranges/[0]"
  +        return "api_server_access_profile/[0]/authorized_ip_ranges/[0]"
   
       def get_expected_value(self) -> Any:
           return ANY_VALUE
  @@ -26,6 +26,12 @@
           private_cluster_enabled = conf.get("private_cluster_enabled", [False])[0]
           if private_cluster_enabled:
               return CheckResult.PASSED
  +
  +        # provider version <=3.38.0
  +        api_server = conf.get("api_server_authorized_ip_ranges")
  +        if api_server and isinstance(api_server, list) and api_server[0]:
  +            return CheckResult.PASSED
  +
           return super().scan_resource_conf(conf)
  
verification_info: {"golden_diff": "diff --git a/checkov/terraform/checks/resource/azure/AKSApiServerAuthorizedIpRanges.py b/checkov/terraform/checks/resource/azure/AKSApiServerAuthorizedIpRanges.py\n--- a/checkov/terraform/checks/resource/azure/AKSApiServerAuthorizedIpRanges.py\n+++ b/checkov/terraform/checks/resource/azure/AKSApiServerAuthorizedIpRanges.py\n@@ -16,7 +16,7 @@\n         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n \n     def get_inspected_key(self) -> str:\n-        return \"api_server_authorized_ip_ranges/[0]\"\n+        return \"api_server_access_profile/[0]/authorized_ip_ranges/[0]\"\n \n     def get_expected_value(self) -> Any:\n         return ANY_VALUE\n@@ -26,6 +26,12 @@\n         private_cluster_enabled = conf.get(\"private_cluster_enabled\", [False])[0]\n         if private_cluster_enabled:\n             return CheckResult.PASSED\n+\n+        # provider version <=3.38.0\n+        api_server = conf.get(\"api_server_authorized_ip_ranges\")\n+        if api_server and isinstance(api_server, list) and api_server[0]:\n+            return CheckResult.PASSED\n+\n         return super().scan_resource_conf(conf)\n", "issue": "[CKV_AZURE_6] AKS API Server White Tests Failing with Correct Code\n**Describe the issue**\r\n[CKV_AZURE_6](https://github.com/bridgecrewio/checkov/tree/master/checkov/arm/checks/resource/AKSApiServerAuthorizedIpRanges.py)\r\n\r\nThis check should trigger when an API Server whitelist IP isn't found in the TF code. \r\n\r\n**Examples**\r\nPlease share an example code sample (in the IaC of your choice) + the expected outcomes.\r\n\r\nSample (Pre 3.39.0 Provider Version):\r\n```\r\nresource \"azurerm_kubernetes_cluster\" \"aks_k2\" {\r\n  name = var.cluster_name\r\n  location = azurerm_resource_group.rg_aks.location\r\n  resource_group_name = azurerm_resource_group.rg_aks.name\r\n  sku_tier = var.sku_tier\r\n  dns_prefix = var.dns_name\r\n  api_server_authorized_ip_ranges = [my_ip_list]\r\n}\r\n```\r\nSample (Post 3.39.0):\r\n```\r\nresource \"azurerm_kubernetes_cluster\" \"aks_k2\" {\r\n  name = var.cluster_name\r\n  location = azurerm_resource_group.rg_aks.location\r\n  resource_group_name = azurerm_resource_group.rg_aks.name\r\n  sku_tier = var.sku_tier\r\n  dns_prefix = var.dns_name\r\n  api_server_access_profile {\r\n    authorized_ip_ranges = [my_ip_list]\r\n  }\r\n}\r\n```\r\n\r\nBoth have expected outcome of passing this test, as we list 4 IP's for whitelisting.\r\nWe are failing tests\r\n![image](https://github.com/bridgecrewio/checkov/assets/6209424/5a7a32d7-d9bb-4759-b7f1-32e206b4bd70)\r\n\r\n**Version (please complete the following information):**\r\n - Checkov Version: checkov-2.3.272\r\n\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom typing import Any\n\nfrom checkov.common.models.consts import ANY_VALUE\nfrom checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck\n\n\nclass AKSApiServerAuthorizedIpRanges(BaseResourceValueCheck):\n    def __init__(self) -> None:\n        name = \"Ensure AKS has an API Server Authorized IP Ranges enabled\"\n        id = \"CKV_AZURE_6\"\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) -> str:\n        return \"api_server_authorized_ip_ranges/[0]\"\n\n    def get_expected_value(self) -> Any:\n        return ANY_VALUE\n\n    def scan_resource_conf(self, conf: dict[str, list[Any]]) -> CheckResult:\n        # can't be set for private cluster\n        private_cluster_enabled = conf.get(\"private_cluster_enabled\", [False])[0]\n        if private_cluster_enabled:\n            return CheckResult.PASSED\n        return super().scan_resource_conf(conf)\n\n\ncheck = AKSApiServerAuthorizedIpRanges()\n", "path": "checkov/terraform/checks/resource/azure/AKSApiServerAuthorizedIpRanges.py"}]}