We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Support web proxy https_proxy environment variable
**Is your feature request related to a problem? Please describe.**
checkov does not run behind a web proxy.  Instead, it hangs indefinitely trying to connect to https://www.bridgecrew.cloud/api/v1

**Describe the solution you'd like**
Add web proxy support for proxy indicated in https_proxy environment variable.

**Describe alternatives you've considered**
None

**Additional context**
Before patch behind a web proxy:
```
$ time timeout 5m checkov -d .

real    5m0.007s
user    0m0.504s
sys     0m0.082s
$
```

After patch behind a web proxy:
```
$ time timeout 5m checkov -d .

       _               _
   ___| |__   ___  ___| | _______   __
  / __| '_ \ / _ \/ __| |/ / _ \ \ / /
 | (__| | | |  __/ (__|   < (_) \ V /
  \___|_| |_|\___|\___|_|\_\___/ \_/

by bridgecrew.io | version: 1.0.484


real    0m1.547s
user    0m0.938s
sys     0m0.089s
$
```



--- 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/common/bridgecrew/platform_integration.py`
Content:
```
1 import json
2 import logging
3 import os
4 from json import JSONDecodeError
5 from time import sleep
6 
7 import boto3
8 import dpath.util
9 import urllib3
10 from botocore.exceptions import ClientError
11 from urllib3.exceptions import HTTPError
12 
13 from checkov.common.bridgecrew.platform_errors import BridgecrewAuthError
14 from checkov.common.models.consts import SUPPORTED_FILE_EXTENSIONS
15 from .wrapper import reduce_scan_reports, persist_checks_results, enrich_and_persist_checks_metadata
16 
17 UNAUTHORIZED_MESSAGE = 'User is not authorized to access this resource with an explicit deny'
18 
19 DEFAULT_REGION = "us-west-2"
20 http = urllib3.PoolManager()
21 
22 
23 class BcPlatformIntegration(object):
24     def __init__(self):
25         self.bc_api_key = None
26         self.s3_client = None
27         self.bucket = None
28         self.credentials = None
29         self.repo_path = None
30         self.repo_id = None
31         self.timestamp = None
32         self.scan_reports = []
33         self.bc_api_url = os.getenv('BC_API_URL', "https://www.bridgecrew.cloud/api/v1")
34         self.bc_source = os.getenv('BC_SOURCE', "cli")
35         self.integrations_api_url = f"{self.bc_api_url}/integrations/types/checkov"
36         self.guidelines_api_url = f"{self.bc_api_url}/guidelines"
37 
38     def setup_bridgecrew_credentials(self, bc_api_key, repo_id):
39         """
40         Setup credentials against Bridgecrew's platform.
41         :param repo_id: Identity string of the scanned repository, of the form <repo_owner>/<repo_name>
42         :param bc_api_key: Bridgecrew issued API key
43         """
44         self.bc_api_key = bc_api_key
45         self.repo_id = repo_id
46         try:
47             request = http.request("POST", self.integrations_api_url, body=json.dumps({"repoId": repo_id}),
48                                    headers={"Authorization": bc_api_key, "Content-Type": "application/json"})
49             response = json.loads(request.data.decode("utf8"))
50             if 'Message' in response:
51                 if response['Message'] == UNAUTHORIZED_MESSAGE:
52                     raise BridgecrewAuthError()
53             repo_full_path = response["path"]
54             self.bucket, self.repo_path = repo_full_path.split("/", 1)
55             self.timestamp = self.repo_path.split("/")[-1]
56             self.credentials = response["creds"]
57             self.s3_client = boto3.client("s3",
58                                           aws_access_key_id=self.credentials["AccessKeyId"],
59                                           aws_secret_access_key=self.credentials["SecretAccessKey"],
60                                           aws_session_token=self.credentials["SessionToken"],
61                                           region_name=DEFAULT_REGION
62                                           )
63             sleep(10)  # Wait for the policy to update
64         except HTTPError as e:
65             logging.error(f"Failed to get customer assumed role\n{e}")
66             raise e
67         except ClientError as e:
68             logging.error(f"Failed to initiate client with credentials {self.credentials}\n{e}")
69             raise e
70         except JSONDecodeError as e:
71             logging.error(f"Response of {self.integrations_api_url} is not a valid JSON\n{e}")
72             raise e
73 
74     def is_integration_configured(self):
75         """
76         Checks if Bridgecrew integration is fully configured.
77         :return: True if the integration is configured, False otherwise
78         """
79         return all([self.repo_path, self.credentials, self.s3_client])
80 
81     def persist_repository(self, root_dir):
82         """
83         Persist the repository found on root_dir path to Bridgecrew's platform
84         :param root_dir: Absolute path of the directory containing the repository root level
85         """
86         for root_path, d_names, f_names in os.walk(root_dir):
87             for file_path in f_names:
88                 _, file_extension = os.path.splitext(file_path)
89                 if file_extension in SUPPORTED_FILE_EXTENSIONS:
90                     full_file_path = os.path.join(root_path, file_path)
91                     relative_file_path = os.path.relpath(full_file_path, root_dir)
92                     self._persist_file(full_file_path, relative_file_path)
93 
94     def persist_scan_results(self, scan_reports):
95         """
96         Persist checkov's scan result into bridgecrew's platform.
97         :param scan_reports: List of checkov scan reports
98         """
99         self.scan_reports = scan_reports
100         reduced_scan_reports = reduce_scan_reports(scan_reports)
101         checks_metadata_paths = enrich_and_persist_checks_metadata(scan_reports, self.s3_client, self.bucket,
102                                                                    self.repo_path)
103         dpath.util.merge(reduced_scan_reports, checks_metadata_paths)
104         persist_checks_results(reduced_scan_reports, self.s3_client, self.bucket, self.repo_path)
105 
106     def commit_repository(self, branch):
107         """
108         :param branch: branch to be persisted
109         Finalize the repository's scanning in bridgecrew's platform.
110         """
111         request = None
112         try:
113             request = http.request("PUT", f"{self.integrations_api_url}?source={self.bc_source}",
114                                    body=json.dumps({"path": self.repo_path, "branch": branch}),
115                                    headers={"Authorization": self.bc_api_key, "Content-Type": "application/json"})
116             response = json.loads(request.data.decode("utf8"))
117         except HTTPError as e:
118             logging.error(f"Failed to commit repository {self.repo_path}\n{e}")
119             raise e
120         except JSONDecodeError as e:
121             logging.error(f"Response of {self.integrations_api_url} is not a valid JSON\n{e}")
122             raise e
123         finally:
124             if request.status == 201 and response["result"] == "Success":
125                 logging.info(f"Finalize repository {self.repo_id} in bridgecrew's platform")
126             else:
127                 raise Exception(f"Failed to finalize repository {self.repo_id} in bridgecrew's platform\n{response}")
128 
129     def _persist_file(self, full_file_path, relative_file_path):
130         tries = 4
131         curr_try = 0
132         file_object_key = os.path.join(self.repo_path, relative_file_path)
133         while curr_try < tries:
134             try:
135                 self.s3_client.upload_file(full_file_path, self.bucket, file_object_key)
136                 return
137             except ClientError as e:
138                 if e.response.get('Error', {}).get('Code') == 'AccessDenied':
139                     sleep(5)
140                     curr_try += 1
141                 else:
142                     logging.error(f"failed to persist file {full_file_path} into S3 bucket {self.bucket}\n{e}")
143                     raise e
144             except Exception as e:
145                 logging.error(f"failed to persist file {full_file_path} into S3 bucket {self.bucket}\n{e}")
146                 raise e
147         if curr_try == tries:
148             logging.error(f"failed to persist file {full_file_path} into S3 bucket {self.bucket} - gut AccessDenied {tries} times")
149 
150     def get_guidelines(self) -> dict:
151         try:
152             request = http.request("GET", self.guidelines_api_url)
153             response = json.loads(request.data.decode("utf8"))
154             guidelines_map = response["guidelines"]
155             logging.debug(f"Got guidelines form Bridgecrew BE")
156             return guidelines_map
157         except Exception as e:
158             logging.debug(f"Failed to get the guidelines from {self.guidelines_api_url}, error:\n{e}")
159             return {}
160
```
--- 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()

```

diff --git a/checkov/common/bridgecrew/platform_integration.py b/checkov/common/bridgecrew/platform_integration.py
--- a/checkov/common/bridgecrew/platform_integration.py
+++ b/checkov/common/bridgecrew/platform_integration.py
@@ -17,7 +17,11 @@
 UNAUTHORIZED_MESSAGE = 'User is not authorized to access this resource with an explicit deny'
 
 DEFAULT_REGION = "us-west-2"
-http = urllib3.PoolManager()
+
+try:
+    http = urllib3.ProxyManager(os.environ['https_proxy'])
+except KeyError:
+    http = urllib3.PoolManager()
 
 
 class BcPlatformIntegration(object):

{"golden_diff": "diff --git a/checkov/common/bridgecrew/platform_integration.py b/checkov/common/bridgecrew/platform_integration.py\n--- a/checkov/common/bridgecrew/platform_integration.py\n+++ b/checkov/common/bridgecrew/platform_integration.py\n@@ -17,7 +17,11 @@\n UNAUTHORIZED_MESSAGE = 'User is not authorized to access this resource with an explicit deny'\n \n DEFAULT_REGION = \"us-west-2\"\n-http = urllib3.PoolManager()\n+\n+try:\n+    http = urllib3.ProxyManager(os.environ['https_proxy'])\n+except KeyError:\n+    http = urllib3.PoolManager()\n \n \n class BcPlatformIntegration(object):\n", "issue": "Support web proxy https_proxy environment variable\n**Is your feature request related to a problem? Please describe.**\r\ncheckov does not run behind a web proxy.  Instead, it hangs indefinitely trying to connect to https://www.bridgecrew.cloud/api/v1\r\n\r\n**Describe the solution you'd like**\r\nAdd web proxy support for proxy indicated in https_proxy environment variable.\r\n\r\n**Describe alternatives you've considered**\r\nNone\r\n\r\n**Additional context**\r\nBefore patch behind a web proxy:\r\n```\r\n$ time timeout 5m checkov -d .\r\n\r\nreal    5m0.007s\r\nuser    0m0.504s\r\nsys     0m0.082s\r\n$\r\n```\r\n\r\nAfter patch behind a web proxy:\r\n```\r\n$ time timeout 5m checkov -d .\r\n\r\n       _               _\r\n   ___| |__   ___  ___| | _______   __\r\n  / __| '_ \\ / _ \\/ __| |/ / _ \\ \\ / /\r\n | (__| | | |  __/ (__|   < (_) \\ V /\r\n  \\___|_| |_|\\___|\\___|_|\\_\\___/ \\_/\r\n\r\nby bridgecrew.io | version: 1.0.484\r\n\r\n\r\nreal    0m1.547s\r\nuser    0m0.938s\r\nsys     0m0.089s\r\n$\r\n```\r\n\r\n\n", "before_files": [{"content": "import json\nimport logging\nimport os\nfrom json import JSONDecodeError\nfrom time import sleep\n\nimport boto3\nimport dpath.util\nimport urllib3\nfrom botocore.exceptions import ClientError\nfrom urllib3.exceptions import HTTPError\n\nfrom checkov.common.bridgecrew.platform_errors import BridgecrewAuthError\nfrom checkov.common.models.consts import SUPPORTED_FILE_EXTENSIONS\nfrom .wrapper import reduce_scan_reports, persist_checks_results, enrich_and_persist_checks_metadata\n\nUNAUTHORIZED_MESSAGE = 'User is not authorized to access this resource with an explicit deny'\n\nDEFAULT_REGION = \"us-west-2\"\nhttp = urllib3.PoolManager()\n\n\nclass BcPlatformIntegration(object):\n    def __init__(self):\n        self.bc_api_key = None\n        self.s3_client = None\n        self.bucket = None\n        self.credentials = None\n        self.repo_path = None\n        self.repo_id = None\n        self.timestamp = None\n        self.scan_reports = []\n        self.bc_api_url = os.getenv('BC_API_URL', \"https://www.bridgecrew.cloud/api/v1\")\n        self.bc_source = os.getenv('BC_SOURCE', \"cli\")\n        self.integrations_api_url = f\"{self.bc_api_url}/integrations/types/checkov\"\n        self.guidelines_api_url = f\"{self.bc_api_url}/guidelines\"\n\n    def setup_bridgecrew_credentials(self, bc_api_key, repo_id):\n        \"\"\"\n        Setup credentials against Bridgecrew's platform.\n        :param repo_id: Identity string of the scanned repository, of the form <repo_owner>/<repo_name>\n        :param bc_api_key: Bridgecrew issued API key\n        \"\"\"\n        self.bc_api_key = bc_api_key\n        self.repo_id = repo_id\n        try:\n            request = http.request(\"POST\", self.integrations_api_url, body=json.dumps({\"repoId\": repo_id}),\n                                   headers={\"Authorization\": bc_api_key, \"Content-Type\": \"application/json\"})\n            response = json.loads(request.data.decode(\"utf8\"))\n            if 'Message' in response:\n                if response['Message'] == UNAUTHORIZED_MESSAGE:\n                    raise BridgecrewAuthError()\n            repo_full_path = response[\"path\"]\n            self.bucket, self.repo_path = repo_full_path.split(\"/\", 1)\n            self.timestamp = self.repo_path.split(\"/\")[-1]\n            self.credentials = response[\"creds\"]\n            self.s3_client = boto3.client(\"s3\",\n                                          aws_access_key_id=self.credentials[\"AccessKeyId\"],\n                                          aws_secret_access_key=self.credentials[\"SecretAccessKey\"],\n                                          aws_session_token=self.credentials[\"SessionToken\"],\n                                          region_name=DEFAULT_REGION\n                                          )\n            sleep(10)  # Wait for the policy to update\n        except HTTPError as e:\n            logging.error(f\"Failed to get customer assumed role\\n{e}\")\n            raise e\n        except ClientError as e:\n            logging.error(f\"Failed to initiate client with credentials {self.credentials}\\n{e}\")\n            raise e\n        except JSONDecodeError as e:\n            logging.error(f\"Response of {self.integrations_api_url} is not a valid JSON\\n{e}\")\n            raise e\n\n    def is_integration_configured(self):\n        \"\"\"\n        Checks if Bridgecrew integration is fully configured.\n        :return: True if the integration is configured, False otherwise\n        \"\"\"\n        return all([self.repo_path, self.credentials, self.s3_client])\n\n    def persist_repository(self, root_dir):\n        \"\"\"\n        Persist the repository found on root_dir path to Bridgecrew's platform\n        :param root_dir: Absolute path of the directory containing the repository root level\n        \"\"\"\n        for root_path, d_names, f_names in os.walk(root_dir):\n            for file_path in f_names:\n                _, file_extension = os.path.splitext(file_path)\n                if file_extension in SUPPORTED_FILE_EXTENSIONS:\n                    full_file_path = os.path.join(root_path, file_path)\n                    relative_file_path = os.path.relpath(full_file_path, root_dir)\n                    self._persist_file(full_file_path, relative_file_path)\n\n    def persist_scan_results(self, scan_reports):\n        \"\"\"\n        Persist checkov's scan result into bridgecrew's platform.\n        :param scan_reports: List of checkov scan reports\n        \"\"\"\n        self.scan_reports = scan_reports\n        reduced_scan_reports = reduce_scan_reports(scan_reports)\n        checks_metadata_paths = enrich_and_persist_checks_metadata(scan_reports, self.s3_client, self.bucket,\n                                                                   self.repo_path)\n        dpath.util.merge(reduced_scan_reports, checks_metadata_paths)\n        persist_checks_results(reduced_scan_reports, self.s3_client, self.bucket, self.repo_path)\n\n    def commit_repository(self, branch):\n        \"\"\"\n        :param branch: branch to be persisted\n        Finalize the repository's scanning in bridgecrew's platform.\n        \"\"\"\n        request = None\n        try:\n            request = http.request(\"PUT\", f\"{self.integrations_api_url}?source={self.bc_source}\",\n                                   body=json.dumps({\"path\": self.repo_path, \"branch\": branch}),\n                                   headers={\"Authorization\": self.bc_api_key, \"Content-Type\": \"application/json\"})\n            response = json.loads(request.data.decode(\"utf8\"))\n        except HTTPError as e:\n            logging.error(f\"Failed to commit repository {self.repo_path}\\n{e}\")\n            raise e\n        except JSONDecodeError as e:\n            logging.error(f\"Response of {self.integrations_api_url} is not a valid JSON\\n{e}\")\n            raise e\n        finally:\n            if request.status == 201 and response[\"result\"] == \"Success\":\n                logging.info(f\"Finalize repository {self.repo_id} in bridgecrew's platform\")\n            else:\n                raise Exception(f\"Failed to finalize repository {self.repo_id} in bridgecrew's platform\\n{response}\")\n\n    def _persist_file(self, full_file_path, relative_file_path):\n        tries = 4\n        curr_try = 0\n        file_object_key = os.path.join(self.repo_path, relative_file_path)\n        while curr_try < tries:\n            try:\n                self.s3_client.upload_file(full_file_path, self.bucket, file_object_key)\n                return\n            except ClientError as e:\n                if e.response.get('Error', {}).get('Code') == 'AccessDenied':\n                    sleep(5)\n                    curr_try += 1\n                else:\n                    logging.error(f\"failed to persist file {full_file_path} into S3 bucket {self.bucket}\\n{e}\")\n                    raise e\n            except Exception as e:\n                logging.error(f\"failed to persist file {full_file_path} into S3 bucket {self.bucket}\\n{e}\")\n                raise e\n        if curr_try == tries:\n            logging.error(f\"failed to persist file {full_file_path} into S3 bucket {self.bucket} - gut AccessDenied {tries} times\")\n\n    def get_guidelines(self) -> dict:\n        try:\n            request = http.request(\"GET\", self.guidelines_api_url)\n            response = json.loads(request.data.decode(\"utf8\"))\n            guidelines_map = response[\"guidelines\"]\n            logging.debug(f\"Got guidelines form Bridgecrew BE\")\n            return guidelines_map\n        except Exception as e:\n            logging.debug(f\"Failed to get the guidelines from {self.guidelines_api_url}, error:\\n{e}\")\n            return {}\n", "path": "checkov/common/bridgecrew/platform_integration.py"}], "after_files": [{"content": "import json\nimport logging\nimport os\nfrom json import JSONDecodeError\nfrom time import sleep\n\nimport boto3\nimport dpath.util\nimport urllib3\nfrom botocore.exceptions import ClientError\nfrom urllib3.exceptions import HTTPError\n\nfrom checkov.common.bridgecrew.platform_errors import BridgecrewAuthError\nfrom checkov.common.models.consts import SUPPORTED_FILE_EXTENSIONS\nfrom .wrapper import reduce_scan_reports, persist_checks_results, enrich_and_persist_checks_metadata\n\nUNAUTHORIZED_MESSAGE = 'User is not authorized to access this resource with an explicit deny'\n\nDEFAULT_REGION = \"us-west-2\"\n\ntry:\n    http = urllib3.ProxyManager(os.environ['https_proxy'])\nexcept KeyError:\n    http = urllib3.PoolManager()\n\n\nclass BcPlatformIntegration(object):\n    def __init__(self):\n        self.bc_api_key = None\n        self.s3_client = None\n        self.bucket = None\n        self.credentials = None\n        self.repo_path = None\n        self.repo_id = None\n        self.timestamp = None\n        self.scan_reports = []\n        self.bc_api_url = os.getenv('BC_API_URL', \"https://www.bridgecrew.cloud/api/v1\")\n        self.bc_source = os.getenv('BC_SOURCE', \"cli\")\n        self.integrations_api_url = f\"{self.bc_api_url}/integrations/types/checkov\"\n        self.guidelines_api_url = f\"{self.bc_api_url}/guidelines\"\n\n    def setup_bridgecrew_credentials(self, bc_api_key, repo_id):\n        \"\"\"\n        Setup credentials against Bridgecrew's platform.\n        :param repo_id: Identity string of the scanned repository, of the form <repo_owner>/<repo_name>\n        :param bc_api_key: Bridgecrew issued API key\n        \"\"\"\n        self.bc_api_key = bc_api_key\n        self.repo_id = repo_id\n        try:\n            request = http.request(\"POST\", self.integrations_api_url, body=json.dumps({\"repoId\": repo_id}),\n                                   headers={\"Authorization\": bc_api_key, \"Content-Type\": \"application/json\"})\n            response = json.loads(request.data.decode(\"utf8\"))\n            if 'Message' in response:\n                if response['Message'] == UNAUTHORIZED_MESSAGE:\n                    raise BridgecrewAuthError()\n            repo_full_path = response[\"path\"]\n            self.bucket, self.repo_path = repo_full_path.split(\"/\", 1)\n            self.timestamp = self.repo_path.split(\"/\")[-1]\n            self.credentials = response[\"creds\"]\n            self.s3_client = boto3.client(\"s3\",\n                                          aws_access_key_id=self.credentials[\"AccessKeyId\"],\n                                          aws_secret_access_key=self.credentials[\"SecretAccessKey\"],\n                                          aws_session_token=self.credentials[\"SessionToken\"],\n                                          region_name=DEFAULT_REGION\n                                          )\n            sleep(10)  # Wait for the policy to update\n        except HTTPError as e:\n            logging.error(f\"Failed to get customer assumed role\\n{e}\")\n            raise e\n        except ClientError as e:\n            logging.error(f\"Failed to initiate client with credentials {self.credentials}\\n{e}\")\n            raise e\n        except JSONDecodeError as e:\n            logging.error(f\"Response of {self.integrations_api_url} is not a valid JSON\\n{e}\")\n            raise e\n\n    def is_integration_configured(self):\n        \"\"\"\n        Checks if Bridgecrew integration is fully configured.\n        :return: True if the integration is configured, False otherwise\n        \"\"\"\n        return all([self.repo_path, self.credentials, self.s3_client])\n\n    def persist_repository(self, root_dir):\n        \"\"\"\n        Persist the repository found on root_dir path to Bridgecrew's platform\n        :param root_dir: Absolute path of the directory containing the repository root level\n        \"\"\"\n        for root_path, d_names, f_names in os.walk(root_dir):\n            for file_path in f_names:\n                _, file_extension = os.path.splitext(file_path)\n                if file_extension in SUPPORTED_FILE_EXTENSIONS:\n                    full_file_path = os.path.join(root_path, file_path)\n                    relative_file_path = os.path.relpath(full_file_path, root_dir)\n                    self._persist_file(full_file_path, relative_file_path)\n\n    def persist_scan_results(self, scan_reports):\n        \"\"\"\n        Persist checkov's scan result into bridgecrew's platform.\n        :param scan_reports: List of checkov scan reports\n        \"\"\"\n        self.scan_reports = scan_reports\n        reduced_scan_reports = reduce_scan_reports(scan_reports)\n        checks_metadata_paths = enrich_and_persist_checks_metadata(scan_reports, self.s3_client, self.bucket,\n                                                                   self.repo_path)\n        dpath.util.merge(reduced_scan_reports, checks_metadata_paths)\n        persist_checks_results(reduced_scan_reports, self.s3_client, self.bucket, self.repo_path)\n\n    def commit_repository(self, branch):\n        \"\"\"\n        :param branch: branch to be persisted\n        Finalize the repository's scanning in bridgecrew's platform.\n        \"\"\"\n        request = None\n        try:\n            request = http.request(\"PUT\", f\"{self.integrations_api_url}?source={self.bc_source}\",\n                                   body=json.dumps({\"path\": self.repo_path, \"branch\": branch}),\n                                   headers={\"Authorization\": self.bc_api_key, \"Content-Type\": \"application/json\"})\n            response = json.loads(request.data.decode(\"utf8\"))\n        except HTTPError as e:\n            logging.error(f\"Failed to commit repository {self.repo_path}\\n{e}\")\n            raise e\n        except JSONDecodeError as e:\n            logging.error(f\"Response of {self.integrations_api_url} is not a valid JSON\\n{e}\")\n            raise e\n        finally:\n            if request.status == 201 and response[\"result\"] == \"Success\":\n                logging.info(f\"Finalize repository {self.repo_id} in bridgecrew's platform\")\n            else:\n                raise Exception(f\"Failed to finalize repository {self.repo_id} in bridgecrew's platform\\n{response}\")\n\n    def _persist_file(self, full_file_path, relative_file_path):\n        tries = 4\n        curr_try = 0\n        file_object_key = os.path.join(self.repo_path, relative_file_path)\n        while curr_try < tries:\n            try:\n                self.s3_client.upload_file(full_file_path, self.bucket, file_object_key)\n                return\n            except ClientError as e:\n                if e.response.get('Error', {}).get('Code') == 'AccessDenied':\n                    sleep(5)\n                    curr_try += 1\n                else:\n                    logging.error(f\"failed to persist file {full_file_path} into S3 bucket {self.bucket}\\n{e}\")\n                    raise e\n            except Exception as e:\n                logging.error(f\"failed to persist file {full_file_path} into S3 bucket {self.bucket}\\n{e}\")\n                raise e\n        if curr_try == tries:\n            logging.error(f\"failed to persist file {full_file_path} into S3 bucket {self.bucket} - gut AccessDenied {tries} times\")\n\n    def get_guidelines(self) -> dict:\n        try:\n            request = http.request(\"GET\", self.guidelines_api_url)\n            response = json.loads(request.data.decode(\"utf8\"))\n            guidelines_map = response[\"guidelines\"]\n            logging.debug(f\"Got guidelines form Bridgecrew BE\")\n            return guidelines_map\n        except Exception as e:\n            logging.debug(f\"Failed to get the guidelines from {self.guidelines_api_url}, error:\\n{e}\")\n            return {}\n", "path": "checkov/common/bridgecrew/platform_integration.py"}]}