diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.iface/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/iface/parts/interfaces/IVulnerabilityDatabase.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.iface/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/iface/parts/interfaces/IVulnerabilityDatabase.java index 83a3c44..a5120ab 100644 --- a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.iface/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/iface/parts/interfaces/IVulnerabilityDatabase.java +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.iface/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/iface/parts/interfaces/IVulnerabilityDatabase.java @@ -1,7 +1,5 @@ package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.iface.parts.interfaces; -import java.net.URI; - import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.CVEVulnerability; import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.CWEVulnerability; @@ -10,19 +8,21 @@ */ public interface IVulnerabilityDatabase { - /** - * Returns a CWEVulnerability for the given path - * - * @param path to the vulnerability database entry - * @return vulnerability - */ - public CWEVulnerability getCWEVulnerability(URI path); + /** + * Returns a CWEVulnerability for the given path + * + * @param identifier + * of the vulnerability database entry + * @return vulnerability + */ + public CWEVulnerability getCWEVulnerability(String identifier); - /** - * Returns a CVEVulnerability for the given path - * - * @param path to the vulnerability database entry - * @return vulnerability - */ - public CVEVulnerability getCVEVulnerability(URI path); + /** + * Returns a CVEVulnerability for the given identifier + * + * @param identifier + * of the vulnerability database entry + * @return vulnerability + */ + public CVEVulnerability getCVEVulnerability(String identifier); } diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/META-INF/MANIFEST.MF b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/META-INF/MANIFEST.MF index 6ea8c85..70fba54 100644 --- a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/META-INF/MANIFEST.MF +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/META-INF/MANIFEST.MF @@ -10,11 +10,15 @@ Require-Bundle: javax.inject, org.eclipse.e4.ui.di, org.eclipse.e4.ui.services, org.eclipse.e4.core.di.annotations, - org.palladiosimulator.pcm;bundle-version="5.0.0", + org.palladiosimulator.pcm, org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.iface, org.jsoup;bundle-version="1.8.3", - org.palladiosimulator.pcm.confidentiality.attacker + org.palladiosimulator.pcm.confidentiality.attacker, + org.apache.log4j, + javax.ws.rs, + com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider, + com.fasterxml.jackson.core.jackson-annotations Bundle-RequiredExecutionEnvironment: JavaSE-11 Automatic-Module-Name: org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis -Import-Package: javax.annotation;version="1.2.0" +Import-Package: javax.annotation Export-Package: org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.parts diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Affects.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Affects.java new file mode 100644 index 0000000..6e160e9 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Affects.java @@ -0,0 +1,80 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "vendor" }) +@Generated("jsonschema2pojo") +public class Affects { + + /** + * + * (Required) + * + */ + @JsonProperty("vendor") + private Vendor vendor; + + /** + * + * (Required) + * + */ + @JsonProperty("vendor") + public Vendor getVendor() { + return vendor; + } + + /** + * + * (Required) + * + */ + @JsonProperty("vendor") + public void setVendor(Vendor vendor) { + this.vendor = vendor; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(Affects.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("vendor"); + sb.append('='); + sb.append(((this.vendor == null) ? "" : this.vendor)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.vendor == null) ? 0 : this.vendor.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Affects) == false) { + return false; + } + Affects rhs = ((Affects) other); + return ((this.vendor == rhs.vendor) || ((this.vendor != null) && this.vendor.equals(rhs.vendor))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/BaseMetricV2.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/BaseMetricV2.java new file mode 100644 index 0000000..9fba4b0 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/BaseMetricV2.java @@ -0,0 +1,269 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * CVSS V2.0 score. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "cvssV2", "severity", "exploitabilityScore", "impactScore", "acInsufInfo", "obtainAllPrivilege", + "obtainUserPrivilege", "obtainOtherPrivilege", "userInteractionRequired" }) +@Generated("jsonschema2pojo") +public class BaseMetricV2 { + + /** + * JSON Schema for Common Vulnerability Scoring System version 2.0 + *

+ * + * + */ + @JsonProperty("cvssV2") + private CvssV20 cvssV2; + @JsonProperty("severity") + private String severity; + /** + * CVSS subscore. + * + */ + @JsonProperty("exploitabilityScore") + @JsonPropertyDescription("CVSS subscore.") + private Double exploitabilityScore; + /** + * CVSS subscore. + * + */ + @JsonProperty("impactScore") + @JsonPropertyDescription("CVSS subscore.") + private Double impactScore; + @JsonProperty("acInsufInfo") + private Boolean acInsufInfo; + @JsonProperty("obtainAllPrivilege") + private Boolean obtainAllPrivilege; + @JsonProperty("obtainUserPrivilege") + private Boolean obtainUserPrivilege; + @JsonProperty("obtainOtherPrivilege") + private Boolean obtainOtherPrivilege; + @JsonProperty("userInteractionRequired") + private Boolean userInteractionRequired; + + /** + * JSON Schema for Common Vulnerability Scoring System version 2.0 + *

+ * + * + */ + @JsonProperty("cvssV2") + public CvssV20 getCvssV2() { + return cvssV2; + } + + /** + * JSON Schema for Common Vulnerability Scoring System version 2.0 + *

+ * + * + */ + @JsonProperty("cvssV2") + public void setCvssV2(CvssV20 cvssV2) { + this.cvssV2 = cvssV2; + } + + @JsonProperty("severity") + public String getSeverity() { + return severity; + } + + @JsonProperty("severity") + public void setSeverity(String severity) { + this.severity = severity; + } + + /** + * CVSS subscore. + * + */ + @JsonProperty("exploitabilityScore") + public Double getExploitabilityScore() { + return exploitabilityScore; + } + + /** + * CVSS subscore. + * + */ + @JsonProperty("exploitabilityScore") + public void setExploitabilityScore(Double exploitabilityScore) { + this.exploitabilityScore = exploitabilityScore; + } + + /** + * CVSS subscore. + * + */ + @JsonProperty("impactScore") + public Double getImpactScore() { + return impactScore; + } + + /** + * CVSS subscore. + * + */ + @JsonProperty("impactScore") + public void setImpactScore(Double impactScore) { + this.impactScore = impactScore; + } + + @JsonProperty("acInsufInfo") + public Boolean getAcInsufInfo() { + return acInsufInfo; + } + + @JsonProperty("acInsufInfo") + public void setAcInsufInfo(Boolean acInsufInfo) { + this.acInsufInfo = acInsufInfo; + } + + @JsonProperty("obtainAllPrivilege") + public Boolean getObtainAllPrivilege() { + return obtainAllPrivilege; + } + + @JsonProperty("obtainAllPrivilege") + public void setObtainAllPrivilege(Boolean obtainAllPrivilege) { + this.obtainAllPrivilege = obtainAllPrivilege; + } + + @JsonProperty("obtainUserPrivilege") + public Boolean getObtainUserPrivilege() { + return obtainUserPrivilege; + } + + @JsonProperty("obtainUserPrivilege") + public void setObtainUserPrivilege(Boolean obtainUserPrivilege) { + this.obtainUserPrivilege = obtainUserPrivilege; + } + + @JsonProperty("obtainOtherPrivilege") + public Boolean getObtainOtherPrivilege() { + return obtainOtherPrivilege; + } + + @JsonProperty("obtainOtherPrivilege") + public void setObtainOtherPrivilege(Boolean obtainOtherPrivilege) { + this.obtainOtherPrivilege = obtainOtherPrivilege; + } + + @JsonProperty("userInteractionRequired") + public Boolean getUserInteractionRequired() { + return userInteractionRequired; + } + + @JsonProperty("userInteractionRequired") + public void setUserInteractionRequired(Boolean userInteractionRequired) { + this.userInteractionRequired = userInteractionRequired; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(BaseMetricV2.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("cvssV2"); + sb.append('='); + sb.append(((this.cvssV2 == null) ? "" : this.cvssV2)); + sb.append(','); + sb.append("severity"); + sb.append('='); + sb.append(((this.severity == null) ? "" : this.severity)); + sb.append(','); + sb.append("exploitabilityScore"); + sb.append('='); + sb.append(((this.exploitabilityScore == null) ? "" : this.exploitabilityScore)); + sb.append(','); + sb.append("impactScore"); + sb.append('='); + sb.append(((this.impactScore == null) ? "" : this.impactScore)); + sb.append(','); + sb.append("acInsufInfo"); + sb.append('='); + sb.append(((this.acInsufInfo == null) ? "" : this.acInsufInfo)); + sb.append(','); + sb.append("obtainAllPrivilege"); + sb.append('='); + sb.append(((this.obtainAllPrivilege == null) ? "" : this.obtainAllPrivilege)); + sb.append(','); + sb.append("obtainUserPrivilege"); + sb.append('='); + sb.append(((this.obtainUserPrivilege == null) ? "" : this.obtainUserPrivilege)); + sb.append(','); + sb.append("obtainOtherPrivilege"); + sb.append('='); + sb.append(((this.obtainOtherPrivilege == null) ? "" : this.obtainOtherPrivilege)); + sb.append(','); + sb.append("userInteractionRequired"); + sb.append('='); + sb.append(((this.userInteractionRequired == null) ? "" : this.userInteractionRequired)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.severity == null) ? 0 : this.severity.hashCode())); + result = ((result * 31) + ((this.exploitabilityScore == null) ? 0 : this.exploitabilityScore.hashCode())); + result = ((result * 31) + ((this.obtainAllPrivilege == null) ? 0 : this.obtainAllPrivilege.hashCode())); + result = ((result * 31) + + ((this.userInteractionRequired == null) ? 0 : this.userInteractionRequired.hashCode())); + result = ((result * 31) + ((this.obtainOtherPrivilege == null) ? 0 : this.obtainOtherPrivilege.hashCode())); + result = ((result * 31) + ((this.cvssV2 == null) ? 0 : this.cvssV2.hashCode())); + result = ((result * 31) + ((this.impactScore == null) ? 0 : this.impactScore.hashCode())); + result = ((result * 31) + ((this.acInsufInfo == null) ? 0 : this.acInsufInfo.hashCode())); + result = ((result * 31) + ((this.obtainUserPrivilege == null) ? 0 : this.obtainUserPrivilege.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof BaseMetricV2) == false) { + return false; + } + BaseMetricV2 rhs = ((BaseMetricV2) other); + return ((((((((((this.severity == rhs.severity) + || ((this.severity != null) && this.severity.equals(rhs.severity))) + && ((this.exploitabilityScore == rhs.exploitabilityScore) || ((this.exploitabilityScore != null) + && this.exploitabilityScore.equals(rhs.exploitabilityScore)))) + && ((this.obtainAllPrivilege == rhs.obtainAllPrivilege) || ((this.obtainAllPrivilege != null) + && this.obtainAllPrivilege.equals(rhs.obtainAllPrivilege)))) + && ((this.userInteractionRequired == rhs.userInteractionRequired) + || ((this.userInteractionRequired != null) + && this.userInteractionRequired.equals(rhs.userInteractionRequired)))) + && ((this.obtainOtherPrivilege == rhs.obtainOtherPrivilege) || ((this.obtainOtherPrivilege != null) + && this.obtainOtherPrivilege.equals(rhs.obtainOtherPrivilege)))) + && ((this.cvssV2 == rhs.cvssV2) || ((this.cvssV2 != null) && this.cvssV2.equals(rhs.cvssV2)))) + && ((this.impactScore == rhs.impactScore) + || ((this.impactScore != null) && this.impactScore.equals(rhs.impactScore)))) + && ((this.acInsufInfo == rhs.acInsufInfo) + || ((this.acInsufInfo != null) && this.acInsufInfo.equals(rhs.acInsufInfo)))) + && ((this.obtainUserPrivilege == rhs.obtainUserPrivilege) || ((this.obtainUserPrivilege != null) + && this.obtainUserPrivilege.equals(rhs.obtainUserPrivilege)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/BaseMetricV3.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/BaseMetricV3.java new file mode 100644 index 0000000..262e79d --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/BaseMetricV3.java @@ -0,0 +1,152 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * CVSS V3.x score. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "cvssV3", "exploitabilityScore", "impactScore" }) +@Generated("jsonschema2pojo") +public class BaseMetricV3 { + + /** + * JSON Schema for Common Vulnerability Scoring System version 3.x + *

+ * + * + */ + @JsonProperty("cvssV3") + private CvssV3X cvssV3; + /** + * CVSS subscore. + * + */ + @JsonProperty("exploitabilityScore") + @JsonPropertyDescription("CVSS subscore.") + private Double exploitabilityScore; + /** + * CVSS subscore. + * + */ + @JsonProperty("impactScore") + @JsonPropertyDescription("CVSS subscore.") + private Double impactScore; + + /** + * JSON Schema for Common Vulnerability Scoring System version 3.x + *

+ * + * + */ + @JsonProperty("cvssV3") + public CvssV3X getCvssV3() { + return cvssV3; + } + + /** + * JSON Schema for Common Vulnerability Scoring System version 3.x + *

+ * + * + */ + @JsonProperty("cvssV3") + public void setCvssV3(CvssV3X cvssV3) { + this.cvssV3 = cvssV3; + } + + /** + * CVSS subscore. + * + */ + @JsonProperty("exploitabilityScore") + public Double getExploitabilityScore() { + return exploitabilityScore; + } + + /** + * CVSS subscore. + * + */ + @JsonProperty("exploitabilityScore") + public void setExploitabilityScore(Double exploitabilityScore) { + this.exploitabilityScore = exploitabilityScore; + } + + /** + * CVSS subscore. + * + */ + @JsonProperty("impactScore") + public Double getImpactScore() { + return impactScore; + } + + /** + * CVSS subscore. + * + */ + @JsonProperty("impactScore") + public void setImpactScore(Double impactScore) { + this.impactScore = impactScore; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(BaseMetricV3.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("cvssV3"); + sb.append('='); + sb.append(((this.cvssV3 == null) ? "" : this.cvssV3)); + sb.append(','); + sb.append("exploitabilityScore"); + sb.append('='); + sb.append(((this.exploitabilityScore == null) ? "" : this.exploitabilityScore)); + sb.append(','); + sb.append("impactScore"); + sb.append('='); + sb.append(((this.impactScore == null) ? "" : this.impactScore)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.exploitabilityScore == null) ? 0 : this.exploitabilityScore.hashCode())); + result = ((result * 31) + ((this.cvssV3 == null) ? 0 : this.cvssV3.hashCode())); + result = ((result * 31) + ((this.impactScore == null) ? 0 : this.impactScore.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof BaseMetricV3) == false) { + return false; + } + BaseMetricV3 rhs = ((BaseMetricV3) other); + return ((((this.exploitabilityScore == rhs.exploitabilityScore) + || ((this.exploitabilityScore != null) && this.exploitabilityScore.equals(rhs.exploitabilityScore))) + && ((this.cvssV3 == rhs.cvssV3) || ((this.cvssV3 != null) && this.cvssV3.equals(rhs.cvssV3)))) + && ((this.impactScore == rhs.impactScore) + || ((this.impactScore != null) && this.impactScore.equals(rhs.impactScore)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CVEDataMeta.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CVEDataMeta.java new file mode 100644 index 0000000..d1e785a --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CVEDataMeta.java @@ -0,0 +1,131 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "ID", "ASSIGNER", "STATE" }) +@Generated("jsonschema2pojo") +public class CVEDataMeta { + + /** + * + * (Required) + * + */ + @JsonProperty("ID") + private String id; + /** + * + * (Required) + * + */ + @JsonProperty("ASSIGNER") + private String assigner; + @JsonProperty("STATE") + private String state; + + /** + * + * (Required) + * + */ + @JsonProperty("ID") + public String getId() { + return id; + } + + /** + * + * (Required) + * + */ + @JsonProperty("ID") + public void setId(String id) { + this.id = id; + } + + /** + * + * (Required) + * + */ + @JsonProperty("ASSIGNER") + public String getAssigner() { + return assigner; + } + + /** + * + * (Required) + * + */ + @JsonProperty("ASSIGNER") + public void setAssigner(String assigner) { + this.assigner = assigner; + } + + @JsonProperty("STATE") + public String getState() { + return state; + } + + @JsonProperty("STATE") + public void setState(String state) { + this.state = state; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(CVEDataMeta.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("id"); + sb.append('='); + sb.append(((this.id == null) ? "" : this.id)); + sb.append(','); + sb.append("assigner"); + sb.append('='); + sb.append(((this.assigner == null) ? "" : this.assigner)); + sb.append(','); + sb.append("state"); + sb.append('='); + sb.append(((this.state == null) ? "" : this.state)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.assigner == null) ? 0 : this.assigner.hashCode())); + result = ((result * 31) + ((this.id == null) ? 0 : this.id.hashCode())); + result = ((result * 31) + ((this.state == null) ? 0 : this.state.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof CVEDataMeta) == false) { + return false; + } + CVEDataMeta rhs = ((CVEDataMeta) other); + return ((((this.assigner == rhs.assigner) || ((this.assigner != null) && this.assigner.equals(rhs.assigner))) + && ((this.id == rhs.id) || ((this.id != null) && this.id.equals(rhs.id)))) + && ((this.state == rhs.state) || ((this.state != null) && this.state.equals(rhs.state)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CVEJSON40Min11.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CVEJSON40Min11.java new file mode 100644 index 0000000..634d78c --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CVEJSON40Min11.java @@ -0,0 +1,417 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "data_type", "data_format", "data_version", "CVE_data_meta", "affects", "problemtype", + "references", "description" }) +@Generated("jsonschema2pojo") +public class CVEJSON40Min11 { + + /** + * + * (Required) + * + */ + @JsonProperty("data_type") + private CVEJSON40Min11.DataType dataType; + /** + * + * (Required) + * + */ + @JsonProperty("data_format") + private CVEJSON40Min11.DataFormat dataFormat; + /** + * + * (Required) + * + */ + @JsonProperty("data_version") + private CVEJSON40Min11.DataVersion dataVersion; + /** + * + * (Required) + * + */ + @JsonProperty("CVE_data_meta") + private CVEDataMeta cveDataMeta; + @JsonProperty("affects") + private Affects affects; + /** + * + * (Required) + * + */ + @JsonProperty("problemtype") + private Problemtype problemtype; + /** + * + * (Required) + * + */ + @JsonProperty("references") + private References references; + /** + * + * (Required) + * + */ + @JsonProperty("description") + private Description description; + + /** + * + * (Required) + * + */ + @JsonProperty("data_type") + public CVEJSON40Min11.DataType getDataType() { + return dataType; + } + + /** + * + * (Required) + * + */ + @JsonProperty("data_type") + public void setDataType(CVEJSON40Min11.DataType dataType) { + this.dataType = dataType; + } + + /** + * + * (Required) + * + */ + @JsonProperty("data_format") + public CVEJSON40Min11.DataFormat getDataFormat() { + return dataFormat; + } + + /** + * + * (Required) + * + */ + @JsonProperty("data_format") + public void setDataFormat(CVEJSON40Min11.DataFormat dataFormat) { + this.dataFormat = dataFormat; + } + + /** + * + * (Required) + * + */ + @JsonProperty("data_version") + public CVEJSON40Min11.DataVersion getDataVersion() { + return dataVersion; + } + + /** + * + * (Required) + * + */ + @JsonProperty("data_version") + public void setDataVersion(CVEJSON40Min11.DataVersion dataVersion) { + this.dataVersion = dataVersion; + } + + @JsonProperty("CVE_data_meta") + public CVEDataMeta getCVEDataMeta() { + return cveDataMeta; + } + + @JsonProperty("CVE_data_meta") + public void setCVEDataMeta(CVEDataMeta cveDataMeta) { + this.cveDataMeta = cveDataMeta; + } + + @JsonProperty("affects") + public Affects getAffects() { + return affects; + } + + @JsonProperty("affects") + public void setAffects(Affects affects) { + this.affects = affects; + } + + /** + * + * (Required) + * + */ + @JsonProperty("problemtype") + public Problemtype getProblemtype() { + return problemtype; + } + + /** + * + * (Required) + * + */ + @JsonProperty("problemtype") + public void setProblemtype(Problemtype problemtype) { + this.problemtype = problemtype; + } + + /** + * + * (Required) + * + */ + @JsonProperty("references") + public References getReferences() { + return references; + } + + /** + * + * (Required) + * + */ + @JsonProperty("references") + public void setReferences(References references) { + this.references = references; + } + + /** + * + * (Required) + * + */ + @JsonProperty("description") + public Description getDescription() { + return description; + } + + /** + * + * (Required) + * + */ + @JsonProperty("description") + public void setDescription(Description description) { + this.description = description; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(CVEJSON40Min11.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("dataType"); + sb.append('='); + sb.append(((this.dataType == null) ? "" : this.dataType)); + sb.append(','); + sb.append("dataFormat"); + sb.append('='); + sb.append(((this.dataFormat == null) ? "" : this.dataFormat)); + sb.append(','); + sb.append("dataVersion"); + sb.append('='); + sb.append(((this.dataVersion == null) ? "" : this.dataVersion)); + sb.append(','); + sb.append("cveDataMeta"); + sb.append('='); + sb.append(((this.cveDataMeta == null) ? "" : this.cveDataMeta)); + sb.append(','); + sb.append("affects"); + sb.append('='); + sb.append(((this.affects == null) ? "" : this.affects)); + sb.append(','); + sb.append("problemtype"); + sb.append('='); + sb.append(((this.problemtype == null) ? "" : this.problemtype)); + sb.append(','); + sb.append("references"); + sb.append('='); + sb.append(((this.references == null) ? "" : this.references)); + sb.append(','); + sb.append("description"); + sb.append('='); + sb.append(((this.description == null) ? "" : this.description)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.references == null) ? 0 : this.references.hashCode())); + result = ((result * 31) + ((this.dataVersion == null) ? 0 : this.dataVersion.hashCode())); + result = ((result * 31) + ((this.dataFormat == null) ? 0 : this.dataFormat.hashCode())); + result = ((result * 31) + ((this.dataType == null) ? 0 : this.dataType.hashCode())); + result = ((result * 31) + ((this.cveDataMeta == null) ? 0 : this.cveDataMeta.hashCode())); + result = ((result * 31) + ((this.affects == null) ? 0 : this.affects.hashCode())); + result = ((result * 31) + ((this.description == null) ? 0 : this.description.hashCode())); + result = ((result * 31) + ((this.problemtype == null) ? 0 : this.problemtype.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof CVEJSON40Min11) == false) { + return false; + } + CVEJSON40Min11 rhs = ((CVEJSON40Min11) other); + return (((((((((this.references == rhs.references) + || ((this.references != null) && this.references.equals(rhs.references))) + && ((this.dataVersion == rhs.dataVersion) + || ((this.dataVersion != null) && this.dataVersion.equals(rhs.dataVersion)))) + && ((this.dataFormat == rhs.dataFormat) + || ((this.dataFormat != null) && this.dataFormat.equals(rhs.dataFormat)))) + && ((this.dataType == rhs.dataType) || ((this.dataType != null) && this.dataType.equals(rhs.dataType)))) + && ((this.cveDataMeta == rhs.cveDataMeta) + || ((this.cveDataMeta != null) && this.cveDataMeta.equals(rhs.cveDataMeta)))) + && ((this.affects == rhs.affects) || ((this.affects != null) && this.affects.equals(rhs.affects)))) + && ((this.description == rhs.description) + || ((this.description != null) && this.description.equals(rhs.description)))) + && ((this.problemtype == rhs.problemtype) + || ((this.problemtype != null) && this.problemtype.equals(rhs.problemtype)))); + } + + @Generated("jsonschema2pojo") + public enum DataFormat { + + MITRE("MITRE"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CVEJSON40Min11.DataFormat c : values()) { + CONSTANTS.put(c.value, c); + } + } + + DataFormat(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CVEJSON40Min11.DataFormat fromValue(String value) { + CVEJSON40Min11.DataFormat constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum DataType { + + CVE("CVE"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CVEJSON40Min11.DataType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + DataType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CVEJSON40Min11.DataType fromValue(String value) { + CVEJSON40Min11.DataType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum DataVersion { + + _4_0("4.0"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CVEJSON40Min11.DataVersion c : values()) { + CONSTANTS.put(c.value, c); + } + } + + DataVersion(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CVEJSON40Min11.DataVersion fromValue(String value) { + CVEJSON40Min11.DataVersion constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CvssV20.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CvssV20.java new file mode 100644 index 0000000..23e09b3 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CvssV20.java @@ -0,0 +1,918 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * JSON Schema for Common Vulnerability Scoring System version 2.0 + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "version", "vectorString", "accessVector", "accessComplexity", "authentication", + "confidentialityImpact", "integrityImpact", "availabilityImpact", "baseScore", "exploitability", + "remediationLevel", "reportConfidence", "temporalScore", "collateralDamagePotential", "targetDistribution", + "confidentialityRequirement", "integrityRequirement", "availabilityRequirement", "environmentalScore" }) +@Generated("jsonschema2pojo") +public class CvssV20 { + + /** + * CVSS Version (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("CVSS Version") + private CvssV20.Version version; + /** + * + * (Required) + * + */ + @JsonProperty("vectorString") + private String vectorString; + @JsonProperty("accessVector") + private CvssV20.AccessVectorType accessVector; + @JsonProperty("accessComplexity") + private CvssV20.AccessComplexityType accessComplexity; + @JsonProperty("authentication") + private CvssV20.AuthenticationType authentication; + @JsonProperty("confidentialityImpact") + private CvssV20.CiaType confidentialityImpact; + @JsonProperty("integrityImpact") + private CvssV20.CiaType integrityImpact; + @JsonProperty("availabilityImpact") + private CvssV20.CiaType availabilityImpact; + /** + * + * (Required) + * + */ + @JsonProperty("baseScore") + private Double baseScore; + @JsonProperty("exploitability") + private CvssV20.ExploitabilityType exploitability; + @JsonProperty("remediationLevel") + private CvssV20.RemediationLevelType remediationLevel; + @JsonProperty("reportConfidence") + private CvssV20.ReportConfidenceType reportConfidence; + @JsonProperty("temporalScore") + private Double temporalScore; + @JsonProperty("collateralDamagePotential") + private CvssV20.CollateralDamagePotentialType collateralDamagePotential; + @JsonProperty("targetDistribution") + private CvssV20.TargetDistributionType targetDistribution; + @JsonProperty("confidentialityRequirement") + private CvssV20.CiaRequirementType confidentialityRequirement; + @JsonProperty("integrityRequirement") + private CvssV20.CiaRequirementType integrityRequirement; + @JsonProperty("availabilityRequirement") + private CvssV20.CiaRequirementType availabilityRequirement; + @JsonProperty("environmentalScore") + private Double environmentalScore; + + /** + * CVSS Version (Required) + * + */ + @JsonProperty("version") + public CvssV20.Version getVersion() { + return version; + } + + /** + * CVSS Version (Required) + * + */ + @JsonProperty("version") + public void setVersion(CvssV20.Version version) { + this.version = version; + } + + /** + * + * (Required) + * + */ + @JsonProperty("vectorString") + public String getVectorString() { + return vectorString; + } + + /** + * + * (Required) + * + */ + @JsonProperty("vectorString") + public void setVectorString(String vectorString) { + this.vectorString = vectorString; + } + + @JsonProperty("accessVector") + public CvssV20.AccessVectorType getAccessVector() { + return accessVector; + } + + @JsonProperty("accessVector") + public void setAccessVector(CvssV20.AccessVectorType accessVector) { + this.accessVector = accessVector; + } + + @JsonProperty("accessComplexity") + public CvssV20.AccessComplexityType getAccessComplexity() { + return accessComplexity; + } + + @JsonProperty("accessComplexity") + public void setAccessComplexity(CvssV20.AccessComplexityType accessComplexity) { + this.accessComplexity = accessComplexity; + } + + @JsonProperty("authentication") + public CvssV20.AuthenticationType getAuthentication() { + return authentication; + } + + @JsonProperty("authentication") + public void setAuthentication(CvssV20.AuthenticationType authentication) { + this.authentication = authentication; + } + + @JsonProperty("confidentialityImpact") + public CvssV20.CiaType getConfidentialityImpact() { + return confidentialityImpact; + } + + @JsonProperty("confidentialityImpact") + public void setConfidentialityImpact(CvssV20.CiaType confidentialityImpact) { + this.confidentialityImpact = confidentialityImpact; + } + + @JsonProperty("integrityImpact") + public CvssV20.CiaType getIntegrityImpact() { + return integrityImpact; + } + + @JsonProperty("integrityImpact") + public void setIntegrityImpact(CvssV20.CiaType integrityImpact) { + this.integrityImpact = integrityImpact; + } + + @JsonProperty("availabilityImpact") + public CvssV20.CiaType getAvailabilityImpact() { + return availabilityImpact; + } + + @JsonProperty("availabilityImpact") + public void setAvailabilityImpact(CvssV20.CiaType availabilityImpact) { + this.availabilityImpact = availabilityImpact; + } + + /** + * + * (Required) + * + */ + @JsonProperty("baseScore") + public Double getBaseScore() { + return baseScore; + } + + /** + * + * (Required) + * + */ + @JsonProperty("baseScore") + public void setBaseScore(Double baseScore) { + this.baseScore = baseScore; + } + + @JsonProperty("exploitability") + public CvssV20.ExploitabilityType getExploitability() { + return exploitability; + } + + @JsonProperty("exploitability") + public void setExploitability(CvssV20.ExploitabilityType exploitability) { + this.exploitability = exploitability; + } + + @JsonProperty("remediationLevel") + public CvssV20.RemediationLevelType getRemediationLevel() { + return remediationLevel; + } + + @JsonProperty("remediationLevel") + public void setRemediationLevel(CvssV20.RemediationLevelType remediationLevel) { + this.remediationLevel = remediationLevel; + } + + @JsonProperty("reportConfidence") + public CvssV20.ReportConfidenceType getReportConfidence() { + return reportConfidence; + } + + @JsonProperty("reportConfidence") + public void setReportConfidence(CvssV20.ReportConfidenceType reportConfidence) { + this.reportConfidence = reportConfidence; + } + + @JsonProperty("temporalScore") + public Double getTemporalScore() { + return temporalScore; + } + + @JsonProperty("temporalScore") + public void setTemporalScore(Double temporalScore) { + this.temporalScore = temporalScore; + } + + @JsonProperty("collateralDamagePotential") + public CvssV20.CollateralDamagePotentialType getCollateralDamagePotential() { + return collateralDamagePotential; + } + + @JsonProperty("collateralDamagePotential") + public void setCollateralDamagePotential(CvssV20.CollateralDamagePotentialType collateralDamagePotential) { + this.collateralDamagePotential = collateralDamagePotential; + } + + @JsonProperty("targetDistribution") + public CvssV20.TargetDistributionType getTargetDistribution() { + return targetDistribution; + } + + @JsonProperty("targetDistribution") + public void setTargetDistribution(CvssV20.TargetDistributionType targetDistribution) { + this.targetDistribution = targetDistribution; + } + + @JsonProperty("confidentialityRequirement") + public CvssV20.CiaRequirementType getConfidentialityRequirement() { + return confidentialityRequirement; + } + + @JsonProperty("confidentialityRequirement") + public void setConfidentialityRequirement(CvssV20.CiaRequirementType confidentialityRequirement) { + this.confidentialityRequirement = confidentialityRequirement; + } + + @JsonProperty("integrityRequirement") + public CvssV20.CiaRequirementType getIntegrityRequirement() { + return integrityRequirement; + } + + @JsonProperty("integrityRequirement") + public void setIntegrityRequirement(CvssV20.CiaRequirementType integrityRequirement) { + this.integrityRequirement = integrityRequirement; + } + + @JsonProperty("availabilityRequirement") + public CvssV20.CiaRequirementType getAvailabilityRequirement() { + return availabilityRequirement; + } + + @JsonProperty("availabilityRequirement") + public void setAvailabilityRequirement(CvssV20.CiaRequirementType availabilityRequirement) { + this.availabilityRequirement = availabilityRequirement; + } + + @JsonProperty("environmentalScore") + public Double getEnvironmentalScore() { + return environmentalScore; + } + + @JsonProperty("environmentalScore") + public void setEnvironmentalScore(Double environmentalScore) { + this.environmentalScore = environmentalScore; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(CvssV20.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("version"); + sb.append('='); + sb.append(((this.version == null) ? "" : this.version)); + sb.append(','); + sb.append("vectorString"); + sb.append('='); + sb.append(((this.vectorString == null) ? "" : this.vectorString)); + sb.append(','); + sb.append("accessVector"); + sb.append('='); + sb.append(((this.accessVector == null) ? "" : this.accessVector)); + sb.append(','); + sb.append("accessComplexity"); + sb.append('='); + sb.append(((this.accessComplexity == null) ? "" : this.accessComplexity)); + sb.append(','); + sb.append("authentication"); + sb.append('='); + sb.append(((this.authentication == null) ? "" : this.authentication)); + sb.append(','); + sb.append("confidentialityImpact"); + sb.append('='); + sb.append(((this.confidentialityImpact == null) ? "" : this.confidentialityImpact)); + sb.append(','); + sb.append("integrityImpact"); + sb.append('='); + sb.append(((this.integrityImpact == null) ? "" : this.integrityImpact)); + sb.append(','); + sb.append("availabilityImpact"); + sb.append('='); + sb.append(((this.availabilityImpact == null) ? "" : this.availabilityImpact)); + sb.append(','); + sb.append("baseScore"); + sb.append('='); + sb.append(((this.baseScore == null) ? "" : this.baseScore)); + sb.append(','); + sb.append("exploitability"); + sb.append('='); + sb.append(((this.exploitability == null) ? "" : this.exploitability)); + sb.append(','); + sb.append("remediationLevel"); + sb.append('='); + sb.append(((this.remediationLevel == null) ? "" : this.remediationLevel)); + sb.append(','); + sb.append("reportConfidence"); + sb.append('='); + sb.append(((this.reportConfidence == null) ? "" : this.reportConfidence)); + sb.append(','); + sb.append("temporalScore"); + sb.append('='); + sb.append(((this.temporalScore == null) ? "" : this.temporalScore)); + sb.append(','); + sb.append("collateralDamagePotential"); + sb.append('='); + sb.append(((this.collateralDamagePotential == null) ? "" : this.collateralDamagePotential)); + sb.append(','); + sb.append("targetDistribution"); + sb.append('='); + sb.append(((this.targetDistribution == null) ? "" : this.targetDistribution)); + sb.append(','); + sb.append("confidentialityRequirement"); + sb.append('='); + sb.append(((this.confidentialityRequirement == null) ? "" : this.confidentialityRequirement)); + sb.append(','); + sb.append("integrityRequirement"); + sb.append('='); + sb.append(((this.integrityRequirement == null) ? "" : this.integrityRequirement)); + sb.append(','); + sb.append("availabilityRequirement"); + sb.append('='); + sb.append(((this.availabilityRequirement == null) ? "" : this.availabilityRequirement)); + sb.append(','); + sb.append("environmentalScore"); + sb.append('='); + sb.append(((this.environmentalScore == null) ? "" : this.environmentalScore)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.temporalScore == null) ? 0 : this.temporalScore.hashCode())); + result = ((result * 31) + ((this.reportConfidence == null) ? 0 : this.reportConfidence.hashCode())); + result = ((result * 31) + ((this.availabilityImpact == null) ? 0 : this.availabilityImpact.hashCode())); + result = ((result * 31) + + ((this.collateralDamagePotential == null) ? 0 : this.collateralDamagePotential.hashCode())); + result = ((result * 31) + ((this.baseScore == null) ? 0 : this.baseScore.hashCode())); + result = ((result * 31) + ((this.version == null) ? 0 : this.version.hashCode())); + result = ((result * 31) + + ((this.confidentialityRequirement == null) ? 0 : this.confidentialityRequirement.hashCode())); + result = ((result * 31) + ((this.integrityRequirement == null) ? 0 : this.integrityRequirement.hashCode())); + result = ((result * 31) + ((this.remediationLevel == null) ? 0 : this.remediationLevel.hashCode())); + result = ((result * 31) + + ((this.availabilityRequirement == null) ? 0 : this.availabilityRequirement.hashCode())); + result = ((result * 31) + ((this.accessComplexity == null) ? 0 : this.accessComplexity.hashCode())); + result = ((result * 31) + ((this.confidentialityImpact == null) ? 0 : this.confidentialityImpact.hashCode())); + result = ((result * 31) + ((this.targetDistribution == null) ? 0 : this.targetDistribution.hashCode())); + result = ((result * 31) + ((this.environmentalScore == null) ? 0 : this.environmentalScore.hashCode())); + result = ((result * 31) + ((this.integrityImpact == null) ? 0 : this.integrityImpact.hashCode())); + result = ((result * 31) + ((this.vectorString == null) ? 0 : this.vectorString.hashCode())); + result = ((result * 31) + ((this.exploitability == null) ? 0 : this.exploitability.hashCode())); + result = ((result * 31) + ((this.accessVector == null) ? 0 : this.accessVector.hashCode())); + result = ((result * 31) + ((this.authentication == null) ? 0 : this.authentication.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof CvssV20) == false) { + return false; + } + CvssV20 rhs = ((CvssV20) other); + return ((((((((((((((((((((this.temporalScore == rhs.temporalScore) + || ((this.temporalScore != null) && this.temporalScore.equals(rhs.temporalScore))) + && ((this.reportConfidence == rhs.reportConfidence) + || ((this.reportConfidence != null) && this.reportConfidence.equals(rhs.reportConfidence)))) + && ((this.availabilityImpact == rhs.availabilityImpact) || ((this.availabilityImpact != null) + && this.availabilityImpact.equals(rhs.availabilityImpact)))) + && ((this.collateralDamagePotential == rhs.collateralDamagePotential) + || ((this.collateralDamagePotential != null) + && this.collateralDamagePotential.equals(rhs.collateralDamagePotential)))) + && ((this.baseScore == rhs.baseScore) + || ((this.baseScore != null) && this.baseScore.equals(rhs.baseScore)))) + && ((this.version == rhs.version) || ((this.version != null) && this.version.equals(rhs.version)))) + && ((this.confidentialityRequirement == rhs.confidentialityRequirement) + || ((this.confidentialityRequirement != null) + && this.confidentialityRequirement.equals(rhs.confidentialityRequirement)))) + && ((this.integrityRequirement == rhs.integrityRequirement) || ((this.integrityRequirement != null) + && this.integrityRequirement.equals(rhs.integrityRequirement)))) + && ((this.remediationLevel == rhs.remediationLevel) + || ((this.remediationLevel != null) && this.remediationLevel.equals(rhs.remediationLevel)))) + && ((this.availabilityRequirement == rhs.availabilityRequirement) + || ((this.availabilityRequirement != null) + && this.availabilityRequirement.equals(rhs.availabilityRequirement)))) + && ((this.accessComplexity == rhs.accessComplexity) + || ((this.accessComplexity != null) && this.accessComplexity.equals(rhs.accessComplexity)))) + && ((this.confidentialityImpact == rhs.confidentialityImpact) || ((this.confidentialityImpact != null) + && this.confidentialityImpact.equals(rhs.confidentialityImpact)))) + && ((this.targetDistribution == rhs.targetDistribution) || ((this.targetDistribution != null) + && this.targetDistribution.equals(rhs.targetDistribution)))) + && ((this.environmentalScore == rhs.environmentalScore) || ((this.environmentalScore != null) + && this.environmentalScore.equals(rhs.environmentalScore)))) + && ((this.integrityImpact == rhs.integrityImpact) + || ((this.integrityImpact != null) && this.integrityImpact.equals(rhs.integrityImpact)))) + && ((this.vectorString == rhs.vectorString) + || ((this.vectorString != null) && this.vectorString.equals(rhs.vectorString)))) + && ((this.exploitability == rhs.exploitability) + || ((this.exploitability != null) && this.exploitability.equals(rhs.exploitability)))) + && ((this.accessVector == rhs.accessVector) + || ((this.accessVector != null) && this.accessVector.equals(rhs.accessVector)))) + && ((this.authentication == rhs.authentication) + || ((this.authentication != null) && this.authentication.equals(rhs.authentication)))); + } + + @Generated("jsonschema2pojo") + public enum AccessComplexityType { + + HIGH("HIGH"), MEDIUM("MEDIUM"), LOW("LOW"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV20.AccessComplexityType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + AccessComplexityType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV20.AccessComplexityType fromValue(String value) { + CvssV20.AccessComplexityType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum AccessVectorType { + + NETWORK("NETWORK"), ADJACENT_NETWORK("ADJACENT_NETWORK"), LOCAL("LOCAL"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV20.AccessVectorType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + AccessVectorType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV20.AccessVectorType fromValue(String value) { + CvssV20.AccessVectorType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum AuthenticationType { + + MULTIPLE("MULTIPLE"), SINGLE("SINGLE"), NONE("NONE"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV20.AuthenticationType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + AuthenticationType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV20.AuthenticationType fromValue(String value) { + CvssV20.AuthenticationType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum CiaRequirementType { + + LOW("LOW"), MEDIUM("MEDIUM"), HIGH("HIGH"), NOT_DEFINED("NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV20.CiaRequirementType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + CiaRequirementType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV20.CiaRequirementType fromValue(String value) { + CvssV20.CiaRequirementType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum CiaType { + + NONE("NONE"), PARTIAL("PARTIAL"), COMPLETE("COMPLETE"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV20.CiaType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + CiaType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV20.CiaType fromValue(String value) { + CvssV20.CiaType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum CollateralDamagePotentialType { + + NONE("NONE"), LOW("LOW"), LOW_MEDIUM("LOW_MEDIUM"), MEDIUM_HIGH("MEDIUM_HIGH"), HIGH("HIGH"), NOT_DEFINED( + "NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV20.CollateralDamagePotentialType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + CollateralDamagePotentialType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV20.CollateralDamagePotentialType fromValue(String value) { + CvssV20.CollateralDamagePotentialType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum ExploitabilityType { + + UNPROVEN("UNPROVEN"), PROOF_OF_CONCEPT("PROOF_OF_CONCEPT"), FUNCTIONAL("FUNCTIONAL"), HIGH("HIGH"), NOT_DEFINED( + "NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV20.ExploitabilityType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + ExploitabilityType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV20.ExploitabilityType fromValue(String value) { + CvssV20.ExploitabilityType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum RemediationLevelType { + + OFFICIAL_FIX("OFFICIAL_FIX"), TEMPORARY_FIX("TEMPORARY_FIX"), WORKAROUND("WORKAROUND"), UNAVAILABLE( + "UNAVAILABLE"), NOT_DEFINED("NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV20.RemediationLevelType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + RemediationLevelType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV20.RemediationLevelType fromValue(String value) { + CvssV20.RemediationLevelType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum ReportConfidenceType { + + UNCONFIRMED("UNCONFIRMED"), UNCORROBORATED("UNCORROBORATED"), CONFIRMED("CONFIRMED"), NOT_DEFINED( + "NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV20.ReportConfidenceType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + ReportConfidenceType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV20.ReportConfidenceType fromValue(String value) { + CvssV20.ReportConfidenceType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum TargetDistributionType { + + NONE("NONE"), LOW("LOW"), MEDIUM("MEDIUM"), HIGH("HIGH"), NOT_DEFINED("NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV20.TargetDistributionType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + TargetDistributionType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV20.TargetDistributionType fromValue(String value) { + CvssV20.TargetDistributionType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + /** + * CVSS Version + * + */ + @Generated("jsonschema2pojo") + public enum Version { + + _2_0("2.0"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV20.Version c : values()) { + CONSTANTS.put(c.value, c); + } + } + + Version(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV20.Version fromValue(String value) { + CvssV20.Version constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CvssV3X.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CvssV3X.java new file mode 100644 index 0000000..bc866f1 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/CvssV3X.java @@ -0,0 +1,1433 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * JSON Schema for Common Vulnerability Scoring System version 3.x + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "version", "vectorString", "attackVector", "attackComplexity", "privilegesRequired", + "userInteraction", "scope", "confidentialityImpact", "integrityImpact", "availabilityImpact", "baseScore", + "baseSeverity", "exploitCodeMaturity", "remediationLevel", "reportConfidence", "temporalScore", + "temporalSeverity", "confidentialityRequirement", "integrityRequirement", "availabilityRequirement", + "modifiedAttackVector", "modifiedAttackComplexity", "modifiedPrivilegesRequired", "modifiedUserInteraction", + "modifiedScope", "modifiedConfidentialityImpact", "modifiedIntegrityImpact", "modifiedAvailabilityImpact", + "environmentalScore", "environmentalSeverity" }) +@Generated("jsonschema2pojo") +public class CvssV3X { + + /** + * CVSS Version (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("CVSS Version") + private CvssV3X.Version version; + /** + * + * (Required) + * + */ + @JsonProperty("vectorString") + private String vectorString; + @JsonProperty("attackVector") + private CvssV3X.AttackVectorType attackVector; + @JsonProperty("attackComplexity") + private CvssV3X.AttackComplexityType attackComplexity; + @JsonProperty("privilegesRequired") + private CvssV3X.PrivilegesRequiredType privilegesRequired; + @JsonProperty("userInteraction") + private CvssV3X.UserInteractionType userInteraction; + @JsonProperty("scope") + private CvssV3X.ScopeType scope; + @JsonProperty("confidentialityImpact") + private CvssV3X.CiaType confidentialityImpact; + @JsonProperty("integrityImpact") + private CvssV3X.CiaType integrityImpact; + @JsonProperty("availabilityImpact") + private CvssV3X.CiaType availabilityImpact; + /** + * + * (Required) + * + */ + @JsonProperty("baseScore") + private Double baseScore; + /** + * + * (Required) + * + */ + @JsonProperty("baseSeverity") + private CvssV3X.SeverityType baseSeverity; + @JsonProperty("exploitCodeMaturity") + private CvssV3X.ExploitCodeMaturityType exploitCodeMaturity; + @JsonProperty("remediationLevel") + private CvssV3X.RemediationLevelType remediationLevel; + @JsonProperty("reportConfidence") + private CvssV3X.ConfidenceType reportConfidence; + @JsonProperty("temporalScore") + private Double temporalScore; + @JsonProperty("temporalSeverity") + private CvssV3X.SeverityType temporalSeverity; + @JsonProperty("confidentialityRequirement") + private CvssV3X.CiaRequirementType confidentialityRequirement; + @JsonProperty("integrityRequirement") + private CvssV3X.CiaRequirementType integrityRequirement; + @JsonProperty("availabilityRequirement") + private CvssV3X.CiaRequirementType availabilityRequirement; + @JsonProperty("modifiedAttackVector") + private CvssV3X.ModifiedAttackVectorType modifiedAttackVector; + @JsonProperty("modifiedAttackComplexity") + private CvssV3X.ModifiedAttackComplexityType modifiedAttackComplexity; + @JsonProperty("modifiedPrivilegesRequired") + private CvssV3X.ModifiedPrivilegesRequiredType modifiedPrivilegesRequired; + @JsonProperty("modifiedUserInteraction") + private CvssV3X.ModifiedUserInteractionType modifiedUserInteraction; + @JsonProperty("modifiedScope") + private CvssV3X.ModifiedScopeType modifiedScope; + @JsonProperty("modifiedConfidentialityImpact") + private CvssV3X.ModifiedCiaType modifiedConfidentialityImpact; + @JsonProperty("modifiedIntegrityImpact") + private CvssV3X.ModifiedCiaType modifiedIntegrityImpact; + @JsonProperty("modifiedAvailabilityImpact") + private CvssV3X.ModifiedCiaType modifiedAvailabilityImpact; + @JsonProperty("environmentalScore") + private Double environmentalScore; + @JsonProperty("environmentalSeverity") + private CvssV3X.SeverityType environmentalSeverity; + + /** + * CVSS Version (Required) + * + */ + @JsonProperty("version") + public CvssV3X.Version getVersion() { + return version; + } + + /** + * CVSS Version (Required) + * + */ + @JsonProperty("version") + public void setVersion(CvssV3X.Version version) { + this.version = version; + } + + /** + * + * (Required) + * + */ + @JsonProperty("vectorString") + public String getVectorString() { + return vectorString; + } + + /** + * + * (Required) + * + */ + @JsonProperty("vectorString") + public void setVectorString(String vectorString) { + this.vectorString = vectorString; + } + + @JsonProperty("attackVector") + public CvssV3X.AttackVectorType getAttackVector() { + return attackVector; + } + + @JsonProperty("attackVector") + public void setAttackVector(CvssV3X.AttackVectorType attackVector) { + this.attackVector = attackVector; + } + + @JsonProperty("attackComplexity") + public CvssV3X.AttackComplexityType getAttackComplexity() { + return attackComplexity; + } + + @JsonProperty("attackComplexity") + public void setAttackComplexity(CvssV3X.AttackComplexityType attackComplexity) { + this.attackComplexity = attackComplexity; + } + + @JsonProperty("privilegesRequired") + public CvssV3X.PrivilegesRequiredType getPrivilegesRequired() { + return privilegesRequired; + } + + @JsonProperty("privilegesRequired") + public void setPrivilegesRequired(CvssV3X.PrivilegesRequiredType privilegesRequired) { + this.privilegesRequired = privilegesRequired; + } + + @JsonProperty("userInteraction") + public CvssV3X.UserInteractionType getUserInteraction() { + return userInteraction; + } + + @JsonProperty("userInteraction") + public void setUserInteraction(CvssV3X.UserInteractionType userInteraction) { + this.userInteraction = userInteraction; + } + + @JsonProperty("scope") + public CvssV3X.ScopeType getScope() { + return scope; + } + + @JsonProperty("scope") + public void setScope(CvssV3X.ScopeType scope) { + this.scope = scope; + } + + @JsonProperty("confidentialityImpact") + public CvssV3X.CiaType getConfidentialityImpact() { + return confidentialityImpact; + } + + @JsonProperty("confidentialityImpact") + public void setConfidentialityImpact(CvssV3X.CiaType confidentialityImpact) { + this.confidentialityImpact = confidentialityImpact; + } + + @JsonProperty("integrityImpact") + public CvssV3X.CiaType getIntegrityImpact() { + return integrityImpact; + } + + @JsonProperty("integrityImpact") + public void setIntegrityImpact(CvssV3X.CiaType integrityImpact) { + this.integrityImpact = integrityImpact; + } + + @JsonProperty("availabilityImpact") + public CvssV3X.CiaType getAvailabilityImpact() { + return availabilityImpact; + } + + @JsonProperty("availabilityImpact") + public void setAvailabilityImpact(CvssV3X.CiaType availabilityImpact) { + this.availabilityImpact = availabilityImpact; + } + + /** + * + * (Required) + * + */ + @JsonProperty("baseScore") + public Double getBaseScore() { + return baseScore; + } + + /** + * + * (Required) + * + */ + @JsonProperty("baseScore") + public void setBaseScore(Double baseScore) { + this.baseScore = baseScore; + } + + /** + * + * (Required) + * + */ + @JsonProperty("baseSeverity") + public CvssV3X.SeverityType getBaseSeverity() { + return baseSeverity; + } + + /** + * + * (Required) + * + */ + @JsonProperty("baseSeverity") + public void setBaseSeverity(CvssV3X.SeverityType baseSeverity) { + this.baseSeverity = baseSeverity; + } + + @JsonProperty("exploitCodeMaturity") + public CvssV3X.ExploitCodeMaturityType getExploitCodeMaturity() { + return exploitCodeMaturity; + } + + @JsonProperty("exploitCodeMaturity") + public void setExploitCodeMaturity(CvssV3X.ExploitCodeMaturityType exploitCodeMaturity) { + this.exploitCodeMaturity = exploitCodeMaturity; + } + + @JsonProperty("remediationLevel") + public CvssV3X.RemediationLevelType getRemediationLevel() { + return remediationLevel; + } + + @JsonProperty("remediationLevel") + public void setRemediationLevel(CvssV3X.RemediationLevelType remediationLevel) { + this.remediationLevel = remediationLevel; + } + + @JsonProperty("reportConfidence") + public CvssV3X.ConfidenceType getReportConfidence() { + return reportConfidence; + } + + @JsonProperty("reportConfidence") + public void setReportConfidence(CvssV3X.ConfidenceType reportConfidence) { + this.reportConfidence = reportConfidence; + } + + @JsonProperty("temporalScore") + public Double getTemporalScore() { + return temporalScore; + } + + @JsonProperty("temporalScore") + public void setTemporalScore(Double temporalScore) { + this.temporalScore = temporalScore; + } + + @JsonProperty("temporalSeverity") + public CvssV3X.SeverityType getTemporalSeverity() { + return temporalSeverity; + } + + @JsonProperty("temporalSeverity") + public void setTemporalSeverity(CvssV3X.SeverityType temporalSeverity) { + this.temporalSeverity = temporalSeverity; + } + + @JsonProperty("confidentialityRequirement") + public CvssV3X.CiaRequirementType getConfidentialityRequirement() { + return confidentialityRequirement; + } + + @JsonProperty("confidentialityRequirement") + public void setConfidentialityRequirement(CvssV3X.CiaRequirementType confidentialityRequirement) { + this.confidentialityRequirement = confidentialityRequirement; + } + + @JsonProperty("integrityRequirement") + public CvssV3X.CiaRequirementType getIntegrityRequirement() { + return integrityRequirement; + } + + @JsonProperty("integrityRequirement") + public void setIntegrityRequirement(CvssV3X.CiaRequirementType integrityRequirement) { + this.integrityRequirement = integrityRequirement; + } + + @JsonProperty("availabilityRequirement") + public CvssV3X.CiaRequirementType getAvailabilityRequirement() { + return availabilityRequirement; + } + + @JsonProperty("availabilityRequirement") + public void setAvailabilityRequirement(CvssV3X.CiaRequirementType availabilityRequirement) { + this.availabilityRequirement = availabilityRequirement; + } + + @JsonProperty("modifiedAttackVector") + public CvssV3X.ModifiedAttackVectorType getModifiedAttackVector() { + return modifiedAttackVector; + } + + @JsonProperty("modifiedAttackVector") + public void setModifiedAttackVector(CvssV3X.ModifiedAttackVectorType modifiedAttackVector) { + this.modifiedAttackVector = modifiedAttackVector; + } + + @JsonProperty("modifiedAttackComplexity") + public CvssV3X.ModifiedAttackComplexityType getModifiedAttackComplexity() { + return modifiedAttackComplexity; + } + + @JsonProperty("modifiedAttackComplexity") + public void setModifiedAttackComplexity(CvssV3X.ModifiedAttackComplexityType modifiedAttackComplexity) { + this.modifiedAttackComplexity = modifiedAttackComplexity; + } + + @JsonProperty("modifiedPrivilegesRequired") + public CvssV3X.ModifiedPrivilegesRequiredType getModifiedPrivilegesRequired() { + return modifiedPrivilegesRequired; + } + + @JsonProperty("modifiedPrivilegesRequired") + public void setModifiedPrivilegesRequired(CvssV3X.ModifiedPrivilegesRequiredType modifiedPrivilegesRequired) { + this.modifiedPrivilegesRequired = modifiedPrivilegesRequired; + } + + @JsonProperty("modifiedUserInteraction") + public CvssV3X.ModifiedUserInteractionType getModifiedUserInteraction() { + return modifiedUserInteraction; + } + + @JsonProperty("modifiedUserInteraction") + public void setModifiedUserInteraction(CvssV3X.ModifiedUserInteractionType modifiedUserInteraction) { + this.modifiedUserInteraction = modifiedUserInteraction; + } + + @JsonProperty("modifiedScope") + public CvssV3X.ModifiedScopeType getModifiedScope() { + return modifiedScope; + } + + @JsonProperty("modifiedScope") + public void setModifiedScope(CvssV3X.ModifiedScopeType modifiedScope) { + this.modifiedScope = modifiedScope; + } + + @JsonProperty("modifiedConfidentialityImpact") + public CvssV3X.ModifiedCiaType getModifiedConfidentialityImpact() { + return modifiedConfidentialityImpact; + } + + @JsonProperty("modifiedConfidentialityImpact") + public void setModifiedConfidentialityImpact(CvssV3X.ModifiedCiaType modifiedConfidentialityImpact) { + this.modifiedConfidentialityImpact = modifiedConfidentialityImpact; + } + + @JsonProperty("modifiedIntegrityImpact") + public CvssV3X.ModifiedCiaType getModifiedIntegrityImpact() { + return modifiedIntegrityImpact; + } + + @JsonProperty("modifiedIntegrityImpact") + public void setModifiedIntegrityImpact(CvssV3X.ModifiedCiaType modifiedIntegrityImpact) { + this.modifiedIntegrityImpact = modifiedIntegrityImpact; + } + + @JsonProperty("modifiedAvailabilityImpact") + public CvssV3X.ModifiedCiaType getModifiedAvailabilityImpact() { + return modifiedAvailabilityImpact; + } + + @JsonProperty("modifiedAvailabilityImpact") + public void setModifiedAvailabilityImpact(CvssV3X.ModifiedCiaType modifiedAvailabilityImpact) { + this.modifiedAvailabilityImpact = modifiedAvailabilityImpact; + } + + @JsonProperty("environmentalScore") + public Double getEnvironmentalScore() { + return environmentalScore; + } + + @JsonProperty("environmentalScore") + public void setEnvironmentalScore(Double environmentalScore) { + this.environmentalScore = environmentalScore; + } + + @JsonProperty("environmentalSeverity") + public CvssV3X.SeverityType getEnvironmentalSeverity() { + return environmentalSeverity; + } + + @JsonProperty("environmentalSeverity") + public void setEnvironmentalSeverity(CvssV3X.SeverityType environmentalSeverity) { + this.environmentalSeverity = environmentalSeverity; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(CvssV3X.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("version"); + sb.append('='); + sb.append(((this.version == null) ? "" : this.version)); + sb.append(','); + sb.append("vectorString"); + sb.append('='); + sb.append(((this.vectorString == null) ? "" : this.vectorString)); + sb.append(','); + sb.append("attackVector"); + sb.append('='); + sb.append(((this.attackVector == null) ? "" : this.attackVector)); + sb.append(','); + sb.append("attackComplexity"); + sb.append('='); + sb.append(((this.attackComplexity == null) ? "" : this.attackComplexity)); + sb.append(','); + sb.append("privilegesRequired"); + sb.append('='); + sb.append(((this.privilegesRequired == null) ? "" : this.privilegesRequired)); + sb.append(','); + sb.append("userInteraction"); + sb.append('='); + sb.append(((this.userInteraction == null) ? "" : this.userInteraction)); + sb.append(','); + sb.append("scope"); + sb.append('='); + sb.append(((this.scope == null) ? "" : this.scope)); + sb.append(','); + sb.append("confidentialityImpact"); + sb.append('='); + sb.append(((this.confidentialityImpact == null) ? "" : this.confidentialityImpact)); + sb.append(','); + sb.append("integrityImpact"); + sb.append('='); + sb.append(((this.integrityImpact == null) ? "" : this.integrityImpact)); + sb.append(','); + sb.append("availabilityImpact"); + sb.append('='); + sb.append(((this.availabilityImpact == null) ? "" : this.availabilityImpact)); + sb.append(','); + sb.append("baseScore"); + sb.append('='); + sb.append(((this.baseScore == null) ? "" : this.baseScore)); + sb.append(','); + sb.append("baseSeverity"); + sb.append('='); + sb.append(((this.baseSeverity == null) ? "" : this.baseSeverity)); + sb.append(','); + sb.append("exploitCodeMaturity"); + sb.append('='); + sb.append(((this.exploitCodeMaturity == null) ? "" : this.exploitCodeMaturity)); + sb.append(','); + sb.append("remediationLevel"); + sb.append('='); + sb.append(((this.remediationLevel == null) ? "" : this.remediationLevel)); + sb.append(','); + sb.append("reportConfidence"); + sb.append('='); + sb.append(((this.reportConfidence == null) ? "" : this.reportConfidence)); + sb.append(','); + sb.append("temporalScore"); + sb.append('='); + sb.append(((this.temporalScore == null) ? "" : this.temporalScore)); + sb.append(','); + sb.append("temporalSeverity"); + sb.append('='); + sb.append(((this.temporalSeverity == null) ? "" : this.temporalSeverity)); + sb.append(','); + sb.append("confidentialityRequirement"); + sb.append('='); + sb.append(((this.confidentialityRequirement == null) ? "" : this.confidentialityRequirement)); + sb.append(','); + sb.append("integrityRequirement"); + sb.append('='); + sb.append(((this.integrityRequirement == null) ? "" : this.integrityRequirement)); + sb.append(','); + sb.append("availabilityRequirement"); + sb.append('='); + sb.append(((this.availabilityRequirement == null) ? "" : this.availabilityRequirement)); + sb.append(','); + sb.append("modifiedAttackVector"); + sb.append('='); + sb.append(((this.modifiedAttackVector == null) ? "" : this.modifiedAttackVector)); + sb.append(','); + sb.append("modifiedAttackComplexity"); + sb.append('='); + sb.append(((this.modifiedAttackComplexity == null) ? "" : this.modifiedAttackComplexity)); + sb.append(','); + sb.append("modifiedPrivilegesRequired"); + sb.append('='); + sb.append(((this.modifiedPrivilegesRequired == null) ? "" : this.modifiedPrivilegesRequired)); + sb.append(','); + sb.append("modifiedUserInteraction"); + sb.append('='); + sb.append(((this.modifiedUserInteraction == null) ? "" : this.modifiedUserInteraction)); + sb.append(','); + sb.append("modifiedScope"); + sb.append('='); + sb.append(((this.modifiedScope == null) ? "" : this.modifiedScope)); + sb.append(','); + sb.append("modifiedConfidentialityImpact"); + sb.append('='); + sb.append(((this.modifiedConfidentialityImpact == null) ? "" : this.modifiedConfidentialityImpact)); + sb.append(','); + sb.append("modifiedIntegrityImpact"); + sb.append('='); + sb.append(((this.modifiedIntegrityImpact == null) ? "" : this.modifiedIntegrityImpact)); + sb.append(','); + sb.append("modifiedAvailabilityImpact"); + sb.append('='); + sb.append(((this.modifiedAvailabilityImpact == null) ? "" : this.modifiedAvailabilityImpact)); + sb.append(','); + sb.append("environmentalScore"); + sb.append('='); + sb.append(((this.environmentalScore == null) ? "" : this.environmentalScore)); + sb.append(','); + sb.append("environmentalSeverity"); + sb.append('='); + sb.append(((this.environmentalSeverity == null) ? "" : this.environmentalSeverity)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + + ((this.modifiedPrivilegesRequired == null) ? 0 : this.modifiedPrivilegesRequired.hashCode())); + result = ((result * 31) + ((this.reportConfidence == null) ? 0 : this.reportConfidence.hashCode())); + result = ((result * 31) + + ((this.modifiedConfidentialityImpact == null) ? 0 : this.modifiedConfidentialityImpact.hashCode())); + result = ((result * 31) + ((this.availabilityImpact == null) ? 0 : this.availabilityImpact.hashCode())); + result = ((result * 31) + ((this.privilegesRequired == null) ? 0 : this.privilegesRequired.hashCode())); + result = ((result * 31) + ((this.baseScore == null) ? 0 : this.baseScore.hashCode())); + result = ((result * 31) + ((this.temporalSeverity == null) ? 0 : this.temporalSeverity.hashCode())); + result = ((result * 31) + ((this.userInteraction == null) ? 0 : this.userInteraction.hashCode())); + result = ((result * 31) + ((this.integrityRequirement == null) ? 0 : this.integrityRequirement.hashCode())); + result = ((result * 31) + + ((this.modifiedAvailabilityImpact == null) ? 0 : this.modifiedAvailabilityImpact.hashCode())); + result = ((result * 31) + + ((this.availabilityRequirement == null) ? 0 : this.availabilityRequirement.hashCode())); + result = ((result * 31) + ((this.modifiedScope == null) ? 0 : this.modifiedScope.hashCode())); + result = ((result * 31) + ((this.attackComplexity == null) ? 0 : this.attackComplexity.hashCode())); + result = ((result * 31) + ((this.scope == null) ? 0 : this.scope.hashCode())); + result = ((result * 31) + ((this.attackVector == null) ? 0 : this.attackVector.hashCode())); + result = ((result * 31) + ((this.integrityImpact == null) ? 0 : this.integrityImpact.hashCode())); + result = ((result * 31) + + ((this.modifiedIntegrityImpact == null) ? 0 : this.modifiedIntegrityImpact.hashCode())); + result = ((result * 31) + ((this.vectorString == null) ? 0 : this.vectorString.hashCode())); + result = ((result * 31) + ((this.exploitCodeMaturity == null) ? 0 : this.exploitCodeMaturity.hashCode())); + result = ((result * 31) + ((this.temporalScore == null) ? 0 : this.temporalScore.hashCode())); + result = ((result * 31) + ((this.modifiedAttackVector == null) ? 0 : this.modifiedAttackVector.hashCode())); + result = ((result * 31) + ((this.version == null) ? 0 : this.version.hashCode())); + result = ((result * 31) + + ((this.confidentialityRequirement == null) ? 0 : this.confidentialityRequirement.hashCode())); + result = ((result * 31) + ((this.remediationLevel == null) ? 0 : this.remediationLevel.hashCode())); + result = ((result * 31) + + ((this.modifiedUserInteraction == null) ? 0 : this.modifiedUserInteraction.hashCode())); + result = ((result * 31) + + ((this.modifiedAttackComplexity == null) ? 0 : this.modifiedAttackComplexity.hashCode())); + result = ((result * 31) + ((this.baseSeverity == null) ? 0 : this.baseSeverity.hashCode())); + result = ((result * 31) + ((this.confidentialityImpact == null) ? 0 : this.confidentialityImpact.hashCode())); + result = ((result * 31) + ((this.environmentalScore == null) ? 0 : this.environmentalScore.hashCode())); + result = ((result * 31) + ((this.environmentalSeverity == null) ? 0 : this.environmentalSeverity.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof CvssV3X) == false) { + return false; + } + CvssV3X rhs = ((CvssV3X) other); + return (((((((((((((((((((((((((((((((this.modifiedPrivilegesRequired == rhs.modifiedPrivilegesRequired) + || ((this.modifiedPrivilegesRequired != null) + && this.modifiedPrivilegesRequired.equals(rhs.modifiedPrivilegesRequired))) + && ((this.reportConfidence == rhs.reportConfidence) + || ((this.reportConfidence != null) && this.reportConfidence.equals(rhs.reportConfidence)))) + && ((this.modifiedConfidentialityImpact == rhs.modifiedConfidentialityImpact) + || ((this.modifiedConfidentialityImpact != null) + && this.modifiedConfidentialityImpact.equals(rhs.modifiedConfidentialityImpact)))) + && ((this.availabilityImpact == rhs.availabilityImpact) || ((this.availabilityImpact != null) + && this.availabilityImpact.equals(rhs.availabilityImpact)))) + && ((this.privilegesRequired == rhs.privilegesRequired) || ((this.privilegesRequired != null) + && this.privilegesRequired.equals(rhs.privilegesRequired)))) + && ((this.baseScore == rhs.baseScore) + || ((this.baseScore != null) && this.baseScore.equals(rhs.baseScore)))) + && ((this.temporalSeverity == rhs.temporalSeverity) + || ((this.temporalSeverity != null) && this.temporalSeverity.equals(rhs.temporalSeverity)))) + && ((this.userInteraction == rhs.userInteraction) + || ((this.userInteraction != null) && this.userInteraction.equals(rhs.userInteraction)))) + && ((this.integrityRequirement == rhs.integrityRequirement) || ((this.integrityRequirement != null) + && this.integrityRequirement.equals(rhs.integrityRequirement)))) + && ((this.modifiedAvailabilityImpact == rhs.modifiedAvailabilityImpact) + || ((this.modifiedAvailabilityImpact != null) + && this.modifiedAvailabilityImpact.equals(rhs.modifiedAvailabilityImpact)))) + && ((this.availabilityRequirement == rhs.availabilityRequirement) + || ((this.availabilityRequirement != null) + && this.availabilityRequirement.equals(rhs.availabilityRequirement)))) + && ((this.modifiedScope == rhs.modifiedScope) + || ((this.modifiedScope != null) && this.modifiedScope.equals(rhs.modifiedScope)))) + && ((this.attackComplexity == rhs.attackComplexity) + || ((this.attackComplexity != null) && this.attackComplexity.equals(rhs.attackComplexity)))) + && ((this.scope == rhs.scope) || ((this.scope != null) && this.scope.equals(rhs.scope)))) + && ((this.attackVector == rhs.attackVector) + || ((this.attackVector != null) && this.attackVector.equals(rhs.attackVector)))) + && ((this.integrityImpact == rhs.integrityImpact) + || ((this.integrityImpact != null) && this.integrityImpact.equals(rhs.integrityImpact)))) + && ((this.modifiedIntegrityImpact == rhs.modifiedIntegrityImpact) + || ((this.modifiedIntegrityImpact != null) + && this.modifiedIntegrityImpact.equals(rhs.modifiedIntegrityImpact)))) + && ((this.vectorString == rhs.vectorString) + || ((this.vectorString != null) && this.vectorString.equals(rhs.vectorString)))) + && ((this.exploitCodeMaturity == rhs.exploitCodeMaturity) || ((this.exploitCodeMaturity != null) + && this.exploitCodeMaturity.equals(rhs.exploitCodeMaturity)))) + && ((this.temporalScore == rhs.temporalScore) + || ((this.temporalScore != null) && this.temporalScore.equals(rhs.temporalScore)))) + && ((this.modifiedAttackVector == rhs.modifiedAttackVector) || ((this.modifiedAttackVector != null) + && this.modifiedAttackVector.equals(rhs.modifiedAttackVector)))) + && ((this.version == rhs.version) || ((this.version != null) && this.version.equals(rhs.version)))) + && ((this.confidentialityRequirement == rhs.confidentialityRequirement) + || ((this.confidentialityRequirement != null) + && this.confidentialityRequirement.equals(rhs.confidentialityRequirement)))) + && ((this.remediationLevel == rhs.remediationLevel) + || ((this.remediationLevel != null) && this.remediationLevel.equals(rhs.remediationLevel)))) + && ((this.modifiedUserInteraction == rhs.modifiedUserInteraction) + || ((this.modifiedUserInteraction != null) + && this.modifiedUserInteraction.equals(rhs.modifiedUserInteraction)))) + && ((this.modifiedAttackComplexity == rhs.modifiedAttackComplexity) + || ((this.modifiedAttackComplexity != null) + && this.modifiedAttackComplexity.equals(rhs.modifiedAttackComplexity)))) + && ((this.baseSeverity == rhs.baseSeverity) + || ((this.baseSeverity != null) && this.baseSeverity.equals(rhs.baseSeverity)))) + && ((this.confidentialityImpact == rhs.confidentialityImpact) || ((this.confidentialityImpact != null) + && this.confidentialityImpact.equals(rhs.confidentialityImpact)))) + && ((this.environmentalScore == rhs.environmentalScore) || ((this.environmentalScore != null) + && this.environmentalScore.equals(rhs.environmentalScore)))) + && ((this.environmentalSeverity == rhs.environmentalSeverity) || ((this.environmentalSeverity != null) + && this.environmentalSeverity.equals(rhs.environmentalSeverity)))); + } + + @Generated("jsonschema2pojo") + public enum AttackComplexityType { + + HIGH("HIGH"), LOW("LOW"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.AttackComplexityType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + AttackComplexityType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.AttackComplexityType fromValue(String value) { + CvssV3X.AttackComplexityType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum AttackVectorType { + + NETWORK("NETWORK"), ADJACENT_NETWORK("ADJACENT_NETWORK"), LOCAL("LOCAL"), PHYSICAL("PHYSICAL"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.AttackVectorType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + AttackVectorType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.AttackVectorType fromValue(String value) { + CvssV3X.AttackVectorType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum CiaRequirementType { + + LOW("LOW"), MEDIUM("MEDIUM"), HIGH("HIGH"), NOT_DEFINED("NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.CiaRequirementType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + CiaRequirementType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.CiaRequirementType fromValue(String value) { + CvssV3X.CiaRequirementType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum CiaType { + + NONE("NONE"), LOW("LOW"), HIGH("HIGH"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.CiaType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + CiaType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.CiaType fromValue(String value) { + CvssV3X.CiaType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum ConfidenceType { + + UNKNOWN("UNKNOWN"), REASONABLE("REASONABLE"), CONFIRMED("CONFIRMED"), NOT_DEFINED("NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.ConfidenceType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + ConfidenceType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.ConfidenceType fromValue(String value) { + CvssV3X.ConfidenceType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum ExploitCodeMaturityType { + + UNPROVEN("UNPROVEN"), PROOF_OF_CONCEPT("PROOF_OF_CONCEPT"), FUNCTIONAL("FUNCTIONAL"), HIGH("HIGH"), NOT_DEFINED( + "NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.ExploitCodeMaturityType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + ExploitCodeMaturityType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.ExploitCodeMaturityType fromValue(String value) { + CvssV3X.ExploitCodeMaturityType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum ModifiedAttackComplexityType { + + HIGH("HIGH"), LOW("LOW"), NOT_DEFINED("NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.ModifiedAttackComplexityType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + ModifiedAttackComplexityType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.ModifiedAttackComplexityType fromValue(String value) { + CvssV3X.ModifiedAttackComplexityType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum ModifiedAttackVectorType { + + NETWORK("NETWORK"), ADJACENT_NETWORK("ADJACENT_NETWORK"), LOCAL("LOCAL"), PHYSICAL("PHYSICAL"), NOT_DEFINED( + "NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.ModifiedAttackVectorType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + ModifiedAttackVectorType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.ModifiedAttackVectorType fromValue(String value) { + CvssV3X.ModifiedAttackVectorType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum ModifiedCiaType { + + NONE("NONE"), LOW("LOW"), HIGH("HIGH"), NOT_DEFINED("NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.ModifiedCiaType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + ModifiedCiaType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.ModifiedCiaType fromValue(String value) { + CvssV3X.ModifiedCiaType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum ModifiedPrivilegesRequiredType { + + HIGH("HIGH"), LOW("LOW"), NONE("NONE"), NOT_DEFINED("NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.ModifiedPrivilegesRequiredType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + ModifiedPrivilegesRequiredType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.ModifiedPrivilegesRequiredType fromValue(String value) { + CvssV3X.ModifiedPrivilegesRequiredType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum ModifiedScopeType { + + UNCHANGED("UNCHANGED"), CHANGED("CHANGED"), NOT_DEFINED("NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.ModifiedScopeType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + ModifiedScopeType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.ModifiedScopeType fromValue(String value) { + CvssV3X.ModifiedScopeType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum ModifiedUserInteractionType { + + NONE("NONE"), REQUIRED("REQUIRED"), NOT_DEFINED("NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.ModifiedUserInteractionType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + ModifiedUserInteractionType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.ModifiedUserInteractionType fromValue(String value) { + CvssV3X.ModifiedUserInteractionType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum PrivilegesRequiredType { + + HIGH("HIGH"), LOW("LOW"), NONE("NONE"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.PrivilegesRequiredType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + PrivilegesRequiredType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.PrivilegesRequiredType fromValue(String value) { + CvssV3X.PrivilegesRequiredType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum RemediationLevelType { + + OFFICIAL_FIX("OFFICIAL_FIX"), TEMPORARY_FIX("TEMPORARY_FIX"), WORKAROUND("WORKAROUND"), UNAVAILABLE( + "UNAVAILABLE"), NOT_DEFINED("NOT_DEFINED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.RemediationLevelType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + RemediationLevelType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.RemediationLevelType fromValue(String value) { + CvssV3X.RemediationLevelType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum ScopeType { + + UNCHANGED("UNCHANGED"), CHANGED("CHANGED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.ScopeType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + ScopeType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.ScopeType fromValue(String value) { + CvssV3X.ScopeType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum SeverityType { + + NONE("NONE"), LOW("LOW"), MEDIUM("MEDIUM"), HIGH("HIGH"), CRITICAL("CRITICAL"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.SeverityType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + SeverityType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.SeverityType fromValue(String value) { + CvssV3X.SeverityType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum UserInteractionType { + + NONE("NONE"), REQUIRED("REQUIRED"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.UserInteractionType c : values()) { + CONSTANTS.put(c.value, c); + } + } + + UserInteractionType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.UserInteractionType fromValue(String value) { + CvssV3X.UserInteractionType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + /** + * CVSS Version + * + */ + @Generated("jsonschema2pojo") + public enum Version { + + _3_0("3.0"), _3_1("3.1"); + + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CvssV3X.Version c : values()) { + CONSTANTS.put(c.value, c); + } + } + + Version(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CvssV3X.Version fromValue(String value) { + CvssV3X.Version constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefConfigurations.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefConfigurations.java new file mode 100644 index 0000000..f79c67f --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefConfigurations.java @@ -0,0 +1,95 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines the set of product configurations for a NVD applicability statement. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "CVE_data_version", "nodes" }) +@Generated("jsonschema2pojo") +public class DefConfigurations { + + /** + * + * (Required) + * + */ + @JsonProperty("CVE_data_version") + private String cveDataVersion; + @JsonProperty("nodes") + private List nodes = new ArrayList(); + + @JsonProperty("CVE_data_version") + public String getCVEDataVersion() { + return cveDataVersion; + } + + @JsonProperty("CVE_data_version") + public void setCVEDataVersion(String cveDataVersion) { + this.cveDataVersion = cveDataVersion; + } + + @JsonProperty("nodes") + public List getNodes() { + return nodes; + } + + @JsonProperty("nodes") + public void setNodes(List nodes) { + this.nodes = nodes; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(DefConfigurations.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("cveDataVersion"); + sb.append('='); + sb.append(((this.cveDataVersion == null) ? "" : this.cveDataVersion)); + sb.append(','); + sb.append("nodes"); + sb.append('='); + sb.append(((this.nodes == null) ? "" : this.nodes)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.cveDataVersion == null) ? 0 : this.cveDataVersion.hashCode())); + result = ((result * 31) + ((this.nodes == null) ? 0 : this.nodes.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DefConfigurations) == false) { + return false; + } + DefConfigurations rhs = ((DefConfigurations) other); + return (((this.cveDataVersion == rhs.cveDataVersion) + || ((this.cveDataVersion != null) && this.cveDataVersion.equals(rhs.cveDataVersion))) + && ((this.nodes == rhs.nodes) || ((this.nodes != null) && this.nodes.equals(rhs.nodes)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefCpeMatch.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefCpeMatch.java new file mode 100644 index 0000000..707aae8 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefCpeMatch.java @@ -0,0 +1,233 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * CPE match string or range + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "vulnerable", "cpe22Uri", "cpe23Uri", "versionStartExcluding", "versionStartIncluding", + "versionEndExcluding", "versionEndIncluding", "cpe_name" }) +@Generated("jsonschema2pojo") +public class DefCpeMatch { + + /** + * + * (Required) + * + */ + @JsonProperty("vulnerable") + private Boolean vulnerable; + @JsonProperty("cpe22Uri") + private String cpe22Uri; + /** + * + * (Required) + * + */ + @JsonProperty("cpe23Uri") + private String cpe23Uri; + @JsonProperty("versionStartExcluding") + private String versionStartExcluding; + @JsonProperty("versionStartIncluding") + private String versionStartIncluding; + @JsonProperty("versionEndExcluding") + private String versionEndExcluding; + @JsonProperty("versionEndIncluding") + private String versionEndIncluding; + @JsonProperty("cpe_name") + private List cpeName = new ArrayList(); + + /** + * + * (Required) + * + */ + @JsonProperty("vulnerable") + public Boolean getVulnerable() { + return vulnerable; + } + + /** + * + * (Required) + * + */ + @JsonProperty("vulnerable") + public void setVulnerable(Boolean vulnerable) { + this.vulnerable = vulnerable; + } + + @JsonProperty("cpe22Uri") + public String getCpe22Uri() { + return cpe22Uri; + } + + @JsonProperty("cpe22Uri") + public void setCpe22Uri(String cpe22Uri) { + this.cpe22Uri = cpe22Uri; + } + + /** + * + * (Required) + * + */ + @JsonProperty("cpe23Uri") + public String getCpe23Uri() { + return cpe23Uri; + } + + /** + * + * (Required) + * + */ + @JsonProperty("cpe23Uri") + public void setCpe23Uri(String cpe23Uri) { + this.cpe23Uri = cpe23Uri; + } + + @JsonProperty("versionStartExcluding") + public String getVersionStartExcluding() { + return versionStartExcluding; + } + + @JsonProperty("versionStartExcluding") + public void setVersionStartExcluding(String versionStartExcluding) { + this.versionStartExcluding = versionStartExcluding; + } + + @JsonProperty("versionStartIncluding") + public String getVersionStartIncluding() { + return versionStartIncluding; + } + + @JsonProperty("versionStartIncluding") + public void setVersionStartIncluding(String versionStartIncluding) { + this.versionStartIncluding = versionStartIncluding; + } + + @JsonProperty("versionEndExcluding") + public String getVersionEndExcluding() { + return versionEndExcluding; + } + + @JsonProperty("versionEndExcluding") + public void setVersionEndExcluding(String versionEndExcluding) { + this.versionEndExcluding = versionEndExcluding; + } + + @JsonProperty("versionEndIncluding") + public String getVersionEndIncluding() { + return versionEndIncluding; + } + + @JsonProperty("versionEndIncluding") + public void setVersionEndIncluding(String versionEndIncluding) { + this.versionEndIncluding = versionEndIncluding; + } + + @JsonProperty("cpe_name") + public List getCpeName() { + return cpeName; + } + + @JsonProperty("cpe_name") + public void setCpeName(List cpeName) { + this.cpeName = cpeName; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(DefCpeMatch.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("vulnerable"); + sb.append('='); + sb.append(((this.vulnerable == null) ? "" : this.vulnerable)); + sb.append(','); + sb.append("cpe22Uri"); + sb.append('='); + sb.append(((this.cpe22Uri == null) ? "" : this.cpe22Uri)); + sb.append(','); + sb.append("cpe23Uri"); + sb.append('='); + sb.append(((this.cpe23Uri == null) ? "" : this.cpe23Uri)); + sb.append(','); + sb.append("versionStartExcluding"); + sb.append('='); + sb.append(((this.versionStartExcluding == null) ? "" : this.versionStartExcluding)); + sb.append(','); + sb.append("versionStartIncluding"); + sb.append('='); + sb.append(((this.versionStartIncluding == null) ? "" : this.versionStartIncluding)); + sb.append(','); + sb.append("versionEndExcluding"); + sb.append('='); + sb.append(((this.versionEndExcluding == null) ? "" : this.versionEndExcluding)); + sb.append(','); + sb.append("versionEndIncluding"); + sb.append('='); + sb.append(((this.versionEndIncluding == null) ? "" : this.versionEndIncluding)); + sb.append(','); + sb.append("cpeName"); + sb.append('='); + sb.append(((this.cpeName == null) ? "" : this.cpeName)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.vulnerable == null) ? 0 : this.vulnerable.hashCode())); + result = ((result * 31) + ((this.cpe23Uri == null) ? 0 : this.cpe23Uri.hashCode())); + result = ((result * 31) + ((this.versionStartExcluding == null) ? 0 : this.versionStartExcluding.hashCode())); + result = ((result * 31) + ((this.cpe22Uri == null) ? 0 : this.cpe22Uri.hashCode())); + result = ((result * 31) + ((this.versionEndExcluding == null) ? 0 : this.versionEndExcluding.hashCode())); + result = ((result * 31) + ((this.cpeName == null) ? 0 : this.cpeName.hashCode())); + result = ((result * 31) + ((this.versionEndIncluding == null) ? 0 : this.versionEndIncluding.hashCode())); + result = ((result * 31) + ((this.versionStartIncluding == null) ? 0 : this.versionStartIncluding.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DefCpeMatch) == false) { + return false; + } + DefCpeMatch rhs = ((DefCpeMatch) other); + return (((((((((this.vulnerable == rhs.vulnerable) + || ((this.vulnerable != null) && this.vulnerable.equals(rhs.vulnerable))) + && ((this.cpe23Uri == rhs.cpe23Uri) || ((this.cpe23Uri != null) && this.cpe23Uri.equals(rhs.cpe23Uri)))) + && ((this.versionStartExcluding == rhs.versionStartExcluding) || ((this.versionStartExcluding != null) + && this.versionStartExcluding.equals(rhs.versionStartExcluding)))) + && ((this.cpe22Uri == rhs.cpe22Uri) || ((this.cpe22Uri != null) && this.cpe22Uri.equals(rhs.cpe22Uri)))) + && ((this.versionEndExcluding == rhs.versionEndExcluding) || ((this.versionEndExcluding != null) + && this.versionEndExcluding.equals(rhs.versionEndExcluding)))) + && ((this.cpeName == rhs.cpeName) || ((this.cpeName != null) && this.cpeName.equals(rhs.cpeName)))) + && ((this.versionEndIncluding == rhs.versionEndIncluding) || ((this.versionEndIncluding != null) + && this.versionEndIncluding.equals(rhs.versionEndIncluding)))) + && ((this.versionStartIncluding == rhs.versionStartIncluding) || ((this.versionStartIncluding != null) + && this.versionStartIncluding.equals(rhs.versionStartIncluding)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefCpeName.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefCpeName.java new file mode 100644 index 0000000..1ebcbe4 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefCpeName.java @@ -0,0 +1,121 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * CPE name + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "cpe22Uri", "cpe23Uri", "lastModifiedDate" }) +@Generated("jsonschema2pojo") +public class DefCpeName { + + @JsonProperty("cpe22Uri") + private String cpe22Uri; + /** + * + * (Required) + * + */ + @JsonProperty("cpe23Uri") + private String cpe23Uri; + @JsonProperty("lastModifiedDate") + private String lastModifiedDate; + + @JsonProperty("cpe22Uri") + public String getCpe22Uri() { + return cpe22Uri; + } + + @JsonProperty("cpe22Uri") + public void setCpe22Uri(String cpe22Uri) { + this.cpe22Uri = cpe22Uri; + } + + /** + * + * (Required) + * + */ + @JsonProperty("cpe23Uri") + public String getCpe23Uri() { + return cpe23Uri; + } + + /** + * + * (Required) + * + */ + @JsonProperty("cpe23Uri") + public void setCpe23Uri(String cpe23Uri) { + this.cpe23Uri = cpe23Uri; + } + + @JsonProperty("lastModifiedDate") + public String getLastModifiedDate() { + return lastModifiedDate; + } + + @JsonProperty("lastModifiedDate") + public void setLastModifiedDate(String lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(DefCpeName.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("cpe22Uri"); + sb.append('='); + sb.append(((this.cpe22Uri == null) ? "" : this.cpe22Uri)); + sb.append(','); + sb.append("cpe23Uri"); + sb.append('='); + sb.append(((this.cpe23Uri == null) ? "" : this.cpe23Uri)); + sb.append(','); + sb.append("lastModifiedDate"); + sb.append('='); + sb.append(((this.lastModifiedDate == null) ? "" : this.lastModifiedDate)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.cpe23Uri == null) ? 0 : this.cpe23Uri.hashCode())); + result = ((result * 31) + ((this.cpe22Uri == null) ? 0 : this.cpe22Uri.hashCode())); + result = ((result * 31) + ((this.lastModifiedDate == null) ? 0 : this.lastModifiedDate.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DefCpeName) == false) { + return false; + } + DefCpeName rhs = ((DefCpeName) other); + return ((((this.cpe23Uri == rhs.cpe23Uri) || ((this.cpe23Uri != null) && this.cpe23Uri.equals(rhs.cpe23Uri))) + && ((this.cpe22Uri == rhs.cpe22Uri) || ((this.cpe22Uri != null) && this.cpe22Uri.equals(rhs.cpe22Uri)))) + && ((this.lastModifiedDate == rhs.lastModifiedDate) + || ((this.lastModifiedDate != null) && this.lastModifiedDate.equals(rhs.lastModifiedDate)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefCveItem.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefCveItem.java new file mode 100644 index 0000000..a746f18 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefCveItem.java @@ -0,0 +1,186 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines a vulnerability in the NVD data feed. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "cve", "configurations", "impact", "publishedDate", "lastModifiedDate" }) +@Generated("jsonschema2pojo") +public class DefCveItem { + + /** + * + * (Required) + * + */ + @JsonProperty("cve") + private CVEJSON40Min11 cve; + /** + * Defines the set of product configurations for a NVD applicability statement. + * + */ + @JsonProperty("configurations") + @JsonPropertyDescription("Defines the set of product configurations for a NVD applicability statement.") + private DefConfigurations configurations; + /** + * Impact scores for a vulnerability as found on NVD. + * + */ + @JsonProperty("impact") + @JsonPropertyDescription("Impact scores for a vulnerability as found on NVD.") + private DefImpact impact; + @JsonProperty("publishedDate") + private String publishedDate; + @JsonProperty("lastModifiedDate") + private String lastModifiedDate; + + /** + * + * (Required) + * + */ + @JsonProperty("cve") + public CVEJSON40Min11 getCve() { + return cve; + } + + /** + * + * (Required) + * + */ + @JsonProperty("cve") + public void setCve(CVEJSON40Min11 cve) { + this.cve = cve; + } + + /** + * Defines the set of product configurations for a NVD applicability statement. + * + */ + @JsonProperty("configurations") + public DefConfigurations getConfigurations() { + return configurations; + } + + /** + * Defines the set of product configurations for a NVD applicability statement. + * + */ + @JsonProperty("configurations") + public void setConfigurations(DefConfigurations configurations) { + this.configurations = configurations; + } + + /** + * Impact scores for a vulnerability as found on NVD. + * + */ + @JsonProperty("impact") + public DefImpact getImpact() { + return impact; + } + + /** + * Impact scores for a vulnerability as found on NVD. + * + */ + @JsonProperty("impact") + public void setImpact(DefImpact impact) { + this.impact = impact; + } + + @JsonProperty("publishedDate") + public String getPublishedDate() { + return publishedDate; + } + + @JsonProperty("publishedDate") + public void setPublishedDate(String publishedDate) { + this.publishedDate = publishedDate; + } + + @JsonProperty("lastModifiedDate") + public String getLastModifiedDate() { + return lastModifiedDate; + } + + @JsonProperty("lastModifiedDate") + public void setLastModifiedDate(String lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(DefCveItem.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("cve"); + sb.append('='); + sb.append(((this.cve == null) ? "" : this.cve)); + sb.append(','); + sb.append("configurations"); + sb.append('='); + sb.append(((this.configurations == null) ? "" : this.configurations)); + sb.append(','); + sb.append("impact"); + sb.append('='); + sb.append(((this.impact == null) ? "" : this.impact)); + sb.append(','); + sb.append("publishedDate"); + sb.append('='); + sb.append(((this.publishedDate == null) ? "" : this.publishedDate)); + sb.append(','); + sb.append("lastModifiedDate"); + sb.append('='); + sb.append(((this.lastModifiedDate == null) ? "" : this.lastModifiedDate)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.cve == null) ? 0 : this.cve.hashCode())); + result = ((result * 31) + ((this.publishedDate == null) ? 0 : this.publishedDate.hashCode())); + result = ((result * 31) + ((this.lastModifiedDate == null) ? 0 : this.lastModifiedDate.hashCode())); + result = ((result * 31) + ((this.configurations == null) ? 0 : this.configurations.hashCode())); + result = ((result * 31) + ((this.impact == null) ? 0 : this.impact.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DefCveItem) == false) { + return false; + } + DefCveItem rhs = ((DefCveItem) other); + return ((((((this.cve == rhs.cve) || ((this.cve != null) && this.cve.equals(rhs.cve))) + && ((this.publishedDate == rhs.publishedDate) + || ((this.publishedDate != null) && this.publishedDate.equals(rhs.publishedDate)))) + && ((this.lastModifiedDate == rhs.lastModifiedDate) + || ((this.lastModifiedDate != null) && this.lastModifiedDate.equals(rhs.lastModifiedDate)))) + && ((this.configurations == rhs.configurations) + || ((this.configurations != null) && this.configurations.equals(rhs.configurations)))) + && ((this.impact == rhs.impact) || ((this.impact != null) && this.impact.equals(rhs.impact)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefImpact.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefImpact.java new file mode 100644 index 0000000..ca31984 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefImpact.java @@ -0,0 +1,116 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Impact scores for a vulnerability as found on NVD. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "baseMetricV3", "baseMetricV2" }) +@Generated("jsonschema2pojo") +public class DefImpact { + + /** + * CVSS V3.x score. + * + */ + @JsonProperty("baseMetricV3") + @JsonPropertyDescription("CVSS V3.x score.") + private BaseMetricV3 baseMetricV3; + /** + * CVSS V2.0 score. + * + */ + @JsonProperty("baseMetricV2") + @JsonPropertyDescription("CVSS V2.0 score.") + private BaseMetricV2 baseMetricV2; + + /** + * CVSS V3.x score. + * + */ + @JsonProperty("baseMetricV3") + public BaseMetricV3 getBaseMetricV3() { + return baseMetricV3; + } + + /** + * CVSS V3.x score. + * + */ + @JsonProperty("baseMetricV3") + public void setBaseMetricV3(BaseMetricV3 baseMetricV3) { + this.baseMetricV3 = baseMetricV3; + } + + /** + * CVSS V2.0 score. + * + */ + @JsonProperty("baseMetricV2") + public BaseMetricV2 getBaseMetricV2() { + return baseMetricV2; + } + + /** + * CVSS V2.0 score. + * + */ + @JsonProperty("baseMetricV2") + public void setBaseMetricV2(BaseMetricV2 baseMetricV2) { + this.baseMetricV2 = baseMetricV2; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(DefImpact.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("baseMetricV3"); + sb.append('='); + sb.append(((this.baseMetricV3 == null) ? "" : this.baseMetricV3)); + sb.append(','); + sb.append("baseMetricV2"); + sb.append('='); + sb.append(((this.baseMetricV2 == null) ? "" : this.baseMetricV2)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.baseMetricV2 == null) ? 0 : this.baseMetricV2.hashCode())); + result = ((result * 31) + ((this.baseMetricV3 == null) ? 0 : this.baseMetricV3.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DefImpact) == false) { + return false; + } + DefImpact rhs = ((DefImpact) other); + return (((this.baseMetricV2 == rhs.baseMetricV2) + || ((this.baseMetricV2 != null) && this.baseMetricV2.equals(rhs.baseMetricV2))) + && ((this.baseMetricV3 == rhs.baseMetricV3) + || ((this.baseMetricV3 != null) && this.baseMetricV3.equals(rhs.baseMetricV3)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefNode.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefNode.java new file mode 100644 index 0000000..e83ed06 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/DefNode.java @@ -0,0 +1,126 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Defines a node or sub-node in an NVD applicability statement. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "operator", "negate", "children", "cpe_match" }) +@Generated("jsonschema2pojo") +public class DefNode { + + @JsonProperty("operator") + private String operator; + @JsonProperty("negate") + private Boolean negate; + @JsonProperty("children") + private List children = new ArrayList(); + @JsonProperty("cpe_match") + private List cpeMatch = new ArrayList(); + + @JsonProperty("operator") + public String getOperator() { + return operator; + } + + @JsonProperty("operator") + public void setOperator(String operator) { + this.operator = operator; + } + + @JsonProperty("negate") + public Boolean getNegate() { + return negate; + } + + @JsonProperty("negate") + public void setNegate(Boolean negate) { + this.negate = negate; + } + + @JsonProperty("children") + public List getChildren() { + return children; + } + + @JsonProperty("children") + public void setChildren(List children) { + this.children = children; + } + + @JsonProperty("cpe_match") + public List getCpeMatch() { + return cpeMatch; + } + + @JsonProperty("cpe_match") + public void setCpeMatch(List cpeMatch) { + this.cpeMatch = cpeMatch; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(DefNode.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("operator"); + sb.append('='); + sb.append(((this.operator == null) ? "" : this.operator)); + sb.append(','); + sb.append("negate"); + sb.append('='); + sb.append(((this.negate == null) ? "" : this.negate)); + sb.append(','); + sb.append("children"); + sb.append('='); + sb.append(((this.children == null) ? "" : this.children)); + sb.append(','); + sb.append("cpeMatch"); + sb.append('='); + sb.append(((this.cpeMatch == null) ? "" : this.cpeMatch)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.children == null) ? 0 : this.children.hashCode())); + result = ((result * 31) + ((this.operator == null) ? 0 : this.operator.hashCode())); + result = ((result * 31) + ((this.negate == null) ? 0 : this.negate.hashCode())); + result = ((result * 31) + ((this.cpeMatch == null) ? 0 : this.cpeMatch.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DefNode) == false) { + return false; + } + DefNode rhs = ((DefNode) other); + return (((((this.children == rhs.children) || ((this.children != null) && this.children.equals(rhs.children))) + && ((this.operator == rhs.operator) || ((this.operator != null) && this.operator.equals(rhs.operator)))) + && ((this.negate == rhs.negate) || ((this.negate != null) && this.negate.equals(rhs.negate)))) + && ((this.cpeMatch == rhs.cpeMatch) + || ((this.cpeMatch != null) && this.cpeMatch.equals(rhs.cpeMatch)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Description.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Description.java new file mode 100644 index 0000000..1942e70 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Description.java @@ -0,0 +1,83 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "description_data" }) +@Generated("jsonschema2pojo") +public class Description { + + /** + * + * (Required) + * + */ + @JsonProperty("description_data") + private List descriptionData = new ArrayList(); + + /** + * + * (Required) + * + */ + @JsonProperty("description_data") + public List getDescriptionData() { + return descriptionData; + } + + /** + * + * (Required) + * + */ + @JsonProperty("description_data") + public void setDescriptionData(List descriptionData) { + this.descriptionData = descriptionData; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(Description.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("descriptionData"); + sb.append('='); + sb.append(((this.descriptionData == null) ? "" : this.descriptionData)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.descriptionData == null) ? 0 : this.descriptionData.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Description) == false) { + return false; + } + Description rhs = ((Description) other); + return ((this.descriptionData == rhs.descriptionData) + || ((this.descriptionData != null) && this.descriptionData.equals(rhs.descriptionData))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/LangString.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/LangString.java new file mode 100644 index 0000000..a8de7a8 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/LangString.java @@ -0,0 +1,113 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "lang", "value" }) +@Generated("jsonschema2pojo") +public class LangString { + + /** + * + * (Required) + * + */ + @JsonProperty("lang") + private String lang; + /** + * + * (Required) + * + */ + @JsonProperty("value") + private String value; + + /** + * + * (Required) + * + */ + @JsonProperty("lang") + public String getLang() { + return lang; + } + + /** + * + * (Required) + * + */ + @JsonProperty("lang") + public void setLang(String lang) { + this.lang = lang; + } + + /** + * + * (Required) + * + */ + @JsonProperty("value") + public String getValue() { + return value; + } + + /** + * + * (Required) + * + */ + @JsonProperty("value") + public void setValue(String value) { + this.value = value; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(LangString.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("lang"); + sb.append('='); + sb.append(((this.lang == null) ? "" : this.lang)); + sb.append(','); + sb.append("value"); + sb.append('='); + sb.append(((this.value == null) ? "" : this.value)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.lang == null) ? 0 : this.lang.hashCode())); + result = ((result * 31) + ((this.value == null) ? 0 : this.value.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof LangString) == false) { + return false; + } + LangString rhs = ((LangString) other); + return (((this.lang == rhs.lang) || ((this.lang != null) && this.lang.equals(rhs.lang))) + && ((this.value == rhs.value) || ((this.value != null) && this.value.equals(rhs.value)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/NvdCveFeedJson11.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/NvdCveFeedJson11.java new file mode 100644 index 0000000..a83d179 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/NvdCveFeedJson11.java @@ -0,0 +1,224 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * JSON Schema for NVD Vulnerability Data Feed version 1.1 + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "CVE_data_type", "CVE_data_format", "CVE_data_version", "CVE_data_numberOfCVEs", + "CVE_data_timestamp", "CVE_Items" }) +@Generated("jsonschema2pojo") +public class NvdCveFeedJson11 { + + /** + * + * (Required) + * + */ + @JsonProperty("CVE_data_type") + private String cveDataType; + /** + * + * (Required) + * + */ + @JsonProperty("CVE_data_format") + private String cveDataFormat; + /** + * + * (Required) + * + */ + @JsonProperty("CVE_data_version") + private String cveDataVersion; + /** + * NVD adds number of CVE in this feed + * + */ + @JsonProperty("CVE_data_numberOfCVEs") + @JsonPropertyDescription("NVD adds number of CVE in this feed") + private String cveDataNumberOfCVEs; + /** + * NVD adds feed date timestamp + * + */ + @JsonProperty("CVE_data_timestamp") + @JsonPropertyDescription("NVD adds feed date timestamp") + private String cveDataTimestamp; + /** + * NVD feed array of CVE (Required) + * + */ + @JsonProperty("CVE_Items") + @JsonPropertyDescription("NVD feed array of CVE") + private List cveItems = new ArrayList(); + + @JsonProperty("CVE_data_type") + public String getCVEDataType() { + return cveDataType; + } + + @JsonProperty("CVE_data_type") + public void setCVEDataType(String cveDataType) { + this.cveDataType = cveDataType; + } + + @JsonProperty("CVE_data_format") + public String getCVEDataFormat() { + return cveDataFormat; + } + + @JsonProperty("CVE_data_format") + public void setCVEDataFormat(String cveDataFormat) { + this.cveDataFormat = cveDataFormat; + } + + @JsonProperty("CVE_data_version") + public String getCVEDataVersion() { + return cveDataVersion; + } + + @JsonProperty("CVE_data_version") + public void setCVEDataVersion(String cveDataVersion) { + this.cveDataVersion = cveDataVersion; + } + + /** + * NVD adds number of CVE in this feed + * + */ + @JsonProperty("CVE_data_numberOfCVEs") + public String getCVEDataNumberOfCVEs() { + return cveDataNumberOfCVEs; + } + + /** + * NVD adds number of CVE in this feed + * + */ + @JsonProperty("CVE_data_numberOfCVEs") + public void setCVEDataNumberOfCVEs(String cveDataNumberOfCVEs) { + this.cveDataNumberOfCVEs = cveDataNumberOfCVEs; + } + + /** + * NVD adds feed date timestamp + * + */ + @JsonProperty("CVE_data_timestamp") + public String getCVEDataTimestamp() { + return cveDataTimestamp; + } + + /** + * NVD adds feed date timestamp + * + */ + @JsonProperty("CVE_data_timestamp") + public void setCVEDataTimestamp(String cveDataTimestamp) { + this.cveDataTimestamp = cveDataTimestamp; + } + + /** + * NVD feed array of CVE + * + */ + @JsonProperty("CVE_Items") + public List getCVEItems() { + return cveItems; + } + + /** + * NVD feed array of CVE + * + */ + @JsonProperty("CVE_Items") + public void setCVEItems(List cveItems) { + this.cveItems = cveItems; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(NvdCveFeedJson11.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("cveDataType"); + sb.append('='); + sb.append(((this.cveDataType == null) ? "" : this.cveDataType)); + sb.append(','); + sb.append("cveDataFormat"); + sb.append('='); + sb.append(((this.cveDataFormat == null) ? "" : this.cveDataFormat)); + sb.append(','); + sb.append("cveDataVersion"); + sb.append('='); + sb.append(((this.cveDataVersion == null) ? "" : this.cveDataVersion)); + sb.append(','); + sb.append("cveDataNumberOfCVEs"); + sb.append('='); + sb.append(((this.cveDataNumberOfCVEs == null) ? "" : this.cveDataNumberOfCVEs)); + sb.append(','); + sb.append("cveDataTimestamp"); + sb.append('='); + sb.append(((this.cveDataTimestamp == null) ? "" : this.cveDataTimestamp)); + sb.append(','); + sb.append("cveItems"); + sb.append('='); + sb.append(((this.cveItems == null) ? "" : this.cveItems)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.cveDataNumberOfCVEs == null) ? 0 : this.cveDataNumberOfCVEs.hashCode())); + result = ((result * 31) + ((this.cveDataFormat == null) ? 0 : this.cveDataFormat.hashCode())); + result = ((result * 31) + ((this.cveDataTimestamp == null) ? 0 : this.cveDataTimestamp.hashCode())); + result = ((result * 31) + ((this.cveDataType == null) ? 0 : this.cveDataType.hashCode())); + result = ((result * 31) + ((this.cveItems == null) ? 0 : this.cveItems.hashCode())); + result = ((result * 31) + ((this.cveDataVersion == null) ? 0 : this.cveDataVersion.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof NvdCveFeedJson11) == false) { + return false; + } + NvdCveFeedJson11 rhs = ((NvdCveFeedJson11) other); + return (((((((this.cveDataNumberOfCVEs == rhs.cveDataNumberOfCVEs) + || ((this.cveDataNumberOfCVEs != null) && this.cveDataNumberOfCVEs.equals(rhs.cveDataNumberOfCVEs))) + && ((this.cveDataFormat == rhs.cveDataFormat) + || ((this.cveDataFormat != null) && this.cveDataFormat.equals(rhs.cveDataFormat)))) + && ((this.cveDataTimestamp == rhs.cveDataTimestamp) + || ((this.cveDataTimestamp != null) && this.cveDataTimestamp.equals(rhs.cveDataTimestamp)))) + && ((this.cveDataType == rhs.cveDataType) + || ((this.cveDataType != null) && this.cveDataType.equals(rhs.cveDataType)))) + && ((this.cveItems == rhs.cveItems) || ((this.cveItems != null) && this.cveItems.equals(rhs.cveItems)))) + && ((this.cveDataVersion == rhs.cveDataVersion) + || ((this.cveDataVersion != null) && this.cveDataVersion.equals(rhs.cveDataVersion)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/NvdResponse.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/NvdResponse.java new file mode 100644 index 0000000..e581110 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/NvdResponse.java @@ -0,0 +1,58 @@ +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * JSON Schema for a response of the NVD API + * + * @author Florian Bossert + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "resultsPerPage", "startIndex", "totalResults", "result" }) +public class NvdResponse { + @JsonProperty("resultsPerPage") + private int resultsPerPage; + + public int getResultsPerPage() { + return resultsPerPage; + } + + public void setResultsPerPage(int resultsPerPage) { + this.resultsPerPage = resultsPerPage; + } + + public int getStartIndex() { + return startIndex; + } + + public void setStartIndex(int startIndex) { + this.startIndex = startIndex; + } + + public int getTotalResults() { + return totalResults; + } + + public void setTotalResults(int totalResults) { + this.totalResults = totalResults; + } + + public NvdCveFeedJson11 getResult() { + return result; + } + + public void setResult(NvdCveFeedJson11 result) { + this.result = result; + } + + @JsonProperty("startIndex") + private int startIndex; + + @JsonProperty("totalResults") + private int totalResults; + + @JsonProperty("result") + private NvdCveFeedJson11 result; +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Problemtype.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Problemtype.java new file mode 100644 index 0000000..96867da --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Problemtype.java @@ -0,0 +1,83 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "problemtype_data" }) +@Generated("jsonschema2pojo") +public class Problemtype { + + /** + * + * (Required) + * + */ + @JsonProperty("problemtype_data") + private List problemtypeData = new ArrayList(); + + /** + * + * (Required) + * + */ + @JsonProperty("problemtype_data") + public List getProblemtypeData() { + return problemtypeData; + } + + /** + * + * (Required) + * + */ + @JsonProperty("problemtype_data") + public void setProblemtypeData(List problemtypeData) { + this.problemtypeData = problemtypeData; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(Problemtype.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("problemtypeData"); + sb.append('='); + sb.append(((this.problemtypeData == null) ? "" : this.problemtypeData)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.problemtypeData == null) ? 0 : this.problemtypeData.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Problemtype) == false) { + return false; + } + Problemtype rhs = ((Problemtype) other); + return ((this.problemtypeData == rhs.problemtypeData) + || ((this.problemtypeData != null) && this.problemtypeData.equals(rhs.problemtypeData))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/ProblemtypeDatum.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/ProblemtypeDatum.java new file mode 100644 index 0000000..62f8b8b --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/ProblemtypeDatum.java @@ -0,0 +1,83 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "description" }) +@Generated("jsonschema2pojo") +public class ProblemtypeDatum { + + /** + * + * (Required) + * + */ + @JsonProperty("description") + private List description = new ArrayList(); + + /** + * + * (Required) + * + */ + @JsonProperty("description") + public List getDescription() { + return description; + } + + /** + * + * (Required) + * + */ + @JsonProperty("description") + public void setDescription(List description) { + this.description = description; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(ProblemtypeDatum.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("description"); + sb.append('='); + sb.append(((this.description == null) ? "" : this.description)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.description == null) ? 0 : this.description.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof ProblemtypeDatum) == false) { + return false; + } + ProblemtypeDatum rhs = ((ProblemtypeDatum) other); + return ((this.description == rhs.description) + || ((this.description != null) && this.description.equals(rhs.description))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Product.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Product.java new file mode 100644 index 0000000..cc03184 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Product.java @@ -0,0 +1,81 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "product_data" +}) +@Generated("jsonschema2pojo") +public class Product { + + /** + * + * (Required) + * + */ + @JsonProperty("product_data") + private List productData = new ArrayList(); + + /** + * + * (Required) + * + */ + @JsonProperty("product_data") + public List getProductData() { + return productData; + } + + /** + * + * (Required) + * + */ + @JsonProperty("product_data") + public void setProductData(List productData) { + this.productData = productData; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(Product.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); + sb.append("productData"); + sb.append('='); + sb.append(((this.productData == null)?"":this.productData)); + sb.append(','); + if (sb.charAt((sb.length()- 1)) == ',') { + sb.setCharAt((sb.length()- 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.productData == null)? 0 :this.productData.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Product) == false) { + return false; + } + Product rhs = ((Product) other); + return ((this.productData == rhs.productData)||((this.productData!= null)&&this.productData.equals(rhs.productData))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Product__1.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Product__1.java new file mode 100644 index 0000000..066ac39 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Product__1.java @@ -0,0 +1,114 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "product_name", "version" }) +@Generated("jsonschema2pojo") +public class Product__1 { + + /** + * + * (Required) + * + */ + @JsonProperty("product_name") + private String productName; + /** + * + * (Required) + * + */ + @JsonProperty("version") + private Version version; + + /** + * + * (Required) + * + */ + @JsonProperty("product_name") + public String getProductName() { + return productName; + } + + /** + * + * (Required) + * + */ + @JsonProperty("product_name") + public void setProductName(String productName) { + this.productName = productName; + } + + /** + * + * (Required) + * + */ + @JsonProperty("version") + public Version getVersion() { + return version; + } + + /** + * + * (Required) + * + */ + @JsonProperty("version") + public void setVersion(Version version) { + this.version = version; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(Product__1.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("productName"); + sb.append('='); + sb.append(((this.productName == null) ? "" : this.productName)); + sb.append(','); + sb.append("version"); + sb.append('='); + sb.append(((this.version == null) ? "" : this.version)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.version == null) ? 0 : this.version.hashCode())); + result = ((result * 31) + ((this.productName == null) ? 0 : this.productName.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Product__1) == false) { + return false; + } + Product__1 rhs = ((Product__1) other); + return (((this.version == rhs.version) || ((this.version != null) && this.version.equals(rhs.version))) + && ((this.productName == rhs.productName) + || ((this.productName != null) && this.productName.equals(rhs.productName)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Reference.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Reference.java new file mode 100644 index 0000000..f79b300 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Reference.java @@ -0,0 +1,137 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "url", "name", "refsource", "tags" }) +@Generated("jsonschema2pojo") +public class Reference { + + /** + * + * (Required) + * + */ + @JsonProperty("url") + private String url; + @JsonProperty("name") + private String name; + @JsonProperty("refsource") + private String refsource; + @JsonProperty("tags") + private List tags = new ArrayList(); + + /** + * + * (Required) + * + */ + @JsonProperty("url") + public String getUrl() { + return url; + } + + /** + * + * (Required) + * + */ + @JsonProperty("url") + public void setUrl(String url) { + this.url = url; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("name") + public void setName(String name) { + this.name = name; + } + + @JsonProperty("refsource") + public String getRefsource() { + return refsource; + } + + @JsonProperty("refsource") + public void setRefsource(String refsource) { + this.refsource = refsource; + } + + @JsonProperty("tags") + public List getTags() { + return tags; + } + + @JsonProperty("tags") + public void setTags(List tags) { + this.tags = tags; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(Reference.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("url"); + sb.append('='); + sb.append(((this.url == null) ? "" : this.url)); + sb.append(','); + sb.append("name"); + sb.append('='); + sb.append(((this.name == null) ? "" : this.name)); + sb.append(','); + sb.append("refsource"); + sb.append('='); + sb.append(((this.refsource == null) ? "" : this.refsource)); + sb.append(','); + sb.append("tags"); + sb.append('='); + sb.append(((this.tags == null) ? "" : this.tags)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.name == null) ? 0 : this.name.hashCode())); + result = ((result * 31) + ((this.refsource == null) ? 0 : this.refsource.hashCode())); + result = ((result * 31) + ((this.url == null) ? 0 : this.url.hashCode())); + result = ((result * 31) + ((this.tags == null) ? 0 : this.tags.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Reference) == false) { + return false; + } + Reference rhs = ((Reference) other); + return (((((this.name == rhs.name) || ((this.name != null) && this.name.equals(rhs.name))) + && ((this.refsource == rhs.refsource) + || ((this.refsource != null) && this.refsource.equals(rhs.refsource)))) + && ((this.url == rhs.url) || ((this.url != null) && this.url.equals(rhs.url)))) + && ((this.tags == rhs.tags) || ((this.tags != null) && this.tags.equals(rhs.tags)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/References.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/References.java new file mode 100644 index 0000000..53f0ff1 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/References.java @@ -0,0 +1,83 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "reference_data" }) +@Generated("jsonschema2pojo") +public class References { + + /** + * + * (Required) + * + */ + @JsonProperty("reference_data") + private List referenceData = new ArrayList(); + + /** + * + * (Required) + * + */ + @JsonProperty("reference_data") + public List getReferenceData() { + return referenceData; + } + + /** + * + * (Required) + * + */ + @JsonProperty("reference_data") + public void setReferenceData(List referenceData) { + this.referenceData = referenceData; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(References.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("referenceData"); + sb.append('='); + sb.append(((this.referenceData == null) ? "" : this.referenceData)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.referenceData == null) ? 0 : this.referenceData.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof References) == false) { + return false; + } + References rhs = ((References) other); + return ((this.referenceData == rhs.referenceData) + || ((this.referenceData != null) && this.referenceData.equals(rhs.referenceData))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Vendor.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Vendor.java new file mode 100644 index 0000000..fff910b --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Vendor.java @@ -0,0 +1,83 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "vendor_data" }) +@Generated("jsonschema2pojo") +public class Vendor { + + /** + * + * (Required) + * + */ + @JsonProperty("vendor_data") + private List vendorData = new ArrayList(); + + /** + * + * (Required) + * + */ + @JsonProperty("vendor_data") + public List getVendorData() { + return vendorData; + } + + /** + * + * (Required) + * + */ + @JsonProperty("vendor_data") + public void setVendorData(List vendorData) { + this.vendorData = vendorData; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(Vendor.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("vendorData"); + sb.append('='); + sb.append(((this.vendorData == null) ? "" : this.vendorData)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.vendorData == null) ? 0 : this.vendorData.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Vendor) == false) { + return false; + } + Vendor rhs = ((Vendor) other); + return ((this.vendorData == rhs.vendorData) + || ((this.vendorData != null) && this.vendorData.equals(rhs.vendorData))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/VendorDatum.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/VendorDatum.java new file mode 100644 index 0000000..114737b --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/VendorDatum.java @@ -0,0 +1,112 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "vendor_name", + "product" +}) +@Generated("jsonschema2pojo") +public class VendorDatum { + + /** + * + * (Required) + * + */ + @JsonProperty("vendor_name") + private String vendorName; + /** + * + * (Required) + * + */ + @JsonProperty("product") + private Product product; + + /** + * + * (Required) + * + */ + @JsonProperty("vendor_name") + public String getVendorName() { + return vendorName; + } + + /** + * + * (Required) + * + */ + @JsonProperty("vendor_name") + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + /** + * + * (Required) + * + */ + @JsonProperty("product") + public Product getProduct() { + return product; + } + + /** + * + * (Required) + * + */ + @JsonProperty("product") + public void setProduct(Product product) { + this.product = product; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(VendorDatum.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); + sb.append("vendorName"); + sb.append('='); + sb.append(((this.vendorName == null)?"":this.vendorName)); + sb.append(','); + sb.append("product"); + sb.append('='); + sb.append(((this.product == null)?"":this.product)); + sb.append(','); + if (sb.charAt((sb.length()- 1)) == ',') { + sb.setCharAt((sb.length()- 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.vendorName == null)? 0 :this.vendorName.hashCode())); + result = ((result* 31)+((this.product == null)? 0 :this.product.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof VendorDatum) == false) { + return false; + } + VendorDatum rhs = ((VendorDatum) other); + return (((this.vendorName == rhs.vendorName)||((this.vendorName!= null)&&this.vendorName.equals(rhs.vendorName)))&&((this.product == rhs.product)||((this.product!= null)&&this.product.equals(rhs.product)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Version.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Version.java new file mode 100644 index 0000000..8f83602 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/Version.java @@ -0,0 +1,83 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "version_data" }) +@Generated("jsonschema2pojo") +public class Version { + + /** + * + * (Required) + * + */ + @JsonProperty("version_data") + private List versionData = new ArrayList(); + + /** + * + * (Required) + * + */ + @JsonProperty("version_data") + public List getVersionData() { + return versionData; + } + + /** + * + * (Required) + * + */ + @JsonProperty("version_data") + public void setVersionData(List versionData) { + this.versionData = versionData; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(Version.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("versionData"); + sb.append('='); + sb.append(((this.versionData == null) ? "" : this.versionData)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.versionData == null) ? 0 : this.versionData.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Version) == false) { + return false; + } + Version rhs = ((Version) other); + return ((this.versionData == rhs.versionData) + || ((this.versionData != null) && this.versionData.equals(rhs.versionData))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/VersionDatum.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/VersionDatum.java new file mode 100644 index 0000000..3645e89 --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/nvd_rest_api/VersionDatum.java @@ -0,0 +1,100 @@ + +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "version_value", "version_affected" }) +@Generated("jsonschema2pojo") +public class VersionDatum { + + /** + * + * (Required) + * + */ + @JsonProperty("version_value") + private String versionValue; + @JsonProperty("version_affected") + private String versionAffected; + + /** + * + * (Required) + * + */ + @JsonProperty("version_value") + public String getVersionValue() { + return versionValue; + } + + /** + * + * (Required) + * + */ + @JsonProperty("version_value") + public void setVersionValue(String versionValue) { + this.versionValue = versionValue; + } + + @JsonProperty("version_affected") + public String getVersionAffected() { + return versionAffected; + } + + @JsonProperty("version_affected") + public void setVersionAffected(String versionAffected) { + this.versionAffected = versionAffected; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(VersionDatum.class.getName()) + .append('@') + .append(Integer.toHexString(System.identityHashCode(this))) + .append('['); + sb.append("versionValue"); + sb.append('='); + sb.append(((this.versionValue == null) ? "" : this.versionValue)); + sb.append(','); + sb.append("versionAffected"); + sb.append('='); + sb.append(((this.versionAffected == null) ? "" : this.versionAffected)); + sb.append(','); + if (sb.charAt((sb.length() - 1)) == ',') { + sb.setCharAt((sb.length() - 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result * 31) + ((this.versionValue == null) ? 0 : this.versionValue.hashCode())); + result = ((result * 31) + ((this.versionAffected == null) ? 0 : this.versionAffected.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof VersionDatum) == false) { + return false; + } + VersionDatum rhs = ((VersionDatum) other); + return (((this.versionValue == rhs.versionValue) + || ((this.versionValue != null) && this.versionValue.equals(rhs.versionValue))) + && ((this.versionAffected == rhs.versionAffected) + || ((this.versionAffected != null) && this.versionAffected.equals(rhs.versionAffected)))); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/parts/NvdVulnerabilityDatabase.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/parts/NvdVulnerabilityDatabase.java new file mode 100644 index 0000000..d13f34c --- /dev/null +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/parts/NvdVulnerabilityDatabase.java @@ -0,0 +1,58 @@ +package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.parts; + +import java.net.URI; + +import javax.ws.rs.ProcessingException; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.UriBuilder; + +import org.apache.log4j.Logger; +import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.CVEVulnerability; +import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.CWEVulnerability; +import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.impl.AttackSpecificationFactoryImpl; +import org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.iface.parts.interfaces.IVulnerabilityDatabase; +import org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.nvd_rest_api.NvdResponse; + +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + +public class NvdVulnerabilityDatabase implements IVulnerabilityDatabase { + private static final Logger LOG = Logger.getLogger(NvdVulnerabilityDatabase.class); + + private final Client client; + private final WebTarget target; + + public NvdVulnerabilityDatabase() { + client = ClientBuilder.newClient(); + client.register(JacksonJsonProvider.class); + URI baseUri = UriBuilder.fromUri("https://services.nvd.nist.gov/rest/json/cve/1.0/") + .build(); + target = client.target(baseUri); + } + + @Override + public CWEVulnerability getCWEVulnerability(String identifier) { + // TODO is this even useful? + return null; + } + + @Override + public CVEVulnerability getCVEVulnerability(String identifier) { + NvdResponse response = null; + try { + response = target.path(identifier) + .request(MediaType.APPLICATION_JSON) + .get(NvdResponse.class); + } catch (ProcessingException e) { + LOG.error("Could not process NVD API response:\n" + e.getMessage()); + return null; + } + if (response.getTotalResults() > 0) { + LOG.warn(response.getResult().getCVEItems().get(0)); + } + return AttackSpecificationFactoryImpl.eINSTANCE.createCVEVulnerability(); + } + +} diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/parts/SnykCLIStaticCodeAnalyst.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/parts/SnykCLIStaticCodeAnalyst.java index bf25b31..ff91690 100644 --- a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/parts/SnykCLIStaticCodeAnalyst.java +++ b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/parts/SnykCLIStaticCodeAnalyst.java @@ -12,11 +12,15 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; +import org.apache.log4j.Logger; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; import org.palladiosimulator.pcm.confidentiality.attackerSpecification.AttackerSystemSpecificationContainer; import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.Vulnerability; import org.palladiosimulator.pcm.confidentiality.attackerSpecification.impl.AttackerFactoryImpl; @@ -34,65 +38,10 @@ public class SnykCLIStaticCodeAnalyst implements IStaticCodeAnalyst { - // For testing and development - @SuppressWarnings("unused") - private String fakeoutput = "Testing /home/lukas/git/sms/...\n" + "\n" - + "Tested 44 dependencies for known issues, found 18 issues, 18 vulnerable paths.\n" + "\n" + "\n" - + "Issues with no direct upgrade or patch:\n" - + " ✗ XML External Entity (XXE) Injection [High Severity][https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1048302] in com.fasterxml.jackson.core:jackson-databind@2.10.0\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-actuator@2.2.0.RELEASE > org.springframework.boot:spring-boot-actuator-autoconfigure@2.2.0.RELEASE > com.fasterxml.jackson.core:jackson-databind@2.10.0\n" - + " This issue was fixed in versions: 2.6.7.4, 2.9.10.7, 2.10.5.1\n" - + " ✗ Information Exposure [Low Severity][https://snyk.io/vuln/SNYK-JAVA-ORGAPACHECOMMONS-559327] in org.apache.commons:commons-dbcp2@2.7.0\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.apache.commons:commons-dbcp2@2.7.0\n" - + " No upgrade or patch available\n" - + " ✗ HTTP Request Smuggling [Medium Severity][https://snyk.io/vuln/SNYK-JAVA-ORGAPACHETOMCATEMBED-1017119] in org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-tomcat@2.2.0.RELEASE > org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " This issue was fixed in versions: 10.0.0-M8, 9.0.38, 8.5.5\n" - + " ✗ Information Exposure [Medium Severity][https://snyk.io/vuln/SNYK-JAVA-ORGAPACHETOMCATEMBED-1048292] in org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-tomcat@2.2.0.RELEASE > org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " This issue was fixed in versions: 8.5.60, 9.0.40, 10.0.0-M10\n" - + " ✗ Information Disclosure [Medium Severity][https://snyk.io/vuln/SNYK-JAVA-ORGAPACHETOMCATEMBED-1061939] in org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-tomcat@2.2.0.RELEASE > org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " This issue was fixed in versions: 10.0.0-M10, 9.0.40, 8.5.60, 7.0.107\n" - + " ✗ Remote Code Execution (RCE) [High Severity][https://snyk.io/vuln/SNYK-JAVA-ORGAPACHETOMCATEMBED-1080637] in org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-tomcat@2.2.0.RELEASE > org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " This issue was fixed in versions: 10.0.2, 9.0.43, 8.5.63, 7.0.108\n" - + " ✗ HTTP Request Smuggling [Medium Severity][https://snyk.io/vuln/SNYK-JAVA-ORGAPACHETOMCATEMBED-1080638] in org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-tomcat@2.2.0.RELEASE > org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " This issue was fixed in versions: 10.0.2, 9.0.43, 8.5.63\n" - + " ✗ Session Fixation [Low Severity][https://snyk.io/vuln/SNYK-JAVA-ORGAPACHETOMCATEMBED-538488] in org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-tomcat@2.2.0.RELEASE > org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " This issue was fixed in versions: 9.0.30, 8.5.50, 7.0.99\n" - + " ✗ Privilege Escalation [High Severity][https://snyk.io/vuln/SNYK-JAVA-ORGAPACHETOMCATEMBED-538490] in org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-tomcat@2.2.0.RELEASE > org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " This issue was fixed in versions: 9.0.29\n" - + " ✗ Remote Code Execution (RCE) [High Severity][https://snyk.io/vuln/SNYK-JAVA-ORGAPACHETOMCATEMBED-570072] in org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-tomcat@2.2.0.RELEASE > org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " This issue was fixed in versions: 10.0.0-M5, 9.0.35, 8.5.55, 7.0.104\n" - + " ✗ Denial of Service (DoS) [Medium Severity][https://snyk.io/vuln/SNYK-JAVA-ORGAPACHETOMCATEMBED-584427] in org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-tomcat@2.2.0.RELEASE > org.apache.tomcat.embed:tomcat-embed-core@9.0.27\n" - + " This issue was fixed in versions: 10.0.0-M7, 9.0.37, 8.5.57\n" - + " ✗ Cross-site Scripting (XSS) [Medium Severity][https://snyk.io/vuln/SNYK-JAVA-ORGHIBERNATEVALIDATOR-541187] in org.hibernate.validator:hibernate-validator@6.0.17.Final\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-validation@2.2.0.RELEASE > org.hibernate.validator:hibernate-validator@6.0.17.Final\n" - + " This issue was fixed in versions: 6.0.18.Final, 6.1.0.Final\n" - + " ✗ Improper Input Validation [Medium Severity][https://snyk.io/vuln/SNYK-JAVA-ORGHIBERNATEVALIDATOR-568163] in org.hibernate.validator:hibernate-validator@6.0.17.Final\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-validation@2.2.0.RELEASE > org.hibernate.validator:hibernate-validator@6.0.17.Final\n" - + " This issue was fixed in versions: 6.0.19.Final, 6.1.3.Final\n" - + " ✗ Improper Input Validation [High Severity][https://snyk.io/vuln/SNYK-JAVA-ORGSPRINGFRAMEWORK-1009832] in org.springframework:spring-web@5.2.0.RELEASE\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework:spring-web@5.2.0.RELEASE\n" - + " This issue was fixed in versions: 4.3.29.RELEASE, 5.0.19.RELEASE, 5.1.18.RELEASE, 5.2.9.RELEASE\n" - + " ✗ Privilege Escalation [Medium Severity][https://snyk.io/vuln/SNYK-JAVA-ORGSPRINGFRAMEWORK-1296829] in org.springframework:spring-web@5.2.0.RELEASE\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework:spring-web@5.2.0.RELEASE\n" - + " This issue was fixed in versions: 5.3.7, 5.2.15.RELEASE\n" - + " ✗ Reflected File Download (RFD) [High Severity][https://snyk.io/vuln/SNYK-JAVA-ORGSPRINGFRAMEWORK-559346] in org.springframework:spring-web@5.2.0.RELEASE\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework:spring-web@5.2.0.RELEASE\n" - + " This issue was fixed in versions: 5.2.3, 5.1.13, 5.0.16\n" - + " ✗ Cross-Site Request Forgery (CSRF) [Medium Severity][https://snyk.io/vuln/SNYK-JAVA-ORGSPRINGFRAMEWORK-542933] in org.springframework:spring-webmvc@5.2.0.RELEASE\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-web@2.2.0.RELEASE > org.springframework:spring-webmvc@5.2.0.RELEASE\n" - + " This issue was fixed in versions: 5.2.3\n" - + " ✗ Denial of Service (DoS) [Medium Severity][https://snyk.io/vuln/SNYK-JAVA-ORGYAML-537645] in org.yaml:snakeyaml@1.25\n" - + " introduced by org.springframework.boot:smsApplication@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter-actuator@2.2.0.RELEASE > org.springframework.boot:spring-boot-starter@2.2.0.RELEASE > org.yaml:snakeyaml@1.25\n" - + " This issue was fixed in versions: 1.26"; + /** + * The Logger for this analyst. + */ + private static final Logger LOG = Logger.getLogger(SnykCLIStaticCodeAnalyst.class); /** * The path to the snyk executable. @@ -201,16 +150,35 @@ private List annotateResultToEntity(Entity e } /** - * Crawls the specified Snyk web site for the CWE and CVE identifiers of a vulnerability. - * Then, if the vulnerability has a CWE identifier, it looks up the details of that and - * returns a CWEVulnerability containing them. Otherwise, a CVE identifier is created and - * returned. + * Crawls the specified Snyk web site for the CWE and CVE identifiers of a vulnerability. Then, + * if the vulnerability has a CWE identifier, it looks up the details of that and returns a + * CWEVulnerability containing them. Otherwise, a CVE identifier is created and returned. * - * @param url the URL of the Snyk web site for a vulnerability + * @param url + * the URL of the Snyk web site for a vulnerability * @return the details of the vulnerability or {@code null} if no identifier could be found */ private Vulnerability getVulnerability(String url) { - // TODO implement + NvdVulnerabilityDatabase database = new NvdVulnerabilityDatabase(); + Document doc = null; + try { + doc = Jsoup.connect(url) + .get(); + } catch (IOException e) { + LOG.error("Could not get vulnerability definitions from \"" + url + "\"!"); + return null; + } + List identifiers = doc.select("a[href]") + .stream() + .map(x -> x.ownText()) + .collect(Collectors.toList()); + for (String identifier : identifiers) { + if (identifier.startsWith("CWE-")) { + return database.getCWEVulnerability(identifier); + } else if (identifier.startsWith("CVE-")) { + return database.getCVEVulnerability(identifier); + } + } return null; } diff --git a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/parts/SnykVulnerabilityDatabase.java b/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/parts/SnykVulnerabilityDatabase.java deleted file mode 100644 index f6af037..0000000 --- a/bundles/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/parts/SnykVulnerabilityDatabase.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.parts; - -import java.net.URI; -import java.util.Map; - -import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.AttackVector; -import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.AvailabilityImpact; -import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.CVEVulnerability; -import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.CWEVulnerability; -import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.ConfidentialityImpact; -import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.IntegrityImpact; -import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.Privileges; -import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.impl.AttackSpecificationFactoryImpl; -import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.impl.CVEVulnerabilityImpl; -import org.palladiosimulator.pcm.confidentiality.attackerSpecification.attackSpecification.impl.CWEVulnerabilityImpl; -import org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.iface.parts.interfaces.IVulnerabilityDatabase; - -public class SnykVulnerabilityDatabase implements IVulnerabilityDatabase { - - SnykDatabaseParser parser; - - public SnykVulnerabilityDatabase(SnykDatabaseParser parser) { - this.parser = parser; - } - - @Override - public CWEVulnerability getCWEVulnerability(URI path) { - - Map vulnerabilityAttributes = parser.parseWebEntry(path.toString()); - - CWEVulnerabilityImpl vulnerability = (CWEVulnerabilityImpl) AttackSpecificationFactoryImpl.eINSTANCE - .createCWEVulnerability(); - vulnerability.setAttackVector(AttackVector.getByName(vulnerabilityAttributes.get("Attack Vector"))); - vulnerability.setPrivileges(Privileges.getByName(vulnerabilityAttributes.get("Privileges Required"))); - vulnerability.setConfidentialityImpact( - ConfidentialityImpact.getByName(vulnerabilityAttributes.get("Confidentiality"))); - vulnerability.setIntegrityImpact(IntegrityImpact.getByName(vulnerabilityAttributes.get("Integrity"))); - vulnerability.setAvailabilityImpact(AvailabilityImpact.getByName(vulnerabilityAttributes.get("Availability"))); - - return vulnerability; - } - - @Override - public CVEVulnerability getCVEVulnerability(URI path) { - - Map vulnerabilityAttributes = parser.parseWebEntry(path.toString()); - - CVEVulnerabilityImpl vulnerability = (CVEVulnerabilityImpl) AttackSpecificationFactoryImpl.eINSTANCE - .createCVEVulnerability(); - vulnerability.setAttackVector(AttackVector.getByName(vulnerabilityAttributes.get("Attack Vector"))); - vulnerability.setPrivileges(Privileges.getByName(vulnerabilityAttributes.get("Privileges Required"))); - vulnerability.setConfidentialityImpact( - ConfidentialityImpact.getByName(vulnerabilityAttributes.get("Confidentiality"))); - vulnerability.setIntegrityImpact(IntegrityImpact.getByName(vulnerabilityAttributes.get("Integrity"))); - vulnerability.setAvailabilityImpact(AvailabilityImpact.getByName(vulnerabilityAttributes.get("Availability"))); - - return null; - } - -} diff --git a/releng/org.palladiosimulator.pcm.confidentiality.reverseengineering.targetplatform/org.palladiosimulator.pcm.confidentiality.reverseengineering.targetplatform.target b/releng/org.palladiosimulator.pcm.confidentiality.reverseengineering.targetplatform/org.palladiosimulator.pcm.confidentiality.reverseengineering.targetplatform.target index e7c27bc..d3ca200 100644 --- a/releng/org.palladiosimulator.pcm.confidentiality.reverseengineering.targetplatform/org.palladiosimulator.pcm.confidentiality.reverseengineering.targetplatform.target +++ b/releng/org.palladiosimulator.pcm.confidentiality.reverseengineering.targetplatform/org.palladiosimulator.pcm.confidentiality.reverseengineering.targetplatform.target @@ -2,85 +2,92 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + + + + + + + + - + \ No newline at end of file diff --git a/tests/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.test/META-INF/MANIFEST.MF b/tests/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.test/META-INF/MANIFEST.MF index 19b03b5..db5a04a 100644 --- a/tests/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.test/META-INF/MANIFEST.MF +++ b/tests/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.test/META-INF/MANIFEST.MF @@ -15,7 +15,8 @@ Require-Bundle: javax.inject, org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.iface, org.junit;bundle-version="4.13.0", org.jsoup;bundle-version="1.8.3", - org.palladiosimulator.pcm;bundle-version="5.0.0" + org.palladiosimulator.pcm, + org.palladiosimulator.pcm.confidentiality.attacker Bundle-RequiredExecutionEnvironment: JavaSE-11 Automatic-Module-Name: org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.test -Import-Package: javax.annotation;version="1.2.0" +Import-Package: javax.annotation diff --git a/tests/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.test/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/test/SnykWebsiteParsingTest.java b/tests/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.test/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/test/SnykWebsiteParsingTest.java index b15e653..f6238ca 100644 --- a/tests/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.test/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/test/SnykWebsiteParsingTest.java +++ b/tests/org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.test/src/org/palladiosimulator/pcm/confidentiality/reverseengineering/staticcodeanalysis/test/SnykWebsiteParsingTest.java @@ -1,6 +1,7 @@ package org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import java.io.IOException; import java.util.HashMap; @@ -9,6 +10,7 @@ import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.junit.Test; +import org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.parts.NvdVulnerabilityDatabase; import org.palladiosimulator.pcm.confidentiality.reverseengineering.staticcodeanalysis.parts.SnykDatabaseParser; import org.junit.Ignore; @@ -91,4 +93,9 @@ public void snykWebsiteParserTest() { } } + @Test + public void databaseTest() { + NvdVulnerabilityDatabase database = new NvdVulnerabilityDatabase(); + assertNotNull(database.getCVEVulnerability("CVE-2019-10219")); + } }