Class Update
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.owasp.dependencycheck.taskdefs.Purge
org.owasp.dependencycheck.taskdefs.Update
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
Check
An Ant task definition to execute dependency-check update. This will download
the latest data from the National Vulnerability Database (NVD) and store a
copy in the local database.
- Author:
- Jeremy Long
-
Field Summary
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidExecutes the update by initializing the settings, downloads the NVD XML data, and then processes the data storing it in the local database.protected voidTakes the properties supplied and updates the dependency-check settings.voidsetConnectionString(String connectionString) Set the value of connectionString.voidsetConnectionTimeout(String connectionTimeout) Set the value of connectionTimeout.voidsetDatabaseDriverName(String databaseDriverName) Set the value of databaseDriverName.voidsetDatabaseDriverPath(String databaseDriverPath) Set the value of databaseDriverPath.voidsetDatabasePassword(String databasePassword) Set the value of databasePassword.voidsetDatabaseUser(String databaseUser) Set the value of databaseUser.voidsetHostedSuppressionsBearerToken(String hostedSuppressionsBearerToken) voidsetHostedSuppressionsEnabled(Boolean hostedSuppressionsEnabled) Set the value of hostedSuppressionsEnabled.voidsetHostedSuppressionsForceUpdate(Boolean hostedSuppressionsForceUpdate) Set the value of hostedSuppressionsForceUpdate.voidsetHostedSuppressionsPassword(String hostedSuppressionsPassword) voidsetHostedSuppressionsUrl(String hostedSuppressionsUrl) Set the value of hostedSuppressionsUrl.voidsetHostedSuppressionsUser(String hostedSuppressionsUser) voidsetHostedSuppressionsValidForHours(Integer hostedSuppressionsValidForHours) Set the value of hostedSuppressionsValidForHours.voidsetKnownExploitedBearerToken(String knownExploitedBearerToken) Sets the token for downloading the knownExploitedUrl from an HTTP Bearer auth protected location..voidsetKnownExploitedEnabled(Boolean knownExploitedEnabled) Sets whether the analyzer is enabled.voidsetKnownExploitedPassword(String knownExploitedPassword) Sets the password for downloading the knownExploitedUrl from a HTTP Basic auth protected location..voidsetKnownExploitedUrl(String knownExploitedUrl) Sets the the knownExploitedUrl.voidsetKnownExploitedUser(String knownExploitedUser) Sets the user for downloading the knownExploitedUrl from a HTTP Basic auth protected location.voidsetKnownExploitedValidForHours(Integer knownExploitedValidForHours) voidsetNonProxyHosts(String nonProxyHosts) Set the value of nonProxyHosts.voidsetNvdApiDelay(Integer nvdApiDelay) Set the value of nvdApiDelay.voidsetNvdApiEndpoint(String nvdApiEndpoint) Set the value of nvdApiEndpoint.voidsetNvdApiKey(String nvdApiKey) Set the value of nvdApiKey.voidsetNvdApiResultsPerPage(Integer nvdApiResultsPerPage) Set the value of nvdApiResultsPerPage.voidsetNvdBearerToken(String nvdBearerToken) Sets the token to download the NVD Data feed from an HTTP Bearer auth protected location.voidsetNvdDatafeedUrl(String nvdDatafeedUrl) Set the value of nvdDatafeedUrl.voidsetNvdMaxRetryCount(Integer nvdMaxRetryCount) Set the value of nvdMaxRetryCount.voidsetNvdPassword(String nvdPassword) Set the value of nvdPassword.voidsetNvdUser(String nvdUser) Set the value of nvdUser.voidsetNvdValidForHours(int nvdValidForHours) Set the value of nvdValidForHours.voidsetProxyPassword(String proxyPassword) Set the value of proxyPassword.voidsetProxyPort(String proxyPort) Set the value of proxyPort.voidsetProxyServer(String server) Set the value of proxyServer.voidsetProxyUsername(String proxyUsername) Set the value of proxyUsername.voidsetReadTimeout(String readTimeout) Set the value of readTimeout.voidsetRetireJsAnalyzerEnabled(Boolean retireJsAnalyzerEnabled) Set the value of retireJsAnalyzerEnabled.voidsetRetireJsForceUpdate(Boolean retireJsForceUpdate) Set the value of retireJsForceUpdate.voidsetRetireJsUrl(String retireJsUrl) Set the value of the Retire JS repository URL.voidsetRetireJsUrlBearerToken(String retireJsUrlBearerToken) Sets the token to download the RetireJS JSON data from an HTTP Bearer auth protected location.voidsetRetireJsUrlPassword(String retireJsUrlPassword) Sets the password to download the RetireJS JSON data from an HTTP Basic auth protected location.voidsetRetireJsUrlUser(String retireJsUrlUser) Sets the user to download the RetireJS JSON data from an HTTP Basic auth protected location.Methods inherited from class Purge
execute, getSettings, isFailOnError, setDataDirectory, setFailOnErrorMethods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
Update
public Update()Construct a new UpdateTask.
-
-
Method Details
-
setNvdApiEndpoint
Set the value of nvdApiEndpoint.- Parameters:
nvdApiEndpoint- new value of nvdApiEndpoint
-
setNvdApiKey
Set the value of nvdApiKey.- Parameters:
nvdApiKey- new value of nvdApiKey
-
setNvdMaxRetryCount
Set the value of nvdMaxRetryCount.- Parameters:
nvdMaxRetryCount- new value of nvdMaxRetryCount
-
setNvdValidForHours
public void setNvdValidForHours(int nvdValidForHours) Set the value of nvdValidForHours.- Parameters:
nvdValidForHours- new value of nvdValidForHours
-
setNvdDatafeedUrl
Set the value of nvdDatafeedUrl.- Parameters:
nvdDatafeedUrl- new value of nvdDatafeedUrl
-
setNvdUser
Set the value of nvdUser.- Parameters:
nvdUser- new value of nvdUser
-
setNvdPassword
Set the value of nvdPassword.- Parameters:
nvdPassword- new value of nvdPassword
-
setNvdBearerToken
Sets the token to download the NVD Data feed from an HTTP Bearer auth protected location.- Parameters:
nvdBearerToken- The bearer token
-
setNvdApiDelay
Set the value of nvdApiDelay.- Parameters:
nvdApiDelay- new value of nvdApiDelay
-
setNvdApiResultsPerPage
Set the value of nvdApiResultsPerPage.- Parameters:
nvdApiResultsPerPage- new value of nvdApiResultsPerPage
-
setProxyServer
Set the value of proxyServer.- Parameters:
server- new value of proxyServer
-
setProxyPort
Set the value of proxyPort.- Parameters:
proxyPort- new value of proxyPort
-
setProxyUsername
Set the value of proxyUsername.- Parameters:
proxyUsername- new value of proxyUsername
-
setProxyPassword
Set the value of proxyPassword.- Parameters:
proxyPassword- new value of proxyPassword
-
setNonProxyHosts
Set the value of nonProxyHosts.- Parameters:
nonProxyHosts- new value of nonProxyHosts
-
setConnectionTimeout
Set the value of connectionTimeout.- Parameters:
connectionTimeout- new value of connectionTimeout
-
setReadTimeout
Set the value of readTimeout.- Parameters:
readTimeout- new value of readTimeout
-
setDatabaseDriverName
Set the value of databaseDriverName.- Parameters:
databaseDriverName- new value of databaseDriverName
-
setDatabaseDriverPath
Set the value of databaseDriverPath.- Parameters:
databaseDriverPath- new value of databaseDriverPath
-
setConnectionString
Set the value of connectionString.- Parameters:
connectionString- new value of connectionString
-
setDatabaseUser
Set the value of databaseUser.- Parameters:
databaseUser- new value of databaseUser
-
setDatabasePassword
Set the value of databasePassword.- Parameters:
databasePassword- new value of databasePassword
-
setHostedSuppressionsValidForHours
Set the value of hostedSuppressionsValidForHours.- Parameters:
hostedSuppressionsValidForHours- new value of hostedSuppressionsValidForHours
-
setHostedSuppressionsUser
-
setHostedSuppressionsPassword
-
setHostedSuppressionsBearerToken
-
setHostedSuppressionsForceUpdate
Set the value of hostedSuppressionsForceUpdate.- Parameters:
hostedSuppressionsForceUpdate- new value of hostedSuppressionsForceUpdate
-
setHostedSuppressionsEnabled
Set the value of hostedSuppressionsEnabled.- Parameters:
hostedSuppressionsEnabled- new value of hostedSuppressionsEnabled
-
setHostedSuppressionsUrl
Set the value of hostedSuppressionsUrl.- Parameters:
hostedSuppressionsUrl- new value of hostedSuppressionsUrl
-
setKnownExploitedUrl
Sets the the knownExploitedUrl.- Parameters:
knownExploitedUrl- the URL
-
setKnownExploitedValidForHours
-
setKnownExploitedUser
Sets the user for downloading the knownExploitedUrl from a HTTP Basic auth protected location.- Parameters:
knownExploitedUser- the user
-
setKnownExploitedPassword
Sets the password for downloading the knownExploitedUrl from a HTTP Basic auth protected location..- Parameters:
knownExploitedPassword- the password
-
setKnownExploitedBearerToken
Sets the token for downloading the knownExploitedUrl from an HTTP Bearer auth protected location..- Parameters:
knownExploitedBearerToken- the token
-
setKnownExploitedEnabled
Sets whether the analyzer is enabled.- Parameters:
knownExploitedEnabled- the value of the new setting
-
setRetireJsUrl
Set the value of the Retire JS repository URL.- Parameters:
retireJsUrl- new value of retireJsUrl
-
setRetireJsUrlUser
Sets the user to download the RetireJS JSON data from an HTTP Basic auth protected location.- Parameters:
retireJsUrlUser- new value of retireJsUrlUser
-
setRetireJsUrlPassword
Sets the password to download the RetireJS JSON data from an HTTP Basic auth protected location.- Parameters:
retireJsUrlPassword- new value of retireJsUrlPassword
-
setRetireJsUrlBearerToken
Sets the token to download the RetireJS JSON data from an HTTP Bearer auth protected location.- Parameters:
retireJsUrlBearerToken- new value of retireJsUrlBearerToken
-
setRetireJsForceUpdate
Set the value of retireJsForceUpdate.- Parameters:
retireJsForceUpdate- new value of retireJsForceUpdate
-
setRetireJsAnalyzerEnabled
Set the value of retireJsAnalyzerEnabled.- Parameters:
retireJsAnalyzerEnabled- new value of retireJsAnalyzerEnabled
-
executeWithContextClassloader
protected void executeWithContextClassloader() throws org.apache.tools.ant.BuildExceptionExecutes the update by initializing the settings, downloads the NVD XML data, and then processes the data storing it in the local database.- Overrides:
executeWithContextClassloaderin classPurge- Throws:
org.apache.tools.ant.BuildException- thrown if a connection to the local database cannot be made.
-
populateSettings
protected void populateSettings() throws org.apache.tools.ant.BuildExceptionTakes the properties supplied and updates the dependency-check settings. Additionally, this sets the system properties required to change the proxy server, port, and connection timeout.- Overrides:
populateSettingsin classPurge- Throws:
org.apache.tools.ant.BuildException- thrown when an invalid setting is configured.
-