Class SuppressionRule
java.lang.Object
org.owasp.dependencycheck.xml.suppression.SuppressionRule
- Author:
- Jeremy Long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCpe(PropertyType cpe) Adds the CPE to the CPE list.voidAdds the CVE to the CVE list.voidaddCvssBelow(Double cvss) Adds the CVSS to the cvssBelow list.voidaddCvssV2Below(Double cvss) Adds the CVSS to the cvssV2Below list.voidaddCvssV3Below(Double cvss) Adds the CVSS to the cvssV3Below list.voidaddCvssV4Below(Double cvss) Adds the CVSS to the cvssV4Below list.voidAdds the CWE to the CWE list.voidAdds the CPE to the CPE list.protected booleanIdentifies if the cpe specified by the cpe suppression rule does not specify a version.booleanSuppression rules are considered equal if all properties except the "notes" and mutual "matched" status are equal.getCpe()Get the value of CPE.getCve()Get the value of CVE.Get the value of cvssBelow.Get the value of cvssV2Below.Get the value of cvssV3Below.Get the value of cvssV4Below.getCwe()Get the value of CWE.Get the value of filePath.getGav()Get the value of Maven GAV.getNotes()Get the value of notes.getSha1()Get the value of sha1.getUntil()Get the (@code{nullable}) value of until.booleanhasCpe()Returns whether or not this suppression rule as CPE entries.booleanhasCve()Returns whether this suppression rule has CVE entries.booleanReturns whether or not this suppression rule has CVSS suppression criteria.booleanReturns whether or not this suppression rule has CVSS v2 suppression criteria.booleanReturns whether or not this suppression rule has CVSS v3 suppression criteria.booleanReturns whether or not this suppression rule has CVSS v4 suppression criteria.booleanhasCwe()Returns whether this suppression rule has CWE entries.booleanhasGav()Returns whether or not this suppression rule as GAV entries.inthashCode()booleanhasNotes()Returns whether this suppression rule has notes entries.booleanReturns whether or not this suppression rule as packageUrl entries.booleanReturns whether this suppression rule has vulnerabilityName entries.protected booleanidentifierMatches(PropertyType suppressionEntry, Identifier identifier) Determines if the cpeEntry specified as a PropertyType matches the given Identifier.booleanisBase()Get the value of base.booleanGet the value of matched.voidprocess(Dependency dependency) Processes a given dependency to determine if any CPE, CVE, CWE, or CVSS scores should be suppressed.protected booleanpurlMatches(PropertyType suppressionEntry, Identifier identifier) Determines if the cpeEntry specified as a PropertyType matches the given Identifier.voidsetBase(boolean base) Set the value of base.voidsetCpe(List<PropertyType> cpe) Set the value of CPE.voidSet the value of CVE.voidsetCvssBelow(List<Double> cvssBelow) Set the value of cvssBelow.voidsetCvssV2Below(List<Double> cvssV2Below) Set the value of cvssV2Below.voidsetCvssV3Below(List<Double> cvssV3Below) Set the value of cvssV3Below.voidsetCvssV4Below(List<Double> cvssV4Below) Set the value of cvssV4Below.voidSet the value of CWE.voidsetFilePath(PropertyType filePath) Set the value of filePath.voidsetGav(PropertyType gav) Set the value of Maven GAV.voidsetMatched(boolean matched) Set the value of matched.voidSet the value of notes.voidsetPackageUrl(PropertyType purl) Set the value of Package URL.voidSet the value of SHA1.voidSet the value of until.toString()Standard toString implementation.
-
Constructor Details
-
SuppressionRule
public SuppressionRule()
-
-
Method Details
-
isMatched
public boolean isMatched()Get the value of matched.- Returns:
- the value of matched
-
setMatched
public void setMatched(boolean matched) Set the value of matched.- Parameters:
matched- new value of matched
-
getUntil
-
setUntil
-
getFilePath
-
setFilePath
Set the value of filePath.- Parameters:
filePath- new value of filePath
-
getSha1
-
setSha1
-
getCpe
-
setCpe
-
addCpe
-
addVulnerabilityName
Adds the CPE to the CPE list.- Parameters:
name- the vulnerability name to add
-
hasCpe
public boolean hasCpe()Returns whether or not this suppression rule as CPE entries.- Returns:
- whether or not this suppression rule as CPE entries
-
getCvssBelow
-
setCvssBelow
-
addCvssBelow
Adds the CVSS to the cvssBelow list.- Parameters:
cvss- the CVSS to add
-
hasCvssBelow
public boolean hasCvssBelow()Returns whether or not this suppression rule has CVSS suppression criteria.- Returns:
- whether or not this suppression rule has CVSS suppression criteria.
-
getCvssV2Below
-
setCvssV2Below
-
addCvssV2Below
Adds the CVSS to the cvssV2Below list.- Parameters:
cvss- the CVSS to add
-
hasCvssV2Below
public boolean hasCvssV2Below()Returns whether or not this suppression rule has CVSS v2 suppression criteria.- Returns:
- whether or not this suppression rule has CVSS v2 suppression criteria.
-
getCvssV3Below
-
setCvssV3Below
-
addCvssV3Below
Adds the CVSS to the cvssV3Below list.- Parameters:
cvss- the CVSS to add
-
hasCvssV3Below
public boolean hasCvssV3Below()Returns whether or not this suppression rule has CVSS v3 suppression criteria.- Returns:
- whether or not this suppression rule has CVSS v3 suppression criteria.
-
getCvssV4Below
-
setCvssV4Below
-
addCvssV4Below
Adds the CVSS to the cvssV4Below list.- Parameters:
cvss- the CVSS to add
-
hasCvssV4Below
public boolean hasCvssV4Below()Returns whether or not this suppression rule has CVSS v4 suppression criteria.- Returns:
- whether or not this suppression rule has CVSS v4 suppression criteria.
-
getNotes
-
setNotes
-
hasNotes
public boolean hasNotes()Returns whether this suppression rule has notes entries.- Returns:
- whether this suppression rule has notes entries
-
getCwe
-
setCwe
-
addCwe
-
hasCwe
public boolean hasCwe()Returns whether this suppression rule has CWE entries.- Returns:
- whether this suppression rule has CWE entries
-
getCve
-
setCve
-
addCve
-
hasCve
public boolean hasCve()Returns whether this suppression rule has CVE entries.- Returns:
- whether this suppression rule has CVE entries
-
hasVulnerabilityName
public boolean hasVulnerabilityName()Returns whether this suppression rule has vulnerabilityName entries.- Returns:
- whether this suppression rule has vulnerabilityName entries
-
getGav
-
setGav
Set the value of Maven GAV.- Parameters:
gav- new value of Maven GAV
-
hasGav
public boolean hasGav()Returns whether or not this suppression rule as GAV entries.- Returns:
- whether or not this suppression rule as GAV entries
-
setPackageUrl
Set the value of Package URL.- Parameters:
purl- new value of package URL
-
hasPackageUrl
public boolean hasPackageUrl()Returns whether or not this suppression rule as packageUrl entries.- Returns:
- whether or not this suppression rule as packageUrl entries
-
isBase
public boolean isBase()Get the value of base.- Returns:
- the value of base
-
setBase
public void setBase(boolean base) Set the value of base.- Parameters:
base- new value of base
-
process
Processes a given dependency to determine if any CPE, CVE, CWE, or CVSS scores should be suppressed. If any should be, they are removed from the dependency.- Parameters:
dependency- a project dependency to analyze
-
cpeHasNoVersion
Identifies if the cpe specified by the cpe suppression rule does not specify a version.- Parameters:
c- a suppression rule identifier- Returns:
- true if the property type does not specify a version; otherwise false
-
purlMatches
Determines if the cpeEntry specified as a PropertyType matches the given Identifier.- Parameters:
suppressionEntry- a suppression rule entryidentifier- a CPE identifier to check- Returns:
- true if the entry matches; otherwise false
-
identifierMatches
Determines if the cpeEntry specified as a PropertyType matches the given Identifier.- Parameters:
suppressionEntry- a suppression rule entryidentifier- a CPE identifier to check- Returns:
- true if the entry matches; otherwise false
-
toString
-
equals
-
hashCode
-