Skip to content

Commit

Permalink
fix(sast): fix error logs coming from SAST (#5685)
Browse files Browse the repository at this point in the history
fix error logs coming from SAST
  • Loading branch information
gruebel authored Oct 24, 2023
1 parent 9abc66a commit cff5e87
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions checkov/sast/engines/prisma_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ def __init__(self) -> None:

def get_reports(self, targets: List[str], registry: Registry, languages: Set[SastLanguages]) -> List[Report]:
if not bc_integration.bc_api_key:
logging.info("The --bc-api-key flag needs to be set to run Sast prisma scanning")
logging.info("The --bc-api-key flag needs to be set to run SAST Prisma Cloud scanning")
return []

status = self.setup_sast_artifact()
if not status:
return []

self.setup_sast_artifact()
prisma_lib_path = self.get_sast_artifact()
if not prisma_lib_path:
return []
Expand Down Expand Up @@ -105,10 +108,14 @@ def download_sast_artifacts(self, current_version: str) -> bool:
headers = bc_integration.get_default_headers("GET")
headers["X-Client-Sast-Version"] = current_version
headers["X-Required-Sast-Version"] = "latest" # or ant version seperated with _
response = request_wrapper("GET",
f"{bc_integration.api_url}/{self.sast_platform_base_path}/{os_type}/{machine}/artifacts",
headers=headers,
should_call_raise_for_status=True)

# don't use the 'should_call_raise_for_status' parameter for now, because it logs errors messages
response = request_wrapper(
method="GET",
url=f"{bc_integration.api_url}/{self.sast_platform_base_path}/{os_type}/{machine}/artifacts",
headers=headers,
)
response.raise_for_status()

if response.status_code == 304:
return True
Expand Down

0 comments on commit cff5e87

Please sign in to comment.