From 8fab2f58dab525236ee373acb174eda905ef471b Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Sat, 13 Sep 2014 05:43:16 -0400 Subject: [PATCH] added the base property and skipped adding the vulnerability or identifier to the suppressed collection if this is a base suppression rule Former-commit-id: a668d7d8b9345b6ad44bfff1ced4ab783a1f90d8 --- .../suppression/SuppressionRule.java | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionRule.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionRule.java index 958204e48..1254d5ea5 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionRule.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionRule.java @@ -266,6 +266,26 @@ public class SuppressionRule { return gav != null; } + private boolean base; + + /** + * Get the value of base + * + * @return the value of base + */ + public boolean isBase() { + return base; + } + + /** + * Set the value of base + * + * @param base new value of base + */ + public void setBase(boolean base) { + this.base = base; + } + /** * Processes a given dependency to determine if any CPE, CVE, CWE, or CVSS scores should be suppressed. If any * should be, they are removed from the dependency. @@ -300,7 +320,9 @@ public class SuppressionRule { final Identifier i = itr.next(); for (PropertyType c : this.cpe) { if (identifierMatches("cpe", c, i)) { - dependency.addSuppressedIdentifier(i); + if (!isBase()) { + dependency.addSuppressedIdentifier(i); + } itr.remove(); break; } @@ -339,7 +361,9 @@ public class SuppressionRule { } } if (remove) { - dependency.addSuppressedVulnerability(v); + if (!isBase()) { + dependency.addSuppressedVulnerability(v); + } itr.remove(); } }