prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  OCI Security Group Control Problem
  **Describe the issue**
  AbsSecurtiGroupUnrestictedIngress  The function needs to control "destination_port_range" instead of "source_port_range"
  
  [Codo Block](https://github.com/bridgecrewio/checkov/blob/b13dd31e10b84b7e4ce87d1d80c9d7d54b404742/checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.py#L33-L36)
  
  **Examples**
  
  **Version (please complete the following information):**
   - Checkov Version 2.2.86
  
  
  </issue>
  <code>
  [start of checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.py]
  1 from checkov.common.models.enums import CheckResult, CheckCategories
  2 from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
  3 from checkov.common.util.type_forcers import force_int
  4 
  5 
  6 class AbsSecurityGroupUnrestrictedIngress(BaseResourceCheck):
  7     def __init__(self, check_id: str, port: int) -> None:
  8         name = f"Ensure no security groups rules allow ingress from 0.0.0.0/0 to port {port}"
  9         supported_resources = ['oci_core_network_security_group_security_rule']
  10         categories = [CheckCategories.NETWORKING]
  11         super().__init__(name=name, id=check_id, categories=categories, supported_resources=supported_resources)
  12         self.port = port
  13 
  14     def scan_resource_conf(self, conf):
  15         direction = conf.get('direction')
  16         source = conf.get('source')
  17         protocol = conf.get('protocol')
  18         tcp_options = conf.get('tcp_options')
  19         self.evaluated_keys = ["direction"]
  20         if direction and direction[0] != 'INGRESS':
  21             return CheckResult.UNKNOWN
  22         self.evaluated_keys.append("source")
  23         if source and source[0] != "0.0.0.0/0":
  24             return CheckResult.PASSED
  25         elif (tcp_options is None and (protocol[0] == 'all' or protocol[0] == '6')) \
  26                 or tcp_options and self.scan_protocol_conf(tcp_options) is False:
  27             self.evaluated_keys.append("protocol")
  28             return CheckResult.FAILED
  29         return CheckResult.PASSED
  30 
  31     def scan_protocol_conf(self, protocol_name):
  32         """ scan tcp_options configuration"""
  33         if 'source_port_range' not in protocol_name[0]:
  34             return False
  35         max_port = force_int(protocol_name[0]['source_port_range'][0]['max'][0])
  36         min_port = force_int(protocol_name[0]['source_port_range'][0]['min'][0])
  37         if max_port and min_port and min_port <= self.port <= max_port:
  38             return False
  39         return True
  40
  [end of checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.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/oci/AbsSecurityGroupUnrestrictedIngress.py b/checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.py
  --- a/checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.py
  +++ b/checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.py
  @@ -30,10 +30,10 @@
   
       def scan_protocol_conf(self, protocol_name):
           """ scan tcp_options configuration"""
  -        if 'source_port_range' not in protocol_name[0]:
  +        if 'destination_port_range' not in protocol_name[0]:
               return False
  -        max_port = force_int(protocol_name[0]['source_port_range'][0]['max'][0])
  -        min_port = force_int(protocol_name[0]['source_port_range'][0]['min'][0])
  +        max_port = force_int(protocol_name[0]['destination_port_range'][0]['max'][0])
  +        min_port = force_int(protocol_name[0]['destination_port_range'][0]['min'][0])
           if max_port and min_port and min_port <= self.port <= max_port:
               return False
           return True
  
verification_info: {"golden_diff": "diff --git a/checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.py b/checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.py\n--- a/checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.py\n+++ b/checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.py\n@@ -30,10 +30,10 @@\n \n     def scan_protocol_conf(self, protocol_name):\n         \"\"\" scan tcp_options configuration\"\"\"\n-        if 'source_port_range' not in protocol_name[0]:\n+        if 'destination_port_range' not in protocol_name[0]:\n             return False\n-        max_port = force_int(protocol_name[0]['source_port_range'][0]['max'][0])\n-        min_port = force_int(protocol_name[0]['source_port_range'][0]['min'][0])\n+        max_port = force_int(protocol_name[0]['destination_port_range'][0]['max'][0])\n+        min_port = force_int(protocol_name[0]['destination_port_range'][0]['min'][0])\n         if max_port and min_port and min_port <= self.port <= max_port:\n             return False\n         return True\n", "issue": "OCI Security Group Control Problem\n**Describe the issue**\r\nAbsSecurtiGroupUnrestictedIngress  The function needs to control \"destination_port_range\" instead of \"source_port_range\"\r\n\r\n[Codo Block](https://github.com/bridgecrewio/checkov/blob/b13dd31e10b84b7e4ce87d1d80c9d7d54b404742/checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.py#L33-L36)\r\n\r\n**Examples**\r\n\r\n**Version (please complete the following information):**\r\n - Checkov Version 2.2.86\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 checkov.common.util.type_forcers import force_int\n\n\nclass AbsSecurityGroupUnrestrictedIngress(BaseResourceCheck):\n    def __init__(self, check_id: str, port: int) -> None:\n        name = f\"Ensure no security groups rules allow ingress from 0.0.0.0/0 to port {port}\"\n        supported_resources = ['oci_core_network_security_group_security_rule']\n        categories = [CheckCategories.NETWORKING]\n        super().__init__(name=name, id=check_id, categories=categories, supported_resources=supported_resources)\n        self.port = port\n\n    def scan_resource_conf(self, conf):\n        direction = conf.get('direction')\n        source = conf.get('source')\n        protocol = conf.get('protocol')\n        tcp_options = conf.get('tcp_options')\n        self.evaluated_keys = [\"direction\"]\n        if direction and direction[0] != 'INGRESS':\n            return CheckResult.UNKNOWN\n        self.evaluated_keys.append(\"source\")\n        if source and source[0] != \"0.0.0.0/0\":\n            return CheckResult.PASSED\n        elif (tcp_options is None and (protocol[0] == 'all' or protocol[0] == '6')) \\\n                or tcp_options and self.scan_protocol_conf(tcp_options) is False:\n            self.evaluated_keys.append(\"protocol\")\n            return CheckResult.FAILED\n        return CheckResult.PASSED\n\n    def scan_protocol_conf(self, protocol_name):\n        \"\"\" scan tcp_options configuration\"\"\"\n        if 'source_port_range' not in protocol_name[0]:\n            return False\n        max_port = force_int(protocol_name[0]['source_port_range'][0]['max'][0])\n        min_port = force_int(protocol_name[0]['source_port_range'][0]['min'][0])\n        if max_port and min_port and min_port <= self.port <= max_port:\n            return False\n        return True\n", "path": "checkov/terraform/checks/resource/oci/AbsSecurityGroupUnrestrictedIngress.py"}]}