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

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 Details

    • Update

      public Update()
      Construct a new UpdateTask.
  • Method Details

    • setNvdApiEndpoint

      public void setNvdApiEndpoint(String nvdApiEndpoint)
      Set the value of nvdApiEndpoint.
      Parameters:
      nvdApiEndpoint - new value of nvdApiEndpoint
    • setNvdApiKey

      public void setNvdApiKey(String nvdApiKey)
      Set the value of nvdApiKey.
      Parameters:
      nvdApiKey - new value of nvdApiKey
    • setNvdMaxRetryCount

      public void setNvdMaxRetryCount(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(String nvdDatafeedUrl)
      Set the value of nvdDatafeedUrl.
      Parameters:
      nvdDatafeedUrl - new value of nvdDatafeedUrl
    • setNvdUser

      public void setNvdUser(String nvdUser)
      Set the value of nvdUser.
      Parameters:
      nvdUser - new value of nvdUser
    • setNvdPassword

      public void setNvdPassword(String nvdPassword)
      Set the value of nvdPassword.
      Parameters:
      nvdPassword - new value of nvdPassword
    • setNvdBearerToken

      public void setNvdBearerToken(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(Integer nvdApiDelay)
      Set the value of nvdApiDelay.
      Parameters:
      nvdApiDelay - new value of nvdApiDelay
    • setNvdApiResultsPerPage

      public void setNvdApiResultsPerPage(Integer nvdApiResultsPerPage)
      Set the value of nvdApiResultsPerPage.
      Parameters:
      nvdApiResultsPerPage - new value of nvdApiResultsPerPage
    • setProxyServer

      public void setProxyServer(String server)
      Set the value of proxyServer.
      Parameters:
      server - new value of proxyServer
    • setProxyPort

      public void setProxyPort(String proxyPort)
      Set the value of proxyPort.
      Parameters:
      proxyPort - new value of proxyPort
    • setProxyUsername

      public void setProxyUsername(String proxyUsername)
      Set the value of proxyUsername.
      Parameters:
      proxyUsername - new value of proxyUsername
    • setProxyPassword

      public void setProxyPassword(String proxyPassword)
      Set the value of proxyPassword.
      Parameters:
      proxyPassword - new value of proxyPassword
    • setNonProxyHosts

      public void setNonProxyHosts(String nonProxyHosts)
      Set the value of nonProxyHosts.
      Parameters:
      nonProxyHosts - new value of nonProxyHosts
    • setConnectionTimeout

      public void setConnectionTimeout(String connectionTimeout)
      Set the value of connectionTimeout.
      Parameters:
      connectionTimeout - new value of connectionTimeout
    • setReadTimeout

      public void setReadTimeout(String readTimeout)
      Set the value of readTimeout.
      Parameters:
      readTimeout - new value of readTimeout
    • setDatabaseDriverName

      public void setDatabaseDriverName(String databaseDriverName)
      Set the value of databaseDriverName.
      Parameters:
      databaseDriverName - new value of databaseDriverName
    • setDatabaseDriverPath

      public void setDatabaseDriverPath(String databaseDriverPath)
      Set the value of databaseDriverPath.
      Parameters:
      databaseDriverPath - new value of databaseDriverPath
    • setConnectionString

      public void setConnectionString(String connectionString)
      Set the value of connectionString.
      Parameters:
      connectionString - new value of connectionString
    • setDatabaseUser

      public void setDatabaseUser(String databaseUser)
      Set the value of databaseUser.
      Parameters:
      databaseUser - new value of databaseUser
    • setDatabasePassword

      public void setDatabasePassword(String databasePassword)
      Set the value of databasePassword.
      Parameters:
      databasePassword - new value of databasePassword
    • setHostedSuppressionsValidForHours

      public void setHostedSuppressionsValidForHours(Integer hostedSuppressionsValidForHours)
      Set the value of hostedSuppressionsValidForHours.
      Parameters:
      hostedSuppressionsValidForHours - new value of hostedSuppressionsValidForHours
    • setHostedSuppressionsUser

      public void setHostedSuppressionsUser(String hostedSuppressionsUser)
    • setHostedSuppressionsPassword

      public void setHostedSuppressionsPassword(String hostedSuppressionsPassword)
    • setHostedSuppressionsBearerToken

      public void setHostedSuppressionsBearerToken(String hostedSuppressionsBearerToken)
    • setHostedSuppressionsForceUpdate

      public void setHostedSuppressionsForceUpdate(Boolean hostedSuppressionsForceUpdate)
      Set the value of hostedSuppressionsForceUpdate.
      Parameters:
      hostedSuppressionsForceUpdate - new value of hostedSuppressionsForceUpdate
    • setHostedSuppressionsEnabled

      public void setHostedSuppressionsEnabled(Boolean hostedSuppressionsEnabled)
      Set the value of hostedSuppressionsEnabled.
      Parameters:
      hostedSuppressionsEnabled - new value of hostedSuppressionsEnabled
    • setHostedSuppressionsUrl

      public void setHostedSuppressionsUrl(String hostedSuppressionsUrl)
      Set the value of hostedSuppressionsUrl.
      Parameters:
      hostedSuppressionsUrl - new value of hostedSuppressionsUrl
    • setKnownExploitedUrl

      public void setKnownExploitedUrl(String knownExploitedUrl)
      Sets the the knownExploitedUrl.
      Parameters:
      knownExploitedUrl - the URL
    • setKnownExploitedValidForHours

      public void setKnownExploitedValidForHours(Integer knownExploitedValidForHours)
    • setKnownExploitedUser

      public void setKnownExploitedUser(String knownExploitedUser)
      Sets the user for downloading the knownExploitedUrl from a HTTP Basic auth protected location.
      Parameters:
      knownExploitedUser - the user
    • setKnownExploitedPassword

      public void setKnownExploitedPassword(String knownExploitedPassword)
      Sets the password for downloading the knownExploitedUrl from a HTTP Basic auth protected location..
      Parameters:
      knownExploitedPassword - the password
    • setKnownExploitedBearerToken

      public void setKnownExploitedBearerToken(String knownExploitedBearerToken)
      Sets the token for downloading the knownExploitedUrl from an HTTP Bearer auth protected location..
      Parameters:
      knownExploitedBearerToken - the token
    • setKnownExploitedEnabled

      public void setKnownExploitedEnabled(Boolean knownExploitedEnabled)
      Sets whether the analyzer is enabled.
      Parameters:
      knownExploitedEnabled - the value of the new setting
    • setRetireJsUrl

      public void setRetireJsUrl(String retireJsUrl)
      Set the value of the Retire JS repository URL.
      Parameters:
      retireJsUrl - new value of retireJsUrl
    • setRetireJsUrlUser

      public void setRetireJsUrlUser(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(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(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(Boolean retireJsForceUpdate)
      Set the value of retireJsForceUpdate.
      Parameters:
      retireJsForceUpdate - new value of retireJsForceUpdate
    • setRetireJsAnalyzerEnabled

      public void setRetireJsAnalyzerEnabled(Boolean retireJsAnalyzerEnabled)
      Set the value of retireJsAnalyzerEnabled.
      Parameters:
      retireJsAnalyzerEnabled - new value of retireJsAnalyzerEnabled
    • executeWithContextClassloader

      protected void executeWithContextClassloader() throws org.apache.tools.ant.BuildException
      Executes the update by initializing the settings, downloads the NVD XML data, and then processes the data storing it in the local database.
      Overrides:
      executeWithContextClassloader in class Purge
      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.BuildException
      Takes 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:
      populateSettings in class Purge
      Throws:
      org.apache.tools.ant.BuildException - thrown when an invalid setting is configured.