Added support for cpeStartsWithFilter to scan agent

This commit is contained in:
Steve Springett
2018-01-12 22:46:25 -06:00
parent 3abe415805
commit 1781aadab0

View File

@@ -155,6 +155,10 @@ public class DependencyCheckScanAgent {
* The password to use when connecting to the database.
*/
private String databasePassword;
/**
* The starting string that identifies CPEs that are qualified to be imported.
*/
private String cpeStartsWithFilter;
/**
* Whether or not the Maven Central analyzer is enabled.
*/
@@ -560,6 +564,22 @@ public class DependencyCheckScanAgent {
this.showSummary = showSummary;
}
/**
* Sets starting string that identifies CPEs that are qualified to be imported.
* @param cpeStartsWithFilter filters CPEs based on this starting string (i.e. cpe:/a: )
*/
public void setCpeStartsWithFilter(String cpeStartsWithFilter) {
this.cpeStartsWithFilter = cpeStartsWithFilter;
}
/**
* Returns the starting string that identifies CPEs that are qualified to be imported.
* @return the CPE starting filter (i.e. cpe:/a: )
*/
public String getCpeStartsWithFilter() {
return cpeStartsWithFilter;
}
/**
* Get the value of centralAnalyzerEnabled.
*
@@ -948,6 +968,7 @@ public class DependencyCheckScanAgent {
settings.setStringIfNotEmpty(Settings.KEYS.PROXY_PASSWORD, proxyPassword);
settings.setStringIfNotEmpty(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
settings.setStringIfNotEmpty(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
settings.setStringIfNotEmpty(Settings.KEYS.CVE_CPE_STARTS_WITH_FILTER, cpeStartsWithFilter);
settings.setBoolean(Settings.KEYS.ANALYZER_CENTRAL_ENABLED, centralAnalyzerEnabled);
settings.setStringIfNotEmpty(Settings.KEYS.ANALYZER_CENTRAL_URL, centralUrl);
settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled);