adding vulnerable software

Former-commit-id: 8ce12bbab5ad294a3565f3f13e72611e3345168d
This commit is contained in:
Jeremy Long
2012-12-30 09:46:21 -05:00
parent 21947de4e0
commit 0b3e313260

View File

@@ -103,4 +103,63 @@ public class Vulnerability {
public void addReference(Reference ref) {
this.references.add(ref);
}
/**
* Adds a reference
* @param referenceSource the source of the referece
* @param referenceName the referenceName of the reference
* @param referenceUrl the url of the reference
*/
public void addReference(String referenceSource, String referenceName, String referenceUrl) {
Reference ref = new Reference();
ref.setSource(referenceSource);
ref.setName(referenceName);
ref.setUrl(referenceUrl);
this.references.add(ref);
}
/**
* a list of vulnerable software
*/
protected List<VulnerableSoftware> vulnerableSoftware;
/**
* Get the value of vulnerableSoftware
*
* @return the value of vulnerableSoftware
*/
public List<VulnerableSoftware> getVulnerableSoftware() {
return vulnerableSoftware;
}
/**
* Set the value of vulnerableSoftware
*
* @param vulnerableSoftware new value of vulnerableSoftware
*/
public void setVulnerableSoftware(List<VulnerableSoftware> vulnerableSoftware) {
this.vulnerableSoftware = vulnerableSoftware;
}
/**
* Adds an entry for vulnerable software
* @param cpe string representation of a cpe
* @param previousVersion the previous version (previousVersion - cpe would be considered vulnerable)
*/
public void addVulnerableSoftware(String cpe, String previousVersion) {
VulnerableSoftware vs = new VulnerableSoftware();
vs.setCpe(cpe);
if (previousVersion != null) {
vs.setPreviousVersion(previousVersion);
}
}
/**
* Adds an entry for vulnerable software
* @param cpe string representation of a CPE entry
*/
public void addVulnerableSoftware(String cpe) {
addVulnerableSoftware(cpe, null);
}
}