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:
java.lang.Cloneable
- Direct Known Subclasses:
Check
public class Update extends Purge
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
-
-
Constructor Summary
Constructors Constructor Description Update()Construct a new UpdateTask.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidexecuteWithContextClassloader()Executes the update by initializing the settings, downloads the NVD XML data, and then processes the data storing it in the local database.protected voidpopulateSettings()Takes the properties supplied and updates the dependency-check settings.voidsetConnectionString(java.lang.String connectionString)Set the value of connectionString.voidsetConnectionTimeout(java.lang.String connectionTimeout)Set the value of connectionTimeout.voidsetDatabaseDriverName(java.lang.String databaseDriverName)Set the value of databaseDriverName.voidsetDatabaseDriverPath(java.lang.String databaseDriverPath)Set the value of databaseDriverPath.voidsetDatabasePassword(java.lang.String databasePassword)Set the value of databasePassword.voidsetDatabaseUser(java.lang.String databaseUser)Set the value of databaseUser.voidsetHostedSuppressionsBearerToken(java.lang.String hostedSuppressionsBearerToken)voidsetHostedSuppressionsEnabled(java.lang.Boolean hostedSuppressionsEnabled)Set the value of hostedSuppressionsEnabled.voidsetHostedSuppressionsForceUpdate(java.lang.Boolean hostedSuppressionsForceUpdate)Set the value of hostedSuppressionsForceUpdate.voidsetHostedSuppressionsPassword(java.lang.String hostedSuppressionsPassword)voidsetHostedSuppressionsUrl(java.lang.String hostedSuppressionsUrl)Set the value of hostedSuppressionsUrl.voidsetHostedSuppressionsUser(java.lang.String hostedSuppressionsUser)voidsetHostedSuppressionsValidForHours(java.lang.Integer hostedSuppressionsValidForHours)Set the value of hostedSuppressionsValidForHours.voidsetKnownExploitedBearerToken(java.lang.String knownExploitedBearerToken)Sets the token for downloading the knownExploitedUrl from an HTTP Bearer auth protected location..voidsetKnownExploitedEnabled(java.lang.Boolean knownExploitedEnabled)Sets whether the analyzer is enabled.voidsetKnownExploitedPassword(java.lang.String knownExploitedPassword)Sets the password for downloading the knownExploitedUrl from a HTTP Basic auth protected location..voidsetKnownExploitedUrl(java.lang.String knownExploitedUrl)Sets the the knownExploitedUrl.voidsetKnownExploitedUser(java.lang.String knownExploitedUser)Sets the user for downloading the knownExploitedUrl from a HTTP Basic auth protected location.voidsetKnownExploitedValidForHours(java.lang.Integer knownExploitedValidForHours)voidsetNonProxyHosts(java.lang.String nonProxyHosts)Set the value of nonProxyHosts.voidsetNvdApiDelay(java.lang.Integer nvdApiDelay)Set the value of nvdApiDelay.voidsetNvdApiEndpoint(java.lang.String nvdApiEndpoint)Set the value of nvdApiEndpoint.voidsetNvdApiKey(java.lang.String nvdApiKey)Set the value of nvdApiKey.voidsetNvdApiResultsPerPage(java.lang.Integer nvdApiResultsPerPage)Set the value of nvdApiResultsPerPage.voidsetNvdBearerToken(java.lang.String nvdBearerToken)Sets the token to download the NVD Data feed from an HTTP Bearer auth protected location.voidsetNvdDatafeedUrl(java.lang.String nvdDatafeedUrl)Set the value of nvdDatafeedUrl.voidsetNvdMaxRetryCount(java.lang.Integer nvdMaxRetryCount)Set the value of nvdMaxRetryCount.voidsetNvdPassword(java.lang.String nvdPassword)Set the value of nvdPassword.voidsetNvdUser(java.lang.String nvdUser)Set the value of nvdUser.voidsetNvdValidForHours(int nvdValidForHours)Set the value of nvdValidForHours.voidsetProxyPassword(java.lang.String proxyPassword)Set the value of proxyPassword.voidsetProxyPort(java.lang.String proxyPort)Set the value of proxyPort.voidsetProxyServer(java.lang.String server)Set the value of proxyServer.voidsetProxyUsername(java.lang.String proxyUsername)Set the value of proxyUsername.voidsetReadTimeout(java.lang.String readTimeout)Set the value of readTimeout.voidsetRetireJsAnalyzerEnabled(java.lang.Boolean retireJsAnalyzerEnabled)Set the value of retireJsAnalyzerEnabled.voidsetRetireJsForceUpdate(java.lang.Boolean retireJsForceUpdate)Set the value of retireJsForceUpdate.voidsetRetireJsUrl(java.lang.String retireJsUrl)Set the value of the Retire JS repository URL.voidsetRetireJsUrlBearerToken(java.lang.String retireJsUrlBearerToken)Sets the token to download the RetireJS JSON data from an HTTP Bearer auth protected location.voidsetRetireJsUrlPassword(java.lang.String retireJsUrlPassword)Sets the password to download the RetireJS JSON data from an HTTP Basic auth protected location.voidsetRetireJsUrlUser(java.lang.String retireJsUrlUser)Sets the user to download the RetireJS JSON data from an HTTP Basic auth protected location.-
Methods inherited from class org.owasp.dependencycheck.taskdefs.Purge
execute, getSettings, isFailOnError, setDataDirectory, setFailOnError
-
Methods 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, setTaskType
-
-
-
-
Method Detail
-
setNvdApiEndpoint
public void setNvdApiEndpoint(java.lang.String nvdApiEndpoint)
Set the value of nvdApiEndpoint.- Parameters:
nvdApiEndpoint- new value of nvdApiEndpoint
-
setNvdApiKey
public void setNvdApiKey(java.lang.String nvdApiKey)
Set the value of nvdApiKey.- Parameters:
nvdApiKey- new value of nvdApiKey
-
setNvdMaxRetryCount
public void setNvdMaxRetryCount(java.lang.Integer nvdMaxRetryCount)
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
public void setNvdDatafeedUrl(java.lang.String nvdDatafeedUrl)
Set the value of nvdDatafeedUrl.- Parameters:
nvdDatafeedUrl- new value of nvdDatafeedUrl
-
setNvdUser
public void setNvdUser(java.lang.String nvdUser)
Set the value of nvdUser.- Parameters:
nvdUser- new value of nvdUser
-
setNvdPassword
public void setNvdPassword(java.lang.String nvdPassword)
Set the value of nvdPassword.- Parameters:
nvdPassword- new value of nvdPassword
-
setNvdBearerToken
public void setNvdBearerToken(java.lang.String nvdBearerToken)
Sets the token to download the NVD Data feed from an HTTP Bearer auth protected location.- Parameters:
nvdBearerToken- The bearer token
-
setNvdApiDelay
public void setNvdApiDelay(java.lang.Integer nvdApiDelay)
Set the value of nvdApiDelay.- Parameters:
nvdApiDelay- new value of nvdApiDelay
-
setNvdApiResultsPerPage
public void setNvdApiResultsPerPage(java.lang.Integer nvdApiResultsPerPage)
Set the value of nvdApiResultsPerPage.- Parameters:
nvdApiResultsPerPage- new value of nvdApiResultsPerPage
-
setProxyServer
public void setProxyServer(java.lang.String server)
Set the value of proxyServer.- Parameters:
server- new value of proxyServer
-
setProxyPort
public void setProxyPort(java.lang.String proxyPort)
Set the value of proxyPort.- Parameters:
proxyPort- new value of proxyPort
-
setProxyUsername
public void setProxyUsername(java.lang.String proxyUsername)
Set the value of proxyUsername.- Parameters:
proxyUsername- new value of proxyUsername
-
setProxyPassword
public void setProxyPassword(java.lang.String proxyPassword)
Set the value of proxyPassword.- Parameters:
proxyPassword- new value of proxyPassword
-
setNonProxyHosts
public void setNonProxyHosts(java.lang.String nonProxyHosts)
Set the value of nonProxyHosts.- Parameters:
nonProxyHosts- new value of nonProxyHosts
-
setConnectionTimeout
public void setConnectionTimeout(java.lang.String connectionTimeout)
Set the value of connectionTimeout.- Parameters:
connectionTimeout- new value of connectionTimeout
-
setReadTimeout
public void setReadTimeout(java.lang.String readTimeout)
Set the value of readTimeout.- Parameters:
readTimeout- new value of readTimeout
-
setDatabaseDriverName
public void setDatabaseDriverName(java.lang.String databaseDriverName)
Set the value of databaseDriverName.- Parameters:
databaseDriverName- new value of databaseDriverName
-
setDatabaseDriverPath
public void setDatabaseDriverPath(java.lang.String databaseDriverPath)
Set the value of databaseDriverPath.- Parameters:
databaseDriverPath- new value of databaseDriverPath
-
setConnectionString
public void setConnectionString(java.lang.String connectionString)
Set the value of connectionString.- Parameters:
connectionString- new value of connectionString
-
setDatabaseUser
public void setDatabaseUser(java.lang.String databaseUser)
Set the value of databaseUser.- Parameters:
databaseUser- new value of databaseUser
-
setDatabasePassword
public void setDatabasePassword(java.lang.String databasePassword)
Set the value of databasePassword.- Parameters:
databasePassword- new value of databasePassword
-
setHostedSuppressionsValidForHours
public void setHostedSuppressionsValidForHours(java.lang.Integer hostedSuppressionsValidForHours)
Set the value of hostedSuppressionsValidForHours.- Parameters:
hostedSuppressionsValidForHours- new value of hostedSuppressionsValidForHours
-
setHostedSuppressionsUser
public void setHostedSuppressionsUser(java.lang.String hostedSuppressionsUser)
-
setHostedSuppressionsPassword
public void setHostedSuppressionsPassword(java.lang.String hostedSuppressionsPassword)
-
setHostedSuppressionsBearerToken
public void setHostedSuppressionsBearerToken(java.lang.String hostedSuppressionsBearerToken)
-
setHostedSuppressionsForceUpdate
public void setHostedSuppressionsForceUpdate(java.lang.Boolean hostedSuppressionsForceUpdate)
Set the value of hostedSuppressionsForceUpdate.- Parameters:
hostedSuppressionsForceUpdate- new value of hostedSuppressionsForceUpdate
-
setHostedSuppressionsEnabled
public void setHostedSuppressionsEnabled(java.lang.Boolean hostedSuppressionsEnabled)
Set the value of hostedSuppressionsEnabled.- Parameters:
hostedSuppressionsEnabled- new value of hostedSuppressionsEnabled
-
setHostedSuppressionsUrl
public void setHostedSuppressionsUrl(java.lang.String hostedSuppressionsUrl)
Set the value of hostedSuppressionsUrl.- Parameters:
hostedSuppressionsUrl- new value of hostedSuppressionsUrl
-
setKnownExploitedUrl
public void setKnownExploitedUrl(java.lang.String knownExploitedUrl)
Sets the the knownExploitedUrl.- Parameters:
knownExploitedUrl- the URL
-
setKnownExploitedValidForHours
public void setKnownExploitedValidForHours(java.lang.Integer knownExploitedValidForHours)
-
setKnownExploitedUser
public void setKnownExploitedUser(java.lang.String knownExploitedUser)
Sets the user for downloading the knownExploitedUrl from a HTTP Basic auth protected location.- Parameters:
knownExploitedUser- the user
-
setKnownExploitedPassword
public void setKnownExploitedPassword(java.lang.String knownExploitedPassword)
Sets the password for downloading the knownExploitedUrl from a HTTP Basic auth protected location..- Parameters:
knownExploitedPassword- the password
-
setKnownExploitedBearerToken
public void setKnownExploitedBearerToken(java.lang.String knownExploitedBearerToken)
Sets the token for downloading the knownExploitedUrl from an HTTP Bearer auth protected location..- Parameters:
knownExploitedBearerToken- the token
-
setKnownExploitedEnabled
public void setKnownExploitedEnabled(java.lang.Boolean knownExploitedEnabled)
Sets whether the analyzer is enabled.- Parameters:
knownExploitedEnabled- the value of the new setting
-
setRetireJsUrl
public void setRetireJsUrl(java.lang.String retireJsUrl)
Set the value of the Retire JS repository URL.- Parameters:
retireJsUrl- new value of retireJsUrl
-
setRetireJsUrlUser
public void setRetireJsUrlUser(java.lang.String retireJsUrlUser)
Sets the user to download the RetireJS JSON data from an HTTP Basic auth protected location.- Parameters:
retireJsUrlUser- new value of retireJsUrlUser
-
setRetireJsUrlPassword
public void setRetireJsUrlPassword(java.lang.String retireJsUrlPassword)
Sets the password to download the RetireJS JSON data from an HTTP Basic auth protected location.- Parameters:
retireJsUrlPassword- new value of retireJsUrlPassword
-
setRetireJsUrlBearerToken
public void setRetireJsUrlBearerToken(java.lang.String retireJsUrlBearerToken)
Sets the token to download the RetireJS JSON data from an HTTP Bearer auth protected location.- Parameters:
retireJsUrlBearerToken- new value of retireJsUrlBearerToken
-
setRetireJsForceUpdate
public void setRetireJsForceUpdate(java.lang.Boolean retireJsForceUpdate)
Set the value of retireJsForceUpdate.- Parameters:
retireJsForceUpdate- new value of retireJsForceUpdate
-
setRetireJsAnalyzerEnabled
public void setRetireJsAnalyzerEnabled(java.lang.Boolean retireJsAnalyzerEnabled)
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.
-
-