Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sca): Added fix details to junitxml #3456

Merged
merged 7 commits into from
Sep 2, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions checkov/common/output/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,13 @@ def _create_test_case_failure_output(self, record: Record) -> str:

if self.check_type == CheckType.SCA_PACKAGE:
if record.vulnerability_details:
if (record.vulnerability_details.get('lowest_fixed_version') is not None):
fix = record.vulnerability_details.get('lowest_fixed_version')
eurogig marked this conversation as resolved.
Show resolved Hide resolved
else:
fixlist = record.vulnerability_details.get('fixed_versions')
if fixlist is not None:
fix = fixlist

failure_output.extend(
[
"",
Expand All @@ -471,6 +478,9 @@ def _create_test_case_failure_output(self, record: Record) -> str:
f"Base Score: {record.vulnerability_details.get('cvss')}",
f"Vector: {record.vulnerability_details.get('vector')}",
f"Risk Factors: {record.vulnerability_details.get('risk_factors')}",
"Fix Details:",
f" Status: {record.vulnerability_details.get('status')}",
f" Fixed Version: {fix}",
]
)
else:
Expand Down