@NotThreadSafe public class Vulnerability extends Object implements Serializable, Comparable<Vulnerability>
| Modifier and Type | Class and Description |
|---|---|
static class |
Vulnerability.Source
An enumeration for the source of vulnerability.
|
| Constructor and Description |
|---|
Vulnerability()
Default constructor.
|
Vulnerability(String name)
Constructs a new Vulnerability by its name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCwe(String cwe)
Adds a CWE to the set.
|
void |
addReference(Reference ref)
Adds a reference to the references collection.
|
void |
addReference(String referenceSource,
String referenceName,
String referenceUrl)
Adds a reference.
|
void |
addVulnerableSoftware(VulnerableSoftware software)
Adds an entry for vulnerable software.
|
int |
compareTo(@NotNull Vulnerability o)
Compares two vulnerabilities.
|
boolean |
equals(Object obj) |
CvssV2 |
getCvssV2()
Get the CVSS V2 scoring information.
|
CvssV3 |
getCvssV3()
Get the CVSS V3 scoring information.
|
CweSet |
getCwes()
Get the set of CWEs.
|
String |
getDescription()
Get the value of description.
|
VulnerableSoftware |
getMatchedVulnerableSoftware()
Get the value of matchedVulnerableSoftware.
|
String |
getName()
Get the value of name.
|
String |
getNotes()
Get the value of notes from suppression notes.
|
Set<Reference> |
getReferences()
Get the value of references.
|
List<Reference> |
getReferences(boolean sorted)
Returns the list of references.
|
Vulnerability.Source |
getSource()
Returns the source that identified the vulnerability.
|
String |
getUnscoredSeverity()
Retrieves the severity a
Vulnerability.Source has assigned for which a CVSS
score is not available. |
Set<VulnerableSoftware> |
getVulnerableSoftware()
Get the value of vulnerableSoftware.
|
List<VulnerableSoftware> |
getVulnerableSoftware(boolean sorted)
Returns a sorted list of vulnerable software.
|
int |
hashCode() |
void |
setCvssV2(CvssV2 cvssV2)
Sets the CVSS V2 scoring information.
|
void |
setCvssV3(CvssV3 cvssV3)
Sets the CVSS V3 scoring information.
|
void |
setDescription(String description)
Set the value of description.
|
void |
setMatchedVulnerableSoftware(VulnerableSoftware software)
Sets the CPE that caused this vulnerability to be flagged.
|
void |
setName(String name)
Set the value of name.
|
void |
setNotes(String notes)
Set the value of notes.
|
void |
setReferences(Set<Reference> references)
Set the value of references.
|
void |
setSource(Vulnerability.Source source)
Sets the source that identified the vulnerability.
|
void |
setUnscoredSeverity(String unscoredSeverity)
Sets the severity a
Vulnerability.Source has assigned for which a CVSS score is
not available. |
void |
setVulnerableSoftware(Set<VulnerableSoftware> vulnerableSoftware)
Set the value of vulnerableSoftware.
|
String |
toString() |
public Vulnerability()
public Vulnerability(String name)
name - the name of the vulnerabilitypublic String getName()
public void setName(String name)
name - new value of namepublic String getDescription()
public void setDescription(String description)
description - new value of descriptionpublic Set<Reference> getReferences()
public List<Reference> getReferences(boolean sorted)
sorted - whether the returned list should be sortedpublic void setReferences(Set<Reference> references)
references - new value of referencespublic void addReference(Reference ref)
ref - a reference for the vulnerabilitypublic void addReference(String referenceSource, String referenceName, String referenceUrl)
referenceSource - the source of the referencereferenceName - the referenceName of the referencereferenceUrl - the url of the referencepublic Set<VulnerableSoftware> getVulnerableSoftware()
public List<VulnerableSoftware> getVulnerableSoftware(boolean sorted)
sorted - whether or not the list should be sortedpublic void setVulnerableSoftware(Set<VulnerableSoftware> vulnerableSoftware)
vulnerableSoftware - new value of vulnerableSoftwarepublic void addVulnerableSoftware(VulnerableSoftware software)
software - the vulnerable software reference to addpublic CvssV2 getCvssV2()
public void setCvssV2(CvssV2 cvssV2)
cvssV2 - the CVSS V2 scoring informationpublic CvssV3 getCvssV3()
public void setCvssV3(CvssV3 cvssV3)
cvssV3 - the CVSS V3 scoring informationpublic CweSet getCwes()
public void addCwe(String cwe)
cwe - new CWE to addpublic String getUnscoredSeverity()
Vulnerability.Source has assigned for which a CVSS
score is not available. Severity could be anything ranging from
'critical', 'high', 'medium', and 'low', to non-traditional labels like
'major', 'minor', and 'important'.public void setUnscoredSeverity(String unscoredSeverity)
Vulnerability.Source has assigned for which a CVSS score is
not available. Severity could be anything ranging from 'critical',
'high', 'medium', and 'low', to non-traditional labels like 'major',
'minor', and 'important'.unscoredSeverity - the un-scored severitypublic String getNotes()
public void setNotes(String notes)
notes - new value of cwespublic int compareTo(@NotNull
@NotNull Vulnerability o)
compareTo in interface Comparable<Vulnerability>o - a vulnerability to be comparedpublic void setMatchedVulnerableSoftware(VulnerableSoftware software)
software - a Vulnerable Software identifierpublic VulnerableSoftware getMatchedVulnerableSoftware()
public Vulnerability.Source getSource()
public void setSource(Vulnerability.Source source)
source - the sourceCopyright © 2012–2020 OWASP. All rights reserved.