prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Check: CKV_GCP_19: "Ensure GKE basic auth is disabled"
  **Describe the issue**
  The default for this is disabled yet the alert keeps firing. 
  
  **Examples**
  Please share an example code sample (in the IaC of your choice) + the expected outcomes.
  
  **Version (please complete the following information):**
  - 2.2.255
  
  **Additional context**
  Add any other context about the problem here.
  
  
  --- 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/gcp/GKEBasicAuth.py`
  Content:
  ```
  1 from checkov.common.models.enums import CheckResult, CheckCategories
  2 from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
  3 from typing import List
  4 
  5 
  6 class GKEBasicAuth(BaseResourceCheck):
  7     def __init__(self):
  8         name = "Ensure GKE basic auth is disabled"
  9         id = "CKV_GCP_19"
  10         supported_resources = ['google_container_cluster']
  11         categories = [CheckCategories.KUBERNETES]
  12         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
  13 
  14     def scan_resource_conf(self, conf):
  15         """
  16             Looks for password configuration at azure_instance:
  17             https://www.terraform.io/docs/providers/google/r/compute_ssl_policy.html
  18         :param conf: google_compute_ssl_policy configuration
  19         :return: <CheckResult>
  20         """
  21         if 'master_auth' in conf.keys():
  22             username = conf['master_auth'][0].get('username')
  23             password = conf['master_auth'][0].get('password')
  24             if username or password:
  25                 # only if both are set to the empty string it is fine
  26                 # https://www.terraform.io/docs/providers/google/r/container_cluster.html
  27                 if username and password:
  28                     if username[0] == '' and password[0] == '':
  29                         return CheckResult.PASSED
  30                 return CheckResult.FAILED
  31             return CheckResult.PASSED
  32         return CheckResult.FAILED
  33 
  34     def get_evaluated_keys(self) -> List[str]:
  35         return ['master_auth/[0]/username', 'master_auth/[0]/password']
  36 
  37 
  38 check = GKEBasicAuth()
  39
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/checkov/terraform/checks/resource/gcp/GKEBasicAuth.py b/checkov/terraform/checks/resource/gcp/GKEBasicAuth.py
  --- a/checkov/terraform/checks/resource/gcp/GKEBasicAuth.py
  +++ b/checkov/terraform/checks/resource/gcp/GKEBasicAuth.py
  @@ -1,37 +1,36 @@
  +from __future__ import annotations
  +
  +from typing import Any
  +
   from checkov.common.models.enums import CheckResult, CheckCategories
   from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
  -from typing import List
   
   
   class GKEBasicAuth(BaseResourceCheck):
  -    def __init__(self):
  +    def __init__(self) -> None:
           name = "Ensure GKE basic auth is disabled"
           id = "CKV_GCP_19"
  -        supported_resources = ['google_container_cluster']
  -        categories = [CheckCategories.KUBERNETES]
  +        supported_resources = ('google_container_cluster',)
  +        categories = (CheckCategories.KUBERNETES,)
           super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
   
  -    def scan_resource_conf(self, conf):
  -        """
  -            Looks for password configuration at azure_instance:
  -            https://www.terraform.io/docs/providers/google/r/compute_ssl_policy.html
  -        :param conf: google_compute_ssl_policy configuration
  -        :return: <CheckResult>
  -        """
  -        if 'master_auth' in conf.keys():
  -            username = conf['master_auth'][0].get('username')
  -            password = conf['master_auth'][0].get('password')
  +    def scan_resource_conf(self, conf: dict[str, list[Any]]) -> CheckResult:
  +        # since GKE 1.19 the usage of basic auth is deprecated and in the provider version 4+ removed
  +        master_auth = conf.get("master_auth")
  +        if master_auth and isinstance(master_auth, list):
  +            username = master_auth[0].get('username')
  +            password = master_auth[0].get('password')
               if username or password:
                   # only if both are set to the empty string it is fine
  -                # https://www.terraform.io/docs/providers/google/r/container_cluster.html
  +                # https://registry.terraform.io/providers/hashicorp/google/3.90.1/docs/resources/container_cluster.html
                   if username and password:
                       if username[0] == '' and password[0] == '':
                           return CheckResult.PASSED
                   return CheckResult.FAILED
  -            return CheckResult.PASSED
  -        return CheckResult.FAILED
   
  -    def get_evaluated_keys(self) -> List[str]:
  +        return CheckResult.PASSED
  +
  +    def get_evaluated_keys(self) -> list[str]:
           return ['master_auth/[0]/username', 'master_auth/[0]/password']
  
verification_info: {"golden_diff": "diff --git a/checkov/terraform/checks/resource/gcp/GKEBasicAuth.py b/checkov/terraform/checks/resource/gcp/GKEBasicAuth.py\n--- a/checkov/terraform/checks/resource/gcp/GKEBasicAuth.py\n+++ b/checkov/terraform/checks/resource/gcp/GKEBasicAuth.py\n@@ -1,37 +1,36 @@\n+from __future__ import annotations\n+\n+from typing import Any\n+\n from checkov.common.models.enums import CheckResult, CheckCategories\n from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n-from typing import List\n \n \n class GKEBasicAuth(BaseResourceCheck):\n-    def __init__(self):\n+    def __init__(self) -> None:\n         name = \"Ensure GKE basic auth is disabled\"\n         id = \"CKV_GCP_19\"\n-        supported_resources = ['google_container_cluster']\n-        categories = [CheckCategories.KUBERNETES]\n+        supported_resources = ('google_container_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-        \"\"\"\n-            Looks for password configuration at azure_instance:\n-            https://www.terraform.io/docs/providers/google/r/compute_ssl_policy.html\n-        :param conf: google_compute_ssl_policy configuration\n-        :return: <CheckResult>\n-        \"\"\"\n-        if 'master_auth' in conf.keys():\n-            username = conf['master_auth'][0].get('username')\n-            password = conf['master_auth'][0].get('password')\n+    def scan_resource_conf(self, conf: dict[str, list[Any]]) -> CheckResult:\n+        # since GKE 1.19 the usage of basic auth is deprecated and in the provider version 4+ removed\n+        master_auth = conf.get(\"master_auth\")\n+        if master_auth and isinstance(master_auth, list):\n+            username = master_auth[0].get('username')\n+            password = master_auth[0].get('password')\n             if username or password:\n                 # only if both are set to the empty string it is fine\n-                # https://www.terraform.io/docs/providers/google/r/container_cluster.html\n+                # https://registry.terraform.io/providers/hashicorp/google/3.90.1/docs/resources/container_cluster.html\n                 if username and password:\n                     if username[0] == '' and password[0] == '':\n                         return CheckResult.PASSED\n                 return CheckResult.FAILED\n-            return CheckResult.PASSED\n-        return CheckResult.FAILED\n \n-    def get_evaluated_keys(self) -> List[str]:\n+        return CheckResult.PASSED\n+\n+    def get_evaluated_keys(self) -> list[str]:\n         return ['master_auth/[0]/username', 'master_auth/[0]/password']\n", "issue": "Check: CKV_GCP_19: \"Ensure GKE basic auth is disabled\"\n**Describe the issue**\r\nThe default for this is disabled yet the alert keeps firing. \r\n\r\n**Examples**\r\nPlease share an example code sample (in the IaC of your choice) + the expected outcomes.\r\n\r\n**Version (please complete the following information):**\r\n- 2.2.255\r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\r\n\n", "before_files": [{"content": "from checkov.common.models.enums import CheckResult, CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\nfrom typing import List\n\n\nclass GKEBasicAuth(BaseResourceCheck):\n    def __init__(self):\n        name = \"Ensure GKE basic auth is disabled\"\n        id = \"CKV_GCP_19\"\n        supported_resources = ['google_container_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        \"\"\"\n            Looks for password configuration at azure_instance:\n            https://www.terraform.io/docs/providers/google/r/compute_ssl_policy.html\n        :param conf: google_compute_ssl_policy configuration\n        :return: <CheckResult>\n        \"\"\"\n        if 'master_auth' in conf.keys():\n            username = conf['master_auth'][0].get('username')\n            password = conf['master_auth'][0].get('password')\n            if username or password:\n                # only if both are set to the empty string it is fine\n                # https://www.terraform.io/docs/providers/google/r/container_cluster.html\n                if username and password:\n                    if username[0] == '' and password[0] == '':\n                        return CheckResult.PASSED\n                return CheckResult.FAILED\n            return CheckResult.PASSED\n        return CheckResult.FAILED\n\n    def get_evaluated_keys(self) -> List[str]:\n        return ['master_auth/[0]/username', 'master_auth/[0]/password']\n\n\ncheck = GKEBasicAuth()\n", "path": "checkov/terraform/checks/resource/gcp/GKEBasicAuth.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom typing import Any\n\nfrom checkov.common.models.enums import CheckResult, CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n\nclass GKEBasicAuth(BaseResourceCheck):\n    def __init__(self) -> None:\n        name = \"Ensure GKE basic auth is disabled\"\n        id = \"CKV_GCP_19\"\n        supported_resources = ('google_container_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: dict[str, list[Any]]) -> CheckResult:\n        # since GKE 1.19 the usage of basic auth is deprecated and in the provider version 4+ removed\n        master_auth = conf.get(\"master_auth\")\n        if master_auth and isinstance(master_auth, list):\n            username = master_auth[0].get('username')\n            password = master_auth[0].get('password')\n            if username or password:\n                # only if both are set to the empty string it is fine\n                # https://registry.terraform.io/providers/hashicorp/google/3.90.1/docs/resources/container_cluster.html\n                if username and password:\n                    if username[0] == '' and password[0] == '':\n                        return CheckResult.PASSED\n                return CheckResult.FAILED\n\n        return CheckResult.PASSED\n\n    def get_evaluated_keys(self) -> list[str]:\n        return ['master_auth/[0]/username', 'master_auth/[0]/password']\n\n\ncheck = GKEBasicAuth()\n", "path": "checkov/terraform/checks/resource/gcp/GKEBasicAuth.py"}]}