Skip to content

Commit

Permalink
fix(sast): add attribute verification (#6078)
Browse files Browse the repository at this point in the history
  • Loading branch information
omryMen authored Mar 10, 2024
1 parent 30bea74 commit 2b95629
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions checkov/common/bridgecrew/platform_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,15 +626,15 @@ def save_sast_report_locally(sast_scan_reports: Dict[str, Dict[str, Any]]) -> No
def persist_sast_scan_results(self, reports: List[Report]) -> None:
sast_scan_reports = {}
for report in reports:
if not report.check_type.startswith('sast'):
if not report.check_type.lower().startswith(CheckType.SAST):
continue
if not report.sast_report: # type: ignore
if not hasattr(report, 'sast_report') or not report.sast_report:
continue
for _, match_by_check in report.sast_report.rule_match.items(): # type: ignore
for _, match_by_check in report.sast_report.rule_match.items():
for _, match in match_by_check.items():
for m in match.matches:
self.adjust_sast_match_location_path(m)
sast_scan_reports[report.check_type] = report.sast_report.model_dump(mode='json') # type: ignore
sast_scan_reports[report.check_type] = report.sast_report.model_dump(mode='json')
if self.on_prem:
BcPlatformIntegration._delete_code_block_from_sast_report(sast_scan_reports)

Expand Down

0 comments on commit 2b95629

Please sign in to comment.