mirror of
https://github.com/usestrix/strix.git
synced 2026-08-25 12:22:37 +02:00
reporting: surface contextual CVSS in the markdown report; require reasoning only for surviving metrics
This commit is contained in:
@@ -215,6 +215,14 @@ def render_vulnerability_md(report: dict[str, Any]) -> str: # noqa: PLR0912, PL
|
||||
cvss = report.get("cvss")
|
||||
if cvss is not None:
|
||||
metadata.append(("CVSS", cvss))
|
||||
contextual_metrics = dep_meta.get("contextual_cvss_metrics")
|
||||
if isinstance(contextual_metrics, dict) and contextual_metrics:
|
||||
metadata.append(
|
||||
(
|
||||
"Contextual CVSS Metrics",
|
||||
"/".join(f"{metric}:{value}" for metric, value in contextual_metrics.items()),
|
||||
)
|
||||
)
|
||||
if report.get("fix_effort"):
|
||||
metadata.append(("Fix Effort", str(report["fix_effort"]).title()))
|
||||
for label, value in metadata:
|
||||
@@ -241,6 +249,11 @@ def render_vulnerability_md(report: dict[str, Any]) -> str: # noqa: PLR0912, PL
|
||||
lines.append(str(report["technical_analysis"]))
|
||||
lines.append("")
|
||||
|
||||
if dep_meta.get("contextual_cvss_reasoning"):
|
||||
lines.append("## Contextual CVSS\n")
|
||||
lines.append(str(dep_meta["contextual_cvss_reasoning"]))
|
||||
lines.append("")
|
||||
|
||||
if report.get("poc_description") or report.get("poc_script_code"):
|
||||
lines.append("## Proof of Concept\n")
|
||||
if report.get("poc_description"):
|
||||
|
||||
Reference in New Issue
Block a user