Back to Dependencycheck

Configuration Update

src/site/markdown/dependency-check-gradle/configuration-update.md

12.2.212.9 KB
Original Source

Tasks

TaskDescription
dependencyCheckAnalyzeRuns dependency-check against the project and generates a report.
dependencyCheckAggregateRuns dependency-check against a multi-project build and generates a report.
dependencyCheckUpdateUpdates the local cache of the NVD data from NIST.
dependencyCheckPurgeDeletes the local copy of the NVD. This is used to force a refresh of the data.

Configuration

groovy
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'org.owasp:dependency-check-gradle:${project.version}'
    }
}
apply plugin: 'org.owasp.dependencycheck'

check.dependsOn dependencyCheckUpdate
PropertyDescriptionDefault Value
failOnErrorFails the build if an error occurs during the dependency-check analysis.true

Example

groovy
dependencyCheck {
    failOnError = true
}

Proxy Configuration

Please see https://docs.gradle.org/current/userguide/build_environment.html#sec:accessing_the_web_via_a_proxy

Advanced Configuration

The following properties can be configured in the dependencyCheck task. However, they are less frequently changed.

Config GroupPropertyDescriptionDefault Value
nvdapiKeyThe API Key to access the NVD API; obtained from https://nvd.nist.gov/developers/request-an-api-key 
nvdendpointThe NVD API endpoint URL; setting this is uncommon.https://services.nvd.nist.gov/rest/json/cves/2.0
nvdmaxRetryCountThe maximum number of retry requests for a single call to the NVD API.10
nvddelayThe number of milliseconds to wait between calls to the NVD API.3500 with an NVD API Key or 8000 without an API Key .
nvdresultsPerPageThe number records for a single page from NVD API (must be <=2000).2000
nvddatafeedUrlThe URL for the NVD API Data feed that can be generated using https://github.com/jeremylong/open-vulnerability-cli/blob/main/README.md#mirroring-the-nvd-cve-data 
nvddatafeedUserCredentials used for basic authentication for the NVD API Data feed. 
nvddatafeedPasswordCredentials used for basic authentication for the NVD API Data feed. 
nvddatafeedBearerTokenCredentials used for bearer authentication for the NVD API Data feed. 
nvdvalidForHoursThe number of hours to wait before checking for new updates from the NVD.4
datadirectorySets the data directory to hold SQL CVEs contents. This should generally not be changed.~/.gradle/dependency-check-data/
datadriverThe database driver full classname; note, only needs to be set if the driver is not JDBC4 compliant or the JAR is outside of the class path. 
datadriverPathThe path to the database driver JAR file; only needs to be set if the driver is not in the class path. 
dataconnectionStringThe connection string used to connect to the database. See using a database server. 
datausernameThe username used when connecting to the database. 
datapasswordThe password used when connecting to the database. 
hostedSuppressionsenabledWhether the hosted suppressions file will be used.true
hostedSuppressionsforceupdateSets whether hosted suppressions file will update regardless of the autoupdate setting.false
hostedSuppressionsurlThe URL to (a mirror of) the hosted suppressions file.https://dependency-check.github.io/DependencyCheck/suppressions/publishedSuppressions.xml
hostedSuppressionsuserCredentials used for basic authentication for the hosted suppressions file. 
hostedSuppressionspasswordCredentials used for basic authentication for the hosted suppressions file. 
hostedSuppressionsbearerTokenCredentials used for bearer authentication for the hosted suppressions file. 
hostedSuppressionsvalidForHoursThe number of hours to wait before checking for new updates of the hosted suppressions file .2

Example

groovy
dependencyCheck {
    data.directory = 'd:/nvd'
}

Analyzer Additional Configuration

Cached web datasources for several analyzers are configured inside the analyzers section with some properties as the update task. In addition to the above, the update task can be customized for retrieval of these resources by the following analyzer-specific properties underneath the analyzers section.

The subset of analyzers properties relevant to the update task are:

Config GroupPropertyDescriptionDefault Value
kevenabledSets whether the Known Exploited Vulnerability update and analyzer are enabled.true
kevurlThe URL to (a mirror of) the CISA Known Exploited Vulnerabilities JSON data feed.https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
kevuserCredentials used for basic authentication for the CISA Known Exploited Vulnerabilities JSON data feed. 
kevpasswordCredentials used for basic authentication for the CISA Known Exploited Vulnerabilities JSON data feed. 
kevbearerTokenCredentials used for bearer authentication for the CISA Known Exploited Vulnerabilities JSON data feed. 
kevvalidForHoursThe number of hours to wait before checking for new updates of the hosted suppressions file .2
retirejsenabledSets whether the RetireJS Analyzer should be used.true
retirejsforceupdateSets whether the RetireJS Analyzer should update regardless of the autoupdate setting.false
retirejsretireJsUrlThe URL to the Retire JS repository.https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json
retirejsuserCredentials used for basic authentication for the Retire JS repository URL. 
retirejspasswordCredentials used for basic authentication for the Retire JS repository URL. 
retirejsbearerTokenCredentials used for bearer authentication for the Retire JS repository URL. 

Example

groovy
dependencyCheck {
    analyzers.retirejs.enabled = false
}