Class 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
    • Field Summary

      • Fields inherited from class org.apache.tools.ant.Task

        target, taskName, taskType, wrapper
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Constructor Summary

      Constructors 
      Constructor Description
      Update()
      Construct a new UpdateTask.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void executeWithContextClassloader()
      Executes the update by initializing the settings, downloads the NVD XML data, and then processes the data storing it in the local database.
      protected void populateSettings()
      Takes the properties supplied and updates the dependency-check settings.
      void setConnectionString​(java.lang.String connectionString)
      Set the value of connectionString.
      void setConnectionTimeout​(java.lang.String connectionTimeout)
      Set the value of connectionTimeout.
      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 setHostedSuppressionsBearerToken​(java.lang.String hostedSuppressionsBearerToken)  
      void setHostedSuppressionsEnabled​(java.lang.Boolean hostedSuppressionsEnabled)
      Set the value of hostedSuppressionsEnabled.
      void setHostedSuppressionsForceUpdate​(java.lang.Boolean hostedSuppressionsForceUpdate)
      Set the value of hostedSuppressionsForceUpdate.
      void setHostedSuppressionsPassword​(java.lang.String hostedSuppressionsPassword)  
      void setHostedSuppressionsUrl​(java.lang.String hostedSuppressionsUrl)
      Set the value of hostedSuppressionsUrl.
      void setHostedSuppressionsUser​(java.lang.String hostedSuppressionsUser)  
      void setHostedSuppressionsValidForHours​(java.lang.Integer hostedSuppressionsValidForHours)
      Set the value of hostedSuppressionsValidForHours.
      void setKnownExploitedBearerToken​(java.lang.String knownExploitedBearerToken)
      Sets the token for downloading the knownExploitedUrl from an HTTP Bearer auth protected location..
      void setKnownExploitedEnabled​(java.lang.Boolean knownExploitedEnabled)
      Sets whether the analyzer is enabled.
      void setKnownExploitedPassword​(java.lang.String knownExploitedPassword)
      Sets the password for downloading the knownExploitedUrl from a HTTP Basic auth protected location..
      void setKnownExploitedUrl​(java.lang.String knownExploitedUrl)
      Sets the the knownExploitedUrl.
      void setKnownExploitedUser​(java.lang.String knownExploitedUser)
      Sets the user for downloading the knownExploitedUrl from a HTTP Basic auth protected location.
      void setKnownExploitedValidForHours​(java.lang.Integer knownExploitedValidForHours)  
      void setNonProxyHosts​(java.lang.String nonProxyHosts)
      Set the value of nonProxyHosts.
      void setNvdApiDelay​(java.lang.Integer nvdApiDelay)
      Set the value of nvdApiDelay.
      void setNvdApiEndpoint​(java.lang.String nvdApiEndpoint)
      Set the value of nvdApiEndpoint.
      void setNvdApiKey​(java.lang.String nvdApiKey)
      Set the value of nvdApiKey.
      void setNvdApiResultsPerPage​(java.lang.Integer nvdApiResultsPerPage)
      Set the value of nvdApiResultsPerPage.
      void setNvdBearerToken​(java.lang.String nvdBearerToken)
      Sets the token to download the NVD Data feed from an HTTP Bearer auth protected location.
      void setNvdDatafeedUrl​(java.lang.String nvdDatafeedUrl)
      Set the value of nvdDatafeedUrl.
      void setNvdMaxRetryCount​(java.lang.Integer nvdMaxRetryCount)
      Set the value of nvdMaxRetryCount.
      void setNvdPassword​(java.lang.String nvdPassword)
      Set the value of nvdPassword.
      void setNvdUser​(java.lang.String nvdUser)
      Set the value of nvdUser.
      void setNvdValidForHours​(int nvdValidForHours)
      Set the value of nvdValidForHours.
      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 server)
      Set the value of proxyServer.
      void setProxyUsername​(java.lang.String proxyUsername)
      Set the value of proxyUsername.
      void setReadTimeout​(java.lang.String readTimeout)
      Set the value of readTimeout.
      void setRetireJsAnalyzerEnabled​(java.lang.Boolean retireJsAnalyzerEnabled)
      Set the value of retireJsAnalyzerEnabled.
      void setRetireJsForceUpdate​(java.lang.Boolean retireJsForceUpdate)
      Set the value of retireJsForceUpdate.
      void setRetireJsUrl​(java.lang.String retireJsUrl)
      Set the value of the Retire JS repository URL.
      void setRetireJsUrlBearerToken​(java.lang.String retireJsUrlBearerToken)
      Sets the token to download the RetireJS JSON data from an HTTP Bearer auth protected location.
      void setRetireJsUrlPassword​(java.lang.String retireJsUrlPassword)
      Sets the password to download the RetireJS JSON data from an HTTP Basic auth protected location.
      void setRetireJsUrlUser​(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.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
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Update

        public Update()
        Construct a new UpdateTask.
    • 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.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.