Class Vulnerability
java.lang.Object
org.jenkinsci.plugins.cortexcloud.shared.Vulnerability
- All Implemented Interfaces:
Serializable
A single vulnerability or compliance finding reported by the Cortex CLI.
Field mapping mirrors the legacy plugin so the result UI ports cleanly. The
Gson SerializedName aliases make deserialization tolerant of the exact JSON key
names used by the CLI; once a real --output-format json payload is captured from
CLI >= 0.33.0, any renamed key is a one-line alias addition rather than a
redesign.
All getters are null-safe so a partial payload still renders.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Vulnerabilitycreate()Fluent builder used by ScanOutputParser to map the Cortex CLI's XDM finding schema onto this view model.cvss(double v) fixDate(long v) Unix epoch seconds when a fix became available (drives getTimeSinceFixDate()).booleangetBlock()getCause()getCve()doublegetCvss()longintgetId()booleanbooleangetLink()longbooleangetText()getTitle()getType()booleanpublished(long v) Sets the fix status, e.g.
-
Constructor Details
-
Vulnerability
public Vulnerability()
-
-
Method Details
-
create
Fluent builder used by ScanOutputParser to map the Cortex CLI's XDM finding schema onto this view model. Each setter returns this so a finding can be constructed in one expression. -
cve
-
severity
-
cvss
-
packageName
-
packageVersion
-
status
Sets the fix status, e.g. "fixed in 1.33.2" (drives getFixVersions()). -
link
-
description
-
title
-
type
-
fixDate
Unix epoch seconds when a fix became available (drives getTimeSinceFixDate()). -
published
-
getCve
-
getText
-
getLink
-
getId
public int getId() -
getSeverity
-
getCvss
public double getCvss() -
getDescription
-
getTitle
-
getCause
-
getType
- Returns:
- the finding type. When the CLI provides an explicit type string it is used as-is; otherwise findings without a CVE are treated as compliance issues. This is intentionally simpler than the legacy id-based mapping and will be refined against a captured JSON payload.
-
getStatus
-
getPackageName
-
getPackageVersion
-
getPublished
public long getPublished() -
getGracePeriodDays
-
getValidCve
public boolean getValidCve()- Returns:
- true when this finding has both a CVE identifier and a vendor link, i.e. it can be rendered as a working hyperlink in the results table. A link without a CVE (or vice versa) is not treated as linkable.
-
getBlock
public boolean getBlock() -
getIsFixed
public boolean getIsFixed() -
getShowFixLink
public boolean getShowFixLink() -
getFixLink
-
getFixVersions
-
getFixDate
public long getFixDate() -
getTimeSinceFixDate
-
getTimeSinceExpiration
-
getGraceDaysLeft
-
getIsCompliance
public boolean getIsCompliance() -
getDescriptionItems
- Returns:
- key/value items used to describe the finding in the result UI. Returns simple String[] pairs ([label, value]) to avoid a dependency on commons-lang Pair in the model layer.
-