prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Outdated check for `google_container_cluster` binary authorization
  **Describe the issue**
  `Check: CKV_GCP_66: "Ensure use of Binary Authorization"` is not checking [against the updated property](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_binary_authorization) causing the check to fail.
  
  The current property states that the old method [`enable_binary_authorization`](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#enable_binary_authorization) is deprecated in favor the new [`binary_authorization`](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_binary_authorization) block
  
  **Examples**
  
  Before:
  ```hcl
  enable_binary_authorization = true
  ```
  
  Now:
  ```hcl
    binary_authorization {
      evaluation_mode = "PROJECT_SINGLETON_POLICY_ENFORCE"
    }
  ```
  
  **Version (please complete the following information):**
   - Checkov Version 2.1.149
  
  
  
  --- 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/GKEBinaryAuthorization.py`
  Content:
  ```
  1 from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
  2 from checkov.common.models.enums import CheckCategories
  3 
  4 
  5 class GKEBinaryAuthorization(BaseResourceValueCheck):
  6     def __init__(self) -> None:
  7         name = "Ensure use of Binary Authorization"
  8         id = "CKV_GCP_66"
  9         supported_resources = ("google_container_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) -> str:
  14         return "enable_binary_authorization"
  15 
  16 
  17 check = GKEBinaryAuthorization()
  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()
  
  ```
  
golden_diff: diff --git a/checkov/terraform/checks/resource/gcp/GKEBinaryAuthorization.py b/checkov/terraform/checks/resource/gcp/GKEBinaryAuthorization.py
  --- a/checkov/terraform/checks/resource/gcp/GKEBinaryAuthorization.py
  +++ b/checkov/terraform/checks/resource/gcp/GKEBinaryAuthorization.py
  @@ -1,17 +1,29 @@
  -from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
  -from checkov.common.models.enums import CheckCategories
  +from checkov.common.models.enums import CheckCategories, CheckResult
  +from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
   
   
  -class GKEBinaryAuthorization(BaseResourceValueCheck):
  -    def __init__(self) -> None:
  +class GKEBinaryAuthorization(BaseResourceCheck):
  +    def __init__(self):
           name = "Ensure use of Binary Authorization"
           id = "CKV_GCP_66"
  -        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 get_inspected_key(self) -> str:
  -        return "enable_binary_authorization"
  +    def scan_resource_conf(self, conf):
  +        if 'binary_authorization' in conf.keys():
  +            binary_authorization = conf["binary_authorization"][0]
  +            if isinstance(binary_authorization, dict) and 'evaluation_mode' in binary_authorization:
  +                # Google provider version >= v4.31.0
  +                if binary_authorization.get("evaluation_mode") == ["PROJECT_SINGLETON_POLICY_ENFORCE"]:
  +                    return CheckResult.PASSED
  +                # Google provider version v4.29.0 and v4.30.0
  +                elif binary_authorization.get("evaluation_mode") == [True]:
  +                    return CheckResult.PASSED
  +        # Google provider version <= v4.28.0
  +        if conf.get("enable_binary_authorization") == [True]:
  +            return CheckResult.PASSED
  +        return CheckResult.FAILED
   
   
   check = GKEBinaryAuthorization()
  
verification_info: {"golden_diff": "diff --git a/checkov/terraform/checks/resource/gcp/GKEBinaryAuthorization.py b/checkov/terraform/checks/resource/gcp/GKEBinaryAuthorization.py\n--- a/checkov/terraform/checks/resource/gcp/GKEBinaryAuthorization.py\n+++ b/checkov/terraform/checks/resource/gcp/GKEBinaryAuthorization.py\n@@ -1,17 +1,29 @@\n-from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck\n-from checkov.common.models.enums import CheckCategories\n+from checkov.common.models.enums import CheckCategories, CheckResult\n+from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n \n \n-class GKEBinaryAuthorization(BaseResourceValueCheck):\n-    def __init__(self) -> None:\n+class GKEBinaryAuthorization(BaseResourceCheck):\n+    def __init__(self):\n         name = \"Ensure use of Binary Authorization\"\n         id = \"CKV_GCP_66\"\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 get_inspected_key(self) -> str:\n-        return \"enable_binary_authorization\"\n+    def scan_resource_conf(self, conf):\n+        if 'binary_authorization' in conf.keys():\n+            binary_authorization = conf[\"binary_authorization\"][0]\n+            if isinstance(binary_authorization, dict) and 'evaluation_mode' in binary_authorization:\n+                # Google provider version >= v4.31.0\n+                if binary_authorization.get(\"evaluation_mode\") == [\"PROJECT_SINGLETON_POLICY_ENFORCE\"]:\n+                    return CheckResult.PASSED\n+                # Google provider version v4.29.0 and v4.30.0\n+                elif binary_authorization.get(\"evaluation_mode\") == [True]:\n+                    return CheckResult.PASSED\n+        # Google provider version <= v4.28.0\n+        if conf.get(\"enable_binary_authorization\") == [True]:\n+            return CheckResult.PASSED\n+        return CheckResult.FAILED\n \n \n check = GKEBinaryAuthorization()\n", "issue": "Outdated check for `google_container_cluster` binary authorization\n**Describe the issue**\r\n`Check: CKV_GCP_66: \"Ensure use of Binary Authorization\"` is not checking [against the updated property](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_binary_authorization) causing the check to fail.\r\n\r\nThe current property states that the old method [`enable_binary_authorization`](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#enable_binary_authorization) is deprecated in favor the new [`binary_authorization`](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_binary_authorization) block\r\n\r\n**Examples**\r\n\r\nBefore:\r\n```hcl\r\nenable_binary_authorization = true\r\n```\r\n\r\nNow:\r\n```hcl\r\n  binary_authorization {\r\n    evaluation_mode = \"PROJECT_SINGLETON_POLICY_ENFORCE\"\r\n  }\r\n```\r\n\r\n**Version (please complete the following information):**\r\n - Checkov Version 2.1.149\r\n\r\n\n", "before_files": [{"content": "from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck\nfrom checkov.common.models.enums import CheckCategories\n\n\nclass GKEBinaryAuthorization(BaseResourceValueCheck):\n    def __init__(self) -> None:\n        name = \"Ensure use of Binary Authorization\"\n        id = \"CKV_GCP_66\"\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 get_inspected_key(self) -> str:\n        return \"enable_binary_authorization\"\n\n\ncheck = GKEBinaryAuthorization()\n", "path": "checkov/terraform/checks/resource/gcp/GKEBinaryAuthorization.py"}], "after_files": [{"content": "from checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n\nclass GKEBinaryAuthorization(BaseResourceCheck):\n    def __init__(self):\n        name = \"Ensure use of Binary Authorization\"\n        id = \"CKV_GCP_66\"\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        if 'binary_authorization' in conf.keys():\n            binary_authorization = conf[\"binary_authorization\"][0]\n            if isinstance(binary_authorization, dict) and 'evaluation_mode' in binary_authorization:\n                # Google provider version >= v4.31.0\n                if binary_authorization.get(\"evaluation_mode\") == [\"PROJECT_SINGLETON_POLICY_ENFORCE\"]:\n                    return CheckResult.PASSED\n                # Google provider version v4.29.0 and v4.30.0\n                elif binary_authorization.get(\"evaluation_mode\") == [True]:\n                    return CheckResult.PASSED\n        # Google provider version <= v4.28.0\n        if conf.get(\"enable_binary_authorization\") == [True]:\n            return CheckResult.PASSED\n        return CheckResult.FAILED\n\n\ncheck = GKEBinaryAuthorization()\n", "path": "checkov/terraform/checks/resource/gcp/GKEBinaryAuthorization.py"}]}