@NotThreadSafe public class DependencyCheckScanAgent extends Object
List<Dependency> dependencies = new ArrayList<Dependency>();
Dependency dependency = new Dependency(new File(FileUtils.getBitBucket()));
dependency.addEvidence(EvidenceType.PRODUCT, "my-datasource", "name", "Jetty", Confidence.HIGH);
dependency.addEvidence(EvidenceType.VERSION, "my-datasource", "version", "5.1.10", Confidence.HIGH);
dependency.addEvidence(EvidenceType.VENDOR, "my-datasource", "vendor", "mortbay", Confidence.HIGH);
dependencies.add(dependency);
DependencyCheckScanAgent scan = new DependencyCheckScanAgent();
scan.setDependencies(dependencies);
scan.setReportFormat(ReportGenerator.Format.ALL);
scan.setReportOutputDirectory(System.getProperty("user.home"));
scan.execute();
| Constructor and Description |
|---|
DependencyCheckScanAgent() |
| Modifier and Type | Method and Description |
|---|---|
Engine |
execute()
Executes the dependency-check and generates the report.
|
String |
getApplicationName()
Get the value of applicationName.
|
String |
getCentralUrl()
Get the value of centralUrl.
|
String |
getConnectionString()
Get the value of connectionString.
|
String |
getConnectionTimeout()
Get the value of connectionTimeout.
|
String |
getCpeStartsWithFilter()
Returns the starting string that identifies CPEs that are qualified to be
imported.
|
String |
getCveUrlBase()
Get the value of cveUrlBase.
|
String |
getCveUrlModified()
Get the value of cveUrlModified.
|
String |
getDatabaseDriverName()
Get the value of databaseDriverName.
|
String |
getDatabaseDriverPath()
Get the value of databaseDriverPath.
|
String |
getDatabasePassword()
Get the value of databasePassword.
|
String |
getDatabaseUser()
Get the value of databaseUser.
|
String |
getDataDirectory()
Get the value of dataDirectory.
|
List<Dependency> |
getDependencies()
Returns a list of pre-determined dependencies.
|
float |
getFailBuildOnCVSS()
Get the value of failBuildOnCVSS.
|
String |
getLogFile()
Get the value of logFile.
|
String |
getNexusUrl()
Get the value of nexusUrl.
|
String |
getPathToDotnetCore()
Get the value of pathToCore.
|
String |
getPropertiesFilePath()
Get the value of propertiesFilePath.
|
String |
getProxyPassword()
Get the value of proxyPassword.
|
String |
getProxyPort()
Get the value of proxyPort.
|
String |
getProxyServer()
Get the value of proxyServer.
|
String |
getProxyUrl()
Deprecated.
use
getProxyServer()
instead |
String |
getProxyUsername()
Get the value of proxyUsername.
|
ReportGenerator.Format |
getReportFormat()
Get the value of reportFormat.
|
String |
getReportOutputDirectory()
Get the value of reportOutputDirectory.
|
String |
getSuppressionFile()
Get the value of suppressionFile.
|
String |
getZipExtensions()
Get the value of zipExtensions.
|
boolean |
isAutoUpdate()
Get the value of autoUpdate.
|
boolean |
isCentralAnalyzerEnabled()
Get the value of centralAnalyzerEnabled.
|
boolean |
isGenerateReport()
Get the value of generateReport.
|
boolean |
isNexusAnalyzerEnabled()
Get the value of nexusAnalyzerEnabled.
|
boolean |
isNexusUsesProxy()
Get the value of nexusUsesProxy.
|
boolean |
isShowSummary()
Get the value of showSummary.
|
boolean |
isUpdateOnly()
Get the value of updateOnly.
|
void |
setApplicationName(String applicationName)
Set the value of applicationName.
|
void |
setAutoUpdate(boolean autoUpdate)
Set the value of autoUpdate.
|
void |
setCentralAnalyzerEnabled(boolean centralAnalyzerEnabled)
Set the value of centralAnalyzerEnabled.
|
void |
setCentralUrl(String centralUrl)
Set the value of centralUrl.
|
void |
setConnectionString(String connectionString)
Set the value of connectionString.
|
void |
setConnectionTimeout(String connectionTimeout)
Set the value of connectionTimeout.
|
void |
setCpeStartsWithFilter(String cpeStartsWithFilter)
Sets starting string that identifies CPEs that are qualified to be
imported.
|
void |
setCveUrlBase(String cveUrlBase)
Set the value of cveUrlBase.
|
void |
setCveUrlModified(String cveUrlModified)
Set the value of cveUrlModified.
|
void |
setDatabaseDriverName(String databaseDriverName)
Set the value of databaseDriverName.
|
void |
setDatabaseDriverPath(String databaseDriverPath)
Set the value of databaseDriverPath.
|
void |
setDatabasePassword(String databasePassword)
Set the value of databasePassword.
|
void |
setDatabaseUser(String databaseUser)
Set the value of databaseUser.
|
void |
setDataDirectory(String dataDirectory)
Set the value of dataDirectory.
|
void |
setDependencies(List<Dependency> dependencies)
Sets the list of dependencies to scan.
|
void |
setFailBuildOnCVSS(float failBuildOnCVSS)
Set the value of failBuildOnCVSS.
|
void |
setGenerateReport(boolean generateReport)
Set the value of generateReport.
|
void |
setLogFile(String logFile)
Set the value of logFile.
|
void |
setNexusAnalyzerEnabled(boolean nexusAnalyzerEnabled)
Set the value of nexusAnalyzerEnabled.
|
void |
setNexusUrl(String nexusUrl)
Set the value of nexusUrl.
|
void |
setNexusUsesProxy(boolean nexusUsesProxy)
Set the value of nexusUsesProxy.
|
void |
setPathToDotnetCore(String pathToCore)
Set the value of pathToCore.
|
void |
setPropertiesFilePath(String propertiesFilePath)
Set the value of propertiesFilePath.
|
void |
setProxyPassword(String proxyPassword)
Set the value of proxyPassword.
|
void |
setProxyPort(String proxyPort)
Set the value of proxyPort.
|
void |
setProxyServer(String proxyServer)
Set the value of proxyServer.
|
void |
setProxyUrl(String proxyUrl)
Deprecated.
use
setProxyServer(java.lang.String) instead |
void |
setProxyUsername(String proxyUsername)
Set the value of proxyUsername.
|
void |
setReportFormat(ReportGenerator.Format reportFormat)
Set the value of reportFormat.
|
void |
setReportOutputDirectory(String reportOutputDirectory)
Set the value of reportOutputDirectory.
|
void |
setShowSummary(boolean showSummary)
Set the value of showSummary.
|
void |
setSuppressionFile(String suppressionFile)
Set the value of suppressionFile.
|
void |
setUpdateOnly(boolean updateOnly)
Set the value of updateOnly.
|
void |
setZipExtensions(String zipExtensions)
Set the value of zipExtensions.
|
static void |
showSummary(Dependency[] dependencies)
Generates a warning message listing a summary of dependencies and their
associated CPE and CVE entries.
|
static void |
showSummary(String projectName,
Dependency[] dependencies)
Generates a warning message listing a summary of dependencies and their
associated CPE and CVE entries.
|
public String getApplicationName()
public void setApplicationName(String applicationName)
applicationName - new value of applicationNamepublic List<Dependency> getDependencies()
public void setDependencies(List<Dependency> dependencies)
dependencies - new value of dependenciespublic String getDataDirectory()
public void setDataDirectory(String dataDirectory)
dataDirectory - new value of dataDirectorypublic String getReportOutputDirectory()
public void setReportOutputDirectory(String reportOutputDirectory)
reportOutputDirectory - new value of reportOutputDirectorypublic float getFailBuildOnCVSS()
public void setFailBuildOnCVSS(float failBuildOnCVSS)
failBuildOnCVSS - new value of failBuildOnCVSSpublic boolean isAutoUpdate()
public void setAutoUpdate(boolean autoUpdate)
autoUpdate - new value of autoUpdatepublic boolean isUpdateOnly()
public void setUpdateOnly(boolean updateOnly)
updateOnly - new value of updateOnlypublic boolean isGenerateReport()
public void setGenerateReport(boolean generateReport)
generateReport - new value of generateReportpublic ReportGenerator.Format getReportFormat()
public void setReportFormat(ReportGenerator.Format reportFormat)
reportFormat - new value of reportFormatpublic String getProxyServer()
public void setProxyServer(String proxyServer)
proxyServer - new value of proxyServer@Deprecated public String getProxyUrl()
getProxyServer()
instead@Deprecated public void setProxyUrl(String proxyUrl)
setProxyServer(java.lang.String) insteadproxyUrl - new value of proxyServerpublic String getProxyPort()
public void setProxyPort(String proxyPort)
proxyPort - new value of proxyPortpublic String getProxyUsername()
public void setProxyUsername(String proxyUsername)
proxyUsername - new value of proxyUsernamepublic String getProxyPassword()
public void setProxyPassword(String proxyPassword)
proxyPassword - new value of proxyPasswordpublic String getConnectionTimeout()
public void setConnectionTimeout(String connectionTimeout)
connectionTimeout - new value of connectionTimeoutpublic String getLogFile()
public void setLogFile(String logFile)
logFile - new value of logFilepublic String getSuppressionFile()
public void setSuppressionFile(String suppressionFile)
suppressionFile - new value of suppressionFilepublic boolean isShowSummary()
public void setShowSummary(boolean showSummary)
showSummary - new value of showSummarypublic void setCpeStartsWithFilter(String cpeStartsWithFilter)
cpeStartsWithFilter - filters CPEs based on this starting string
(i.e. cpe:/a: )public String getCpeStartsWithFilter()
public boolean isCentralAnalyzerEnabled()
public void setCentralAnalyzerEnabled(boolean centralAnalyzerEnabled)
centralAnalyzerEnabled - new value of centralAnalyzerEnabledpublic String getCentralUrl()
public void setCentralUrl(String centralUrl)
centralUrl - new value of centralUrlpublic boolean isNexusAnalyzerEnabled()
public void setNexusAnalyzerEnabled(boolean nexusAnalyzerEnabled)
nexusAnalyzerEnabled - new value of nexusAnalyzerEnabledpublic String getNexusUrl()
public void setNexusUrl(String nexusUrl)
nexusUrl - new value of nexusUrlpublic boolean isNexusUsesProxy()
public void setNexusUsesProxy(boolean nexusUsesProxy)
nexusUsesProxy - new value of nexusUsesProxypublic String getDatabaseDriverName()
public void setDatabaseDriverName(String databaseDriverName)
databaseDriverName - new value of databaseDriverNamepublic String getDatabaseDriverPath()
public void setDatabaseDriverPath(String databaseDriverPath)
databaseDriverPath - new value of databaseDriverPathpublic String getConnectionString()
public void setConnectionString(String connectionString)
connectionString - new value of connectionStringpublic String getDatabaseUser()
public void setDatabaseUser(String databaseUser)
databaseUser - new value of databaseUserpublic String getDatabasePassword()
public void setDatabasePassword(String databasePassword)
databasePassword - new value of databasePasswordpublic String getZipExtensions()
public void setZipExtensions(String zipExtensions)
zipExtensions - new value of zipExtensionspublic String getCveUrlModified()
public void setCveUrlModified(String cveUrlModified)
cveUrlModified - new value of cveUrlModifiedpublic String getCveUrlBase()
public void setCveUrlBase(String cveUrlBase)
cveUrlBase - new value of cveUrlBasepublic String getPathToDotnetCore()
public void setPathToDotnetCore(String pathToCore)
pathToCore - new value of pathToCorepublic String getPropertiesFilePath()
public void setPropertiesFilePath(String propertiesFilePath)
propertiesFilePath - new value of propertiesFilePathpublic Engine execute() throws ScanAgentException
ScanAgentException - thrown if
there is an exception executing the scan.public static void showSummary(Dependency[] dependencies)
dependencies - a list of dependency objectspublic static void showSummary(String projectName, Dependency[] dependencies)
projectName - the name of the projectdependencies - a list of dependency objectsCopyright © 2012–2020 OWASP. All rights reserved.