Skip to content

Commit

Permalink
chore: check that the OSV vulnerability ID is not None
Browse files Browse the repository at this point in the history
Signed-off-by: behnazh-w <behnaz.hassanshahi@oracle.com>
  • Loading branch information
behnazh-w committed Jan 7, 2025
1 parent 9bdde99 commit 60d5ec2
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,15 @@ def run_check(self, ctx: AnalyzeContext) -> CheckResultData:
logger.debug("Unable to get a valid response from %s: %s", self.osv_query_url, error)
if res_obj:
for vuln in res_obj.get("vulns", {}):
v_id = json_extract(vuln, ["id"], str)
result_tables.append(
MaliciousMetadataFacts(
known_malware=f"https://osv.dev/vulnerability/{v_id}",
result={},
detail_information=vuln,
confidence=Confidence.HIGH,
if v_id := json_extract(vuln, ["id"], str):
result_tables.append(
MaliciousMetadataFacts(
known_malware=f"https://osv.dev/vulnerability/{v_id}",
result={},
detail_information=vuln,
confidence=Confidence.HIGH,
)
)
)
if result_tables:
return CheckResultData(
result_tables=result_tables,
Expand Down

0 comments on commit 60d5ec2

Please sign in to comment.