using request_wrapper in [image_scanner](get_scan_results_from_cache)
@@ -12,12 +12,11 @@ import json
import os
import time
-import requests
-
from checkov.common.bridgecrew.vulnerability_scanning.integrations.docker_image_scanning import \
docker_image_scanning_integration
from checkov.common.bridgecrew.platform_integration import bc_integration
from checkov.common.util.file_utils import decompress_file_gzip_base64
+from checkov.common.util.http_utils import request_wrapper
from checkov.common.bridgecrew.platform_key import bridgecrew_dir
TWISTCLI_FILE_NAME = 'twistcli'
@@ -118,11 +117,10 @@ class ImageScanner:
@staticmethod
def get_scan_results_from_cache(image_id: str) -> Dict[str, Any]:
image_id_encode = quote_plus(image_id)
- response = requests.request(
+ response = request_wrapper(
"GET", f"{bc_integration.api_url}/api/v1/vulnerabilities/scan-results/{image_id_encode}",
- headers=bc_integration.get_default_headers("GET")
+ headers=bc_integration.get_default_headers("GET"), should_call_raise_for_status=True
)
- response.raise_for_status()
response_json = response.json()
output_type = response_json["outputType"]
