prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  CKV_AWS_78 misreported
  **Describe the bug**
  Checkov is returning as vulnerability CKV_AWS_78, but the solution breaks Terraform validation.
  
  Accordigly to Checkov if `encryption_disabled = false` is not set in the main block it can be considered a vulnerability
  
  ```
  resource "aws_codebuild_project" "project-with-cache" {
    name           = "test-project-cache"
    description    = "test_codebuild_project_cache"
    build_timeout  = "5"
    queued_timeout = "5"
  + encryption_disabled = false
  } 
  ```
  as described here: https://docs.bridgecrew.io/docs/bc_aws_general_30
  
  Unfortunately in Terraform v1.0.3 `encryption_disabled` is not available in that location but only in blocks `artifacts`, `secondary_artifacts` and `logs_config: s3_logs` as you can see here: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codebuild_project
  
  So if not set it gives vulnerability, if set terraform fails during the validation.
  
  **To Reproduce**
  Steps to reproduce the behavior:
  1. Set in **aws_codebuild_project**  **encryption_disabled = false**
  ```
  resource "aws_codebuild_project" "project-with-cache" {
    name           = "test-project-cache"
    description    = "test_codebuild_project_cache"
    build_timeout  = "5"
    queued_timeout = "5"
  + encryption_disabled = false
  } 
  ```
  2. Run `terraform validate`
  3. See error
  
  **Expected behavior**
  No vulnerability or vulnerability if not set the attribute in all the 3 blocks
  
  **Desktop (please complete the following information):**
   - terraform --version: Terraform v1.0.3 on linux_amd64
   - checkov --version: 2.0.326
  
  
  
  </issue>
  <code>
  [start of checkov/terraform/checks/resource/aws/CodeBuildProjectEncryption.py]
  1 from checkov.common.models.enums import CheckResult, CheckCategories
  2 from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
  3 
  4 
  5 class CodeBuildProjectEncryption(BaseResourceCheck):
  6 
  7     def __init__(self):
  8         name = "Ensure that CodeBuild Project encryption is not disabled"
  9         id = "CKV_AWS_78"
  10         supported_resources = ['aws_codebuild_project']
  11         categories = [CheckCategories.ENCRYPTION]
  12         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
  13 
  14     def scan_resource_conf(self, conf):
  15         if 'artifacts' not in conf:
  16             return CheckResult.UNKNOWN
  17         artifact = conf['artifacts'][0]
  18         if isinstance(artifact, dict):
  19             if artifact['type'] == "NO_ARTIFACTS":
  20                 self.evaluated_keys = 'artifacts/[0]/type'
  21             elif 'encryption_disabled' in artifact and artifact['encryption_disabled']:
  22                 self.evaluated_keys = 'artifacts/[0]/encryption_disabled'
  23                 return CheckResult.FAILED
  24         return CheckResult.PASSED
  25 
  26 
  27 check = CodeBuildProjectEncryption()
  28
  [end of checkov/terraform/checks/resource/aws/CodeBuildProjectEncryption.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/aws/CodeBuildProjectEncryption.py b/checkov/terraform/checks/resource/aws/CodeBuildProjectEncryption.py
  --- a/checkov/terraform/checks/resource/aws/CodeBuildProjectEncryption.py
  +++ b/checkov/terraform/checks/resource/aws/CodeBuildProjectEncryption.py
  @@ -16,11 +16,13 @@
               return CheckResult.UNKNOWN
           artifact = conf['artifacts'][0]
           if isinstance(artifact, dict):
  -            if artifact['type'] == "NO_ARTIFACTS":
  +            if artifact['type'] == ["NO_ARTIFACTS"]:
                   self.evaluated_keys = 'artifacts/[0]/type'
  -            elif 'encryption_disabled' in artifact and artifact['encryption_disabled']:
  -                self.evaluated_keys = 'artifacts/[0]/encryption_disabled'
  -                return CheckResult.FAILED
  +                return CheckResult.UNKNOWN
  +            if 'encryption_disabled' in artifact:   
  +                if artifact['encryption_disabled'] == [True]:
  +                   self.evaluated_keys = 'artifacts/[0]/encryption_disabled'
  +                   return CheckResult.FAILED
           return CheckResult.PASSED
  
verification_info: {"golden_diff": "diff --git a/checkov/terraform/checks/resource/aws/CodeBuildProjectEncryption.py b/checkov/terraform/checks/resource/aws/CodeBuildProjectEncryption.py\n--- a/checkov/terraform/checks/resource/aws/CodeBuildProjectEncryption.py\n+++ b/checkov/terraform/checks/resource/aws/CodeBuildProjectEncryption.py\n@@ -16,11 +16,13 @@\n             return CheckResult.UNKNOWN\n         artifact = conf['artifacts'][0]\n         if isinstance(artifact, dict):\n-            if artifact['type'] == \"NO_ARTIFACTS\":\n+            if artifact['type'] == [\"NO_ARTIFACTS\"]:\n                 self.evaluated_keys = 'artifacts/[0]/type'\n-            elif 'encryption_disabled' in artifact and artifact['encryption_disabled']:\n-                self.evaluated_keys = 'artifacts/[0]/encryption_disabled'\n-                return CheckResult.FAILED\n+                return CheckResult.UNKNOWN\n+            if 'encryption_disabled' in artifact:   \n+                if artifact['encryption_disabled'] == [True]:\n+                   self.evaluated_keys = 'artifacts/[0]/encryption_disabled'\n+                   return CheckResult.FAILED\n         return CheckResult.PASSED\n", "issue": "CKV_AWS_78 misreported\n**Describe the bug**\r\nCheckov is returning as vulnerability CKV_AWS_78, but the solution breaks Terraform validation.\r\n\r\nAccordigly to Checkov if `encryption_disabled = false` is not set in the main block it can be considered a vulnerability\r\n\r\n```\r\nresource \"aws_codebuild_project\" \"project-with-cache\" {\r\n  name           = \"test-project-cache\"\r\n  description    = \"test_codebuild_project_cache\"\r\n  build_timeout  = \"5\"\r\n  queued_timeout = \"5\"\r\n+ encryption_disabled = false\r\n} \r\n```\r\nas described here: https://docs.bridgecrew.io/docs/bc_aws_general_30\r\n\r\nUnfortunately in Terraform v1.0.3 `encryption_disabled` is not available in that location but only in blocks `artifacts`, `secondary_artifacts` and `logs_config: s3_logs` as you can see here: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codebuild_project\r\n\r\nSo if not set it gives vulnerability, if set terraform fails during the validation.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. Set in **aws_codebuild_project**  **encryption_disabled = false**\r\n```\r\nresource \"aws_codebuild_project\" \"project-with-cache\" {\r\n  name           = \"test-project-cache\"\r\n  description    = \"test_codebuild_project_cache\"\r\n  build_timeout  = \"5\"\r\n  queued_timeout = \"5\"\r\n+ encryption_disabled = false\r\n} \r\n```\r\n2. Run `terraform validate`\r\n3. See error\r\n\r\n**Expected behavior**\r\nNo vulnerability or vulnerability if not set the attribute in all the 3 blocks\r\n\r\n**Desktop (please complete the following information):**\r\n - terraform --version: Terraform v1.0.3 on linux_amd64\r\n - checkov --version: 2.0.326\r\n\r\n\n", "before_files": [{"content": "from checkov.common.models.enums import CheckResult, CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n\nclass CodeBuildProjectEncryption(BaseResourceCheck):\n\n    def __init__(self):\n        name = \"Ensure that CodeBuild Project encryption is not disabled\"\n        id = \"CKV_AWS_78\"\n        supported_resources = ['aws_codebuild_project']\n        categories = [CheckCategories.ENCRYPTION]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf):\n        if 'artifacts' not in conf:\n            return CheckResult.UNKNOWN\n        artifact = conf['artifacts'][0]\n        if isinstance(artifact, dict):\n            if artifact['type'] == \"NO_ARTIFACTS\":\n                self.evaluated_keys = 'artifacts/[0]/type'\n            elif 'encryption_disabled' in artifact and artifact['encryption_disabled']:\n                self.evaluated_keys = 'artifacts/[0]/encryption_disabled'\n                return CheckResult.FAILED\n        return CheckResult.PASSED\n\n\ncheck = CodeBuildProjectEncryption()\n", "path": "checkov/terraform/checks/resource/aws/CodeBuildProjectEncryption.py"}]}