Back to Dependencycheck

Configuration

maven/src/site/markdown/configuration.md

12.2.276.1 KB
Original Source

Goals

GoalDescription
aggregateRuns dependency-check against the child projects and aggregates the results into a single report. Warning: if the aggregate goal is used within the site reporting a blank report will likely be present for any goal beyond site:site (i.e. site:stage or site:deploy will likely result in blank reports being staged or deployed); however, site:site will work. See issue #325 for more information.
checkRuns dependency-check against the project and generates a report.
update-onlyUpdates the local cache of the NVD data from NIST.
purgeDeletes the local copy of the NVD. This is used to force a refresh of the data.

Configuration

The following properties can be set on the dependency-check-maven plugin.

PropertyDescriptionDefault Value
autoUpdateSets whether auto-updating of the NVD CVE/CPE, retireJS and hosted suppressions data is enabled. It is not recommended that this be turned to false.true
formatThe report format to be generated (HTML, XML, CSV, JSON, JUNIT, SARIF, JENKINS, GITLAB, ALL). This configuration is ignored if formats is defined. This configuration option has no affect if using this within the Site plugin unless the externalReport is set to true.HTML
formatsA list of report formats to be generated (HTML, XML, CSV, JSON, JUNIT, SARIF, JENKINS, GITLAB, ALL). This configuration overrides the value from format. This configuration option has no affect if using this within the Site plugin unless the externalReport is set to true. 
junitFailOnCVSSIf using the JUNIT report format the junitFailOnCVSS sets the CVSS score threshold that is considered a failure.0
prettyPrintWhether the XML and JSON formatted reports should be pretty printed.false
failBuildOnCVSSSpecifies if the build should be failed if a CVSS score equal to or above a specified level is identified. The default is 11 which means since the CVSS scores are 0-10, by default the build will never fail. More information on CVSS scores can be found at the NVD11
failBuildOnAnyVulnerabilitySpecifies that if any vulnerability is identified, the build will fail.false
failOnErrorWhether the build should fail if there is an error executing the dependency-check analysis.true
nameThe name of the report in the site.dependency-check or dependency-check:aggregate
outputDirectoryThe location to write the report(s). This can be specified on the command line via -Dodc.outputDirectory. Note, this is not used if generating the report as part of a mvn site build.'target'
scanSetAn optional collection of file sets that specify additional files and/or directories to analyze as part of the scan. If not specified, defaults to standard Maven conventions. This cannot be configured via the command line parameters (e.g. -DscanSet=./path) - use the below scanDirectory instead. Note that the scan sets specified should be relative from the base directory - do not use Maven project variable substitution (e.g. ${project.basedir}/src/webpack). Using Maven project variable substitution can cause directories to be missed especially when using an aggregate build.['src/main/resources', 'src/main/filters', 'src/main/webapp', './package.json', './package-lock.json', './npm-shrinkwrap.json', './Gopkg.lock', './go.mod']
scanDirectoryAn optional collection of directories to include in the scan. This configuration should only be used via the command line - if configuring the scan directories within the pom.xml please consider using the above scanSet. 
scanDependenciesSets whether the dependencies should be scanned.true
scanPluginsSets whether the plugins and their dependencies should be scanned.false
skipSkips the dependency-check analysis.false
skipProvidedScopeSkip analysis for artifacts with Provided Scope.false
skipRuntimeScopeSkip analysis for artifacts with Runtime Scope.false
skipSystemScopeSkip analysis for artifacts with System Scope.false
skipTestScopeSkip analysis for artifacts with Test Scope.true
skipDependencyManagementSkip analysis for dependencyManagement sections.true
skipArtifactTypeA regular expression used to filter/skip artifact types. This filters on the type of dependency as defined in the dependency section: jar, pom, test-jar, etc. 
suppressionFilesThe file paths to the XML suppression files - used to suppress false positives. The configuration value can be a local file path, a URL to a suppression file, or even a reference to a file on the class path (see https://github.com/dependency-check/DependencyCheck/issues/1878#issuecomment-487533799) 
failBuildOnUnusedSuppressionRuleSpecifies that if any unused suppression rule is found, the build will fail.false
hintsFileThe file path to the XML hints file - used to resolve false negatives. 
enableExperimentalEnable the experimental analyzers. If not enabled the experimental analyzers (see below) will not be loaded or used.false
enableRetiredEnable the retired analyzers. If not enabled the retired analyzers (see below) will not be loaded or used.false
versionCheckEnabledWhether dependency-check should check if a new version of dependency-check-maven exists.true

Analyzer Configuration

The following properties are used to configure the various file type analyzers. These properties can be used to turn off specific analyzers if it is not needed. Note, that specific analyzers will automatically disable themselves if no file types that they support are detected - so specifically disabling them may not be needed.

PropertyDescriptionDefault Value
archiveAnalyzerEnabledSets whether the Archive Analyzer will be used.true
zipExtensionsA comma-separated list of additional file extensions to be treated like a ZIP file, the contents will be extracted and analyzed. 
excludesA list of exclude patterns to filter out maven artifacts from being scanned. 
jarAnalyzerEnabledSets whether Jar Analyzer will be used.true
centralAnalyzerEnabledSets whether Central Analyzer will be used; by default in the Maven plugin this analyzer is disabled as all information gained from Central is already available in the build.false
centralAnalyzerUseCacheSets whether the Central Analyzer will cache results. Cached results expire after 30 days.true
dartAnalyzerEnabledSets whether the experimental Dart Analyzer will be used.true
knownExploitedEnabledSets whether the Known Exploited Vulnerability update and analyzer are enabled.true
knownExploitedUrlSets URL to the CISA Known Exploited Vulnerabilities JSON data feed.https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
ossIndexAnalyzerEnabledSets whether the OSS Index Analyzer will be enabled. This analyzer requires an internet connection, and authentication is mandatory. Deprecated alias: ossindexAnalyzerEnabledtrue
ossIndexAnalyzerUseCacheSets whether the OSS Index Analyzer will cache results. Deprecated alias: ossindexAnalyzerUseCachetrue
ossIndexAnalyzerCacheValidForHoursThe number of hours to wait before checking for new updates on individual packages/components from Sonatype OSS Index.24
ossIndexAnalyzerUrlAlternative base URL for the OSS Index API. If not set the public Sonatype OSS Index API on Sonatype Guide will be used. Deprecated alias: ossindexAnalyzerUrlhttps://api.guide.sonatype.com
ossIndexServerIdThe id of a server defined in the settings.xml to authenticate Sonatype OSS Index API requests. Provide a Sonatype Guide personal access token alone as password OR for legacy OSS Index API tokens provide username = account email address and password = legacy API token (deprecated). 
ossIndexUsername(deprecated) Sets the OSS Index API username for use with legacy OSS Index API tokens (as an alternative to the indirection through the ossIndexServerId noted above). Username is not required after migration to using Sonatype Guide personal access token as password. 
ossIndexPasswordSets the OSS Index API token (deprecated) or Sonatype Guide personal access token (as an alternative to the indirection through the ossIndexServerId noted above). 
ossIndexWarnOnlyOnRemoteErrorsSets whether remote errors from the OSS Index (e.g. BAD GATEWAY, RATE LIMIT EXCEEDED) will result in warnings only instead of failing execution.false
nexusAnalyzerEnabledSets whether Nexus Analyzer will be used. This analyzer is an alternative to the Central or Artifactory Analyzers, allowing retrieval from Sonatype Nexus installations.false
nexusUrlDefines the Nexus Server's web service end point (example http://domain.enterprise/service/local/). If not set the Nexus Analyzer will be disabled. 
nexusServerIdThe id of a server defined in the settings.xml that configures the credentials (username and password) for a Nexus server's REST API end point. When not specified the communication with the Nexus server's REST API will be unauthenticated. 
nexusUsesProxyWhether or not the defined proxy should be used when connecting to Nexus.true
artifactoryAnalyzerEnabledSets whether Artifactory analyzer will be usedfalse
artifactoryAnalyzerUrlThe Artifactory server URL. 
artifactoryAnalyzerUseProxyWhether Artifactory should be accessed through a proxy or not.false
artifactoryAnalyzerParallelAnalysisWhether the Artifactory analyzer should be run in parallel or nottrue
artifactoryAnalyzerServerIdThe id of a server defined in the settings.xml to retrieve the credentials (username and API token) to connect to Artifactory instance. It is used in priority to artifactoryAnalyzerUsername and artifactoryAnalyzerApiTokenartifactory
artifactoryAnalyzerUsernameThe user name (only used with API token) to connect to Artifactory instance 
artifactoryAnalyzerApiTokenThe API token to connect to Artifactory instance, only used if the username or the API key are not defined by artifactoryAnalyzerServerId,artifactoryAnalyzerUsername or artifactoryAnalyzerApiToken 
artifactoryAnalyzerBearerTokenThe bearer token to connect to Artifactory instance 
pyDistributionAnalyzerEnabledSets whether the experimental Python Distribution Analyzer will be used. enableExperimental must be set to true.true
pyPackageAnalyzerEnabledSets whether the experimental Python Package Analyzer will be used. enableExperimental must be set to true.true
rubygemsAnalyzerEnabledSets whether the experimental Ruby Gemspec Analyzer will be used. enableExperimental must be set to true.true
opensslAnalyzerEnabledSets whether the openssl Analyzer should be used.true
cmakeAnalyzerEnabledSets whether the experimental CMake Analyzer should be used. enableExperimental must be set to true.true
autoconfAnalyzerEnabledSets whether the experimental autoconf Analyzer should be used. enableExperimental must be set to true.true
pipAnalyzerEnabledSets whether the experimental pip Analyzer should be used. enableExperimental must be set to true.true
pipfileAnalyzerEnabledSets whether the experimental Pipfile Analyzer should be used. enableExperimental must be set to true.true
poetryAnalyzerEnabledSets whether the experimental Poetry Analyzer should be used. enableExperimental must be set to true.true
composerAnalyzerEnabledSets whether the experimental PHP Composer Lock File Analyzer should be used. enableExperimental must be set to true.true
composerAnalyzerSkipDevSets whether the experimental PHP Composer Lock File Analyzer should skip "packages-dev"false
cpanfileAnalyzerEnabledSets whether the experimental Perl CPAN File Analyzer should be used. enableExperimental must be set to true.true
yarnAuditAnalyzerEnabledSets whether the Yarn Audit Analyzer should be used. This analyzer requires yarn and an internet connection. Use nodeAuditSkipDevDependencies to skip dev dependencies.true
pnpmAuditAnalyzerEnabledSets whether the Pnpm Audit Analyzer should be used. This analyzer requires pnpm and an internet connection. Use nodeAuditSkipDevDependencies to skip dev dependencies.true
pathToYarnThe path to yarn. 
pathToPnpmThe path to pnpm. 
nodeAnalyzerEnabledSets whether the Node Package Analyzer should be used.true
nodePackageSkipDevDependenciesSets whether the Node Package Analyzer will skip devDependencies.false
nodeAuditAnalyzerEnabledSets whether the Node Audit Analyzer should be used. This analyzer requires an internet connection.true
nodeAuditAnalyzerUseCacheSets whether the Node Audit Analyzer will cache results. Cached results expire after 24 hours.true
nodeAuditSkipDevDependenciesSets whether the Node Audit Analyzer will skip devDependencies.false
nodeAuditAnalyzerUrlThe Node Audit API URL for the Node Audit Analyzer.https://registry.npmjs.org/-/npm/v1/security/audits
retireJsAnalyzerEnabledSets whether the RetireJS Analyzer should be used.true
retireJsForceUpdateSets whether the RetireJS Analyzer should update regardless of the autoupdate setting.false
retireJsUrlThe URL to the Retire JS repository. Note the file name must be jsrepository.json.https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json
nuspecAnalyzerEnabledSets whether the .NET Nuget Nuspec Analyzer will be used.true
nugetconfAnalyzerEnabledSets whether the experimental .NET Nuget packages.config Analyzer will be used. enableExperimental must be set to true.true
libmanAnalyzerEnabledSets whether the Libman Analyzer will be used.true
cocoapodsAnalyzerEnabledSets whether the experimental Cocoapods Analyzer should be used. enableExperimental must be set to true.true
carthageAnalyzerEnabledSets whether the experimental Carthage Analyzer should be used. enableExperimental must be set to true.true
bundleAuditAnalyzerEnabledSets whether the experimental Bundle Audit Analyzer should be used. enableExperimental must be set to true.true
bundleAuditPathSets the path to the bundle audit executable; only used if bundle audit analyzer is enabled and experimental analyzers are enabled. 
swiftPackageManagerAnalyzerEnabledSets whether the experimental Swift Package Analyzer should be used. enableExperimental must be set to true.true
swiftPackageResolvedAnalyzerEnabledSets whether the experimental Swift Package Resolved should be used. enableExperimental must be set to true.true
assemblyAnalyzerEnabledSets whether the .NET Assembly Analyzer should be used.true
msbuildAnalyzerEnabledSets whether the MSBuild Analyzer should be used.true
pathToCoreThe path to dotnet core .NET assembly analysis on non-windows systems. 
golangDepEnabledSets whether or not the experimental Golang Dependency Analyzer should be used. enableExperimental must be set to true.true
golangModEnabledSets whether or not the experimental Goland Module Analyzer should be used; requires go to be installed. enableExperimental must be set to true.true
pathToGoThe path to go. 

RetireJS Configuration

If using the experimental RetireJS Analyzer the following configuration options are available to control the included JS files

###Example

<pre> &lt;retirejs&gt; &lt;filters&gt; &lt;filter&gt;Copyright\(c\) Jeremy Long&lt;/filter&gt; &lt;/filters&gt; &lt;filterNonVulnerable&gt;true&lt;/filterNonVulnerable&gt; &lt;/retirejs&gt; </pre>
PropertyDescriptionDefault Value
filtersA list of file content filters used to exclude JS files based on content. This is most commonly used to exclude JS files based on your organizations copyright so that your JS files do not get listed as a dependency. 
filterNonVulnerableA boolean controlling whether or not the Retire JS Analyzer should exclude non-vulnerable JS files from the report.false

Advanced Configuration

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

Note that any passwords in the below configuration could be exposed if you use -x option to debug the build. It is always better to configure the credential in your settings.xml and use the configuration to set the server id instead of placeing the password directly in the pom.xml.

PropertyDescriptionDefault Value
nvdApiServerIdThe id of a server defined in the settings.xml that configures the credentials (password is used as ApiKey) for accessing the NVD API; obtained from https://nvd.nist.gov/developers/request-an-api-key. 
nvdApiKeyIf you don't want register token as password in settings.xml, you can specify Bearer token for accessing the NVD API, but be aware that if you use -X the secret will be written to the standard out. 
nvdApiEndpointThe 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
nvdApiDelayThe number of milliseconds to wait between calls to the NVD API.3500 with an NVD API Key or 8000 without an API Key .
nvdApiResultsPerPageThe 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 - example value https://internal.server/cache/nvdcve-{0}.json.gz 
nvdDatafeedServerIdThe id of a server defined in the settings.xml that configures the credentials (username and password) for accessing the NVD API Data feed. 
nvdUserIf you don't want register user/password in settings.xml, you can specify Basic username for the NVD API Data feed. 
nvdPasswordIf you don't want register user/password in settings.xml, you can specify Basic password for the NVD API Data feed, but be aware that if you use -X the secret will be written to the standard out. 
nvdBearerTokenIf you don't want register token as password in settings.xml, you can specify Bearer token for the NVD API Data feed, but be aware that if you use -X the secret will be written to the standard out. 
nvdValidForHoursThe number of hours to wait before checking for new updates from the NVD.4
suppressionFileServerIdThe id of a server defined in the settings.xml that configures the credentials (username and password) for accessing the suppressionFiles. 
suppressionFileUserIf you don't want register user/password in settings.xml, you can specify Basic username. 
suppressionFilePasswordIf you don't want register user/password in settings.xml, you can specify Basic password, but be aware that if you use -X the secret will be written to the standard out. 
suppressionFileBearerTokenIf you don't want register token as password in settings.xml, you can specify Bearer token, but be aware that if you use -X the secret will be written to the standard out. 
connectionTimeoutSets the URL Connection Timeout (in milliseconds) used when downloading external data.10000
readTimeoutSets the URL Read Timeout (in milliseconds) used when downloading external data.60000
dataDirectorySets the data directory to hold SQL CVEs contents. This should generally not be changed.~/.m2/repository/org/owasp/dependency-check-data/
databaseDriverNameThe 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. 
databaseDriverPathThe path to the database driver JAR file; only needs to be set if the driver is not in the class path. 
connectionStringThe connection string used to connect to the database. See using a database server. 
serverIdThe id of a server defined in the settings.xml; this can be used to encrypt the database password. See password encryption for more information. 
databaseUserThe username used when connecting to the database. 
databasePasswordThe password used when connecting to the database. 
hostedSuppressionsEnabledWhether the hosted suppressions file will be used.true
hostedSuppressionsForceUpdateWhether the hosted suppressions file will update regardless of the autoupdate setting.false
hostedSuppressionsUrlThe URL to a mirrored copy of the hosted suppressions file for internet-constrained environments.https://dependency-check.github.io/DependencyCheck/suppressions/publishedSuppressions.xml
hostedSuppressionsValidForHoursSets the number of hours to wait before checking for new updates of the hosted suppressions file.2
hostedSuppressionsServerIdThe id of a server defined in the settings.xml that configures the credentials for accessing a mirrored hostedSuppressions XML file. 
hostedSuppressionsUserIf you don't want register user/password in settings.xml, you can specify Basic username. 
hostedSuppressionsPasswordIf you don't want register user/password in settings.xml, you can specify Basic password, but be aware that if you use -X the secret will be written to the standard out. 
hostedSuppressionsBearerTokenIf you don't want register token as password in settings.xml, you can specify Bearer token, but be aware that if you use -X the secret will be written to the standard out. 
retireJsUrlServerIdThe id of a server defined in the settings.xml to retrieve the credentials (Basic (username and password) or Bearer (password only)) to connect to RetireJS instance. 
retireJsUserIf you don't want register user/password in settings.xml, you can specify Basic username. 
retireJsPasswordIf you don't want register user/password in settings.xml, you can specify Basic password, but be aware that if you use -X the secret will be written to the standard out. 
retireJsBearerTokenIf you don't want register token as password in settings.xml, you can specify Bearer token, but be aware that if you use -X the secret will be written to the standard out. 
knownExploitedServerIdThe id of a server defined in the settings.xml that configures the credentials (Basic (username and password) or Bearer (password only)) for accessing the CISA Known Exploited Vulnerabilities JSON data feed. 
knownExploitedUserIf you don't want register user/password in settings.xml, you can specify Basic username. 
knownExploitedPasswordIf you don't want register user/password in settings.xml, you can specify Basic password, but be aware that if you use -X the secret will be written to the standard out. 
knownExploitedBearerTokenIf you don't want register token as password in settings.xml, you can specify Bearer token, but be aware that if you use -X the secret will be written to the standard out. 

Proxy Configuration

Use Maven's settings to configure a proxy server. Please see the dependency-check proxy configuration page for additional problem solving techniques. If multiple proxies are configured in the Maven settings file you must tell dependency-check which proxy to use with the following property:

PropertyDescriptionDefault Value
mavenSettingsProxyIdThe id for the proxy, configured via settings.xml, that dependency-check should use.