@NotThreadSafe
public class DependencyCheckScanAgent
extends java.lang.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.
|
java.lang.String |
getApplicationName()
Get the value of applicationName.
|
java.lang.String |
getCentralUrl()
Get the value of centralUrl.
|
java.lang.String |
getConnectionString()
Get the value of connectionString.
|
java.lang.String |
getConnectionTimeout()
Get the value of connectionTimeout.
|
java.lang.String |
getCpeStartsWithFilter()
Returns the starting string that identifies CPEs that are qualified to be
imported.
|
java.lang.String |
getDatabaseDriverName()
Get the value of databaseDriverName.
|
java.lang.String |
getDatabaseDriverPath()
Get the value of databaseDriverPath.
|
java.lang.String |
getDatabasePassword()
Get the value of databasePassword.
|
java.lang.String |
getDatabaseUser()
Get the value of databaseUser.
|
java.lang.String |
getDataDirectory()
Get the value of dataDirectory.
|
java.util.List<Dependency> |
getDependencies()
Returns a list of pre-determined dependencies.
|
java.lang.Double |
getFailBuildOnCVSS()
Get the value of failBuildOnCVSS.
|
java.lang.String |
getLogFile()
Get the value of logFile.
|
java.lang.String |
getNexusUrl()
Get the value of nexusUrl.
|
java.lang.String |
getNvdApiKey()
Get the value of nvdApiKey.
|
java.lang.String |
getPathToDotnetCore()
Get the value of pathToCore.
|
java.lang.String |
getPropertiesFilePath()
Get the value of propertiesFilePath.
|
java.lang.String |
getProxyPassword()
Get the value of proxyPassword.
|
java.lang.String |
getProxyPort()
Get the value of proxyPort.
|
java.lang.String |
getProxyServer()
Get the value of proxyServer.
|
java.lang.String |
getProxyUrl()
Deprecated.
use
getProxyServer()
instead |
java.lang.String |
getProxyUsername()
Get the value of proxyUsername.
|
java.lang.String |
getReadTimeout()
Get the value of readTimeout.
|
ReportGenerator.Format |
getReportFormat()
Get the value of reportFormat.
|
java.lang.String |
getReportOutputDirectory()
Get the value of reportOutputDirectory.
|
java.lang.String |
getSuppressionFile()
Get the value of suppressionFile.
|
java.lang.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(java.lang.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(java.lang.String centralUrl)
Set the value of centralUrl.
|
void |
setConnectionString(java.lang.String connectionString)
Set the value of connectionString.
|
void |
setConnectionTimeout(java.lang.String connectionTimeout)
Set the value of connectionTimeout.
|
void |
setCpeStartsWithFilter(java.lang.String cpeStartsWithFilter)
Sets starting string that identifies CPEs that are qualified to be
imported.
|
void |
setDatabaseDriverName(java.lang.String databaseDriverName)
Set the value of databaseDriverName.
|
void |
setDatabaseDriverPath(java.lang.String databaseDriverPath)
Set the value of databaseDriverPath.
|
void |
setDatabasePassword(java.lang.String databasePassword)
Set the value of databasePassword.
|
void |
setDatabaseUser(java.lang.String databaseUser)
Set the value of databaseUser.
|
void |
setDataDirectory(java.lang.String dataDirectory)
Set the value of dataDirectory.
|
void |
setDependencies(java.util.List<Dependency> dependencies)
Sets the list of dependencies to scan.
|
void |
setFailBuildOnCVSS(java.lang.Double failBuildOnCVSS)
Set the value of failBuildOnCVSS.
|
void |
setGenerateReport(boolean generateReport)
Set the value of generateReport.
|
void |
setLogFile(java.lang.String logFile)
Set the value of logFile.
|
void |
setNexusAnalyzerEnabled(boolean nexusAnalyzerEnabled)
Set the value of nexusAnalyzerEnabled.
|
void |
setNexusUrl(java.lang.String nexusUrl)
Set the value of nexusUrl.
|
void |
setNexusUsesProxy(boolean nexusUsesProxy)
Set the value of nexusUsesProxy.
|
void |
setNvdApiKey(java.lang.String nvdApiKey)
Set the value of nvdApiKey.
|
void |
setPathToDotnetCore(java.lang.String pathToCore)
Set the value of pathToCore.
|
void |
setPropertiesFilePath(java.lang.String propertiesFilePath)
Set the value of propertiesFilePath.
|
void |
setProxyPassword(java.lang.String proxyPassword)
Set the value of proxyPassword.
|
void |
setProxyPort(java.lang.String proxyPort)
Set the value of proxyPort.
|
void |
setProxyServer(java.lang.String proxyServer)
Set the value of proxyServer.
|
void |
setProxyUrl(java.lang.String proxyUrl)
Deprecated.
use
setProxyServer(java.lang.String) instead |
void |
setProxyUsername(java.lang.String proxyUsername)
Set the value of proxyUsername.
|
void |
setReadTimeout(java.lang.String readTimeout)
Set the value of readTimeout.
|
void |
setReportFormat(ReportGenerator.Format reportFormat)
Set the value of reportFormat.
|
void |
setReportOutputDirectory(java.lang.String reportOutputDirectory)
Set the value of reportOutputDirectory.
|
void |
setShowSummary(boolean showSummary)
Set the value of showSummary.
|
void |
setSuppressionFile(java.lang.String suppressionFile)
Set the value of suppressionFile.
|
void |
setUpdateOnly(boolean updateOnly)
Set the value of updateOnly.
|
void |
setZipExtensions(java.lang.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(java.lang.String projectName,
Dependency[] dependencies)
Generates a warning message listing a summary of dependencies and their
associated CPE and CVE entries.
|
public java.lang.String getApplicationName()
public void setApplicationName(java.lang.String applicationName)
applicationName - new value of applicationNamepublic java.lang.String getNvdApiKey()
public void setNvdApiKey(java.lang.String nvdApiKey)
nvdApiKey - new value of nvdApiKeypublic java.util.List<Dependency> getDependencies()
public void setDependencies(java.util.List<Dependency> dependencies)
dependencies - new value of dependenciespublic java.lang.String getDataDirectory()
public void setDataDirectory(java.lang.String dataDirectory)
dataDirectory - new value of dataDirectorypublic java.lang.String getReportOutputDirectory()
public void setReportOutputDirectory(java.lang.String reportOutputDirectory)
reportOutputDirectory - new value of reportOutputDirectorypublic java.lang.Double getFailBuildOnCVSS()
public void setFailBuildOnCVSS(java.lang.Double 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 java.lang.String getProxyServer()
public void setProxyServer(java.lang.String proxyServer)
proxyServer - new value of proxyServer@Deprecated public java.lang.String getProxyUrl()
getProxyServer()
instead@Deprecated public void setProxyUrl(java.lang.String proxyUrl)
setProxyServer(java.lang.String) insteadproxyUrl - new value of proxyServerpublic java.lang.String getProxyPort()
public void setProxyPort(java.lang.String proxyPort)
proxyPort - new value of proxyPortpublic java.lang.String getProxyUsername()
public void setProxyUsername(java.lang.String proxyUsername)
proxyUsername - new value of proxyUsernamepublic java.lang.String getProxyPassword()
public void setProxyPassword(java.lang.String proxyPassword)
proxyPassword - new value of proxyPasswordpublic java.lang.String getConnectionTimeout()
public void setConnectionTimeout(java.lang.String connectionTimeout)
connectionTimeout - new value of connectionTimeoutpublic java.lang.String getReadTimeout()
public void setReadTimeout(java.lang.String readTimeout)
readTimeout - new value of readTimeoutpublic java.lang.String getLogFile()
public void setLogFile(java.lang.String logFile)
logFile - new value of logFilepublic java.lang.String getSuppressionFile()
public void setSuppressionFile(java.lang.String suppressionFile)
suppressionFile - new value of suppressionFilepublic boolean isShowSummary()
public void setShowSummary(boolean showSummary)
showSummary - new value of showSummarypublic void setCpeStartsWithFilter(java.lang.String cpeStartsWithFilter)
cpeStartsWithFilter - filters CPEs based on this starting string
(i.e. cpe:/a: )public java.lang.String getCpeStartsWithFilter()
public boolean isCentralAnalyzerEnabled()
public void setCentralAnalyzerEnabled(boolean centralAnalyzerEnabled)
centralAnalyzerEnabled - new value of centralAnalyzerEnabledpublic java.lang.String getCentralUrl()
public void setCentralUrl(java.lang.String centralUrl)
centralUrl - new value of centralUrlpublic boolean isNexusAnalyzerEnabled()
public void setNexusAnalyzerEnabled(boolean nexusAnalyzerEnabled)
nexusAnalyzerEnabled - new value of nexusAnalyzerEnabledpublic java.lang.String getNexusUrl()
public void setNexusUrl(java.lang.String nexusUrl)
nexusUrl - new value of nexusUrlpublic boolean isNexusUsesProxy()
public void setNexusUsesProxy(boolean nexusUsesProxy)
nexusUsesProxy - new value of nexusUsesProxypublic java.lang.String getDatabaseDriverName()
public void setDatabaseDriverName(java.lang.String databaseDriverName)
databaseDriverName - new value of databaseDriverNamepublic java.lang.String getDatabaseDriverPath()
public void setDatabaseDriverPath(java.lang.String databaseDriverPath)
databaseDriverPath - new value of databaseDriverPathpublic java.lang.String getConnectionString()
public void setConnectionString(java.lang.String connectionString)
connectionString - new value of connectionStringpublic java.lang.String getDatabaseUser()
public void setDatabaseUser(java.lang.String databaseUser)
databaseUser - new value of databaseUserpublic java.lang.String getDatabasePassword()
public void setDatabasePassword(java.lang.String databasePassword)
databasePassword - new value of databasePasswordpublic java.lang.String getZipExtensions()
public void setZipExtensions(java.lang.String zipExtensions)
zipExtensions - new value of zipExtensionspublic java.lang.String getPathToDotnetCore()
public void setPathToDotnetCore(java.lang.String pathToCore)
pathToCore - new value of pathToCorepublic java.lang.String getPropertiesFilePath()
public void setPropertiesFilePath(java.lang.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(java.lang.String projectName,
Dependency[] dependencies)
projectName - the name of the projectdependencies - a list of dependency objectsCopyright© 2012-21 Jeremy Long. All Rights Reserved.