Skip to content

Commit

Permalink
Merge pull request #1487 from Bidaya0/feat/new-sca-impl-scan-scan-add…
Browse files Browse the repository at this point in the history
…-field-fix-cwe-vul-type

feat: new sca impl api fix version.
  • Loading branch information
Bidaya0 authored Jun 2, 2023
2 parents fcefd4d + 669c630 commit a72b203
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions dongtai_web/dongtai_sca/scan/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,10 @@ def sca_scan_asset_v2(aql: str, ecosystem: str, package_name: str,
defaults={
"vul_codes":
vul.vul_codes.to_dict(),
"vul_type":
[get_type_with_cwe(cwe) for cwe in vul.vul_info.cwe],
"vul_type": [
get_cwe_name(cwe) if get_cwe_name(cwe) else cwe
for cwe in vul.vul_info.cwe
],
"vul_name":
vul.vul_info.title,
"vul_detail":
Expand All @@ -702,8 +704,10 @@ def sca_scan_asset_v2(aql: str, ecosystem: str, package_name: str,
vul.vul_info.published_time.timestamp()
if vul.vul_info.published_time else
vul.vul_info.create_time.timestamp(),
"affected_versions": vul.affected_versions,
"unaffected_versions": vul.unaffected_versions,
"affected_versions":
vul.affected_versions,
"unaffected_versions":
vul.unaffected_versions,
})
# need add update logic
vul_asset_rel = IastVulAssetRelationV2(
Expand Down

0 comments on commit a72b203

Please sign in to comment.