Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

OWASP dependency-check is a software composition analysis utility that detects publicly disclosed vulnerabilities in application dependencies.

License

NotificationsYou must be signed in to change notification settings

dependency-check/DependencyCheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven CentralBuild and Deploy SnapshotCoverity Scan Build StatusCodacy BadgeCII Best PracticesApache 2.0 License

Black Hat ArsenalBlack Hat ArsenalBlack Hat ArsenalBlack Hat Arsenal

Dependency-Check

Dependency-Check is a Software Composition Analysis (SCA) tool that attempts to detect publicly disclosed vulnerabilities contained within a project's dependencies. It does this by determining if there is a Common Platform Enumeration (CPE) identifier for a given dependency. If found, it will generate a report linking to the associated CVE entries.

Documentation and links to production binary releases can be found on thegithub pages. Additionally, more information about the architecture and ways to extend dependency-check can be found on thewiki.

Notice

This product uses the NVD API but is not endorsed or certified by the NVD.

Breaking Changes in 11.0.0

  • Java 11 is now required to run dependency-check 11.0.0 or higher

  • H2 database upgrade

    11.0.0 contains breaking changes using the local H2 database. A full downloadof the NVD data will occur. Note that if you are using a shared data directorythe h2 database file is not compatible with older versions of dependency-check.If you run into problems you may need to run a purge:

    • gradle:./gradlew dependencyCheckPurge
    • maven:mvn org.owasp:dependency-check-maven:9.0.0:purge
    • cli:dependency-check.sh --purge

Mandatory Upgrade Notice

Upgrading to 10.0.2 or later is mandatory

Older versions of dependency-check are causing numerous, duplicative requests thatend in processing failures are causing unnecassary load on the NVD API. Dependency-check10.0.2 uses an updatedUser-Agent header that will allow the NVD to block callsfrom the older client.

NVD API Key Highly Recommended

Dependency-check has moved from using the NVD data-feed to the NVD API.Users of dependency-check arehighly encouraged to obtain an NVD API Key; seehttps://nvd.nist.gov/developers/request-an-api-keyWithout an NVD API Key dependency-check's updates will beextremely slow.Please see the documentation for the cli, maven, gradle, or ant integrations onhow to set the NVD API key.

The NVD API Key, CI, and Rate Limiting

The NVD API has enforced rate limits. If you are using a single API KEY andmultiple builds occur you could hit the rate limit and receive 403 errors. Ina CI environment one must use a caching strategy.

Gradle build Environment

With 9.0.0 users may encounter issues withNoSuchMethodError exceptions due todependency resolution. If you encounter this issue you will need to pin some ofthe transitive dependencies of dependency-check to specific versions. For example:

/buildSrc/build.gradle

dependencies {    constraints {// org.owasp.dependencycheck needs at least this version of jackson. Other plugins pull in older versions..        add("implementation","com.fasterxml.jackson:jackson-bom:2.16.1")// org.owasp.dependencycheck needs these versions. Other plugins pull in older versions..        add("implementation","org.apache.commons:commons-lang3:3.14.0")        add("implementation","org.apache.commons:commons-text:1.11.0")    }}

Requirements

Java Version

Minimum Java Version: Java 11

Internet Access

OWASP dependency-check requires access to several externally hosted resources.For more information seeInternet Access Required.

Build Tools

In order to analyze some technology stacks dependency-check may require otherdevelopment tools to be installed. Some of the analysis listed below may beexperimental and require the experimental analyzers to be enabled.

  1. To analyze .NET Assemblies the dotnet 8 run time or SDK must be installed.
    • Assemblies targeting other run times can be analyzed - but 8 is required to run the analysis.
  2. If analyzing GoLang projectsgo must be installed.
  3. The analysis ofElixir projects requiresmix_audit.
  4. The analysis ofnpm,pnpm, andyarn projects requiresnpm,pnpm, oryarn to be installed.
    • The analysis performed utilize the respectiveaudit feature of each.
  5. The analysis of Ruby is a wrapper aroundbundle-audit, which must be installed.

Current Releases

Jenkins Plugin

For instructions on the use of the Jenkins plugin please see theOWASP Dependency-Check Plugin page.

Command Line

More detailed instructions can be found on thedependency-check github pages.The latest CLI can be downloaded from github in thereleases section.

Downloading the latest release:

$ VERSION=$(curl -s https://dependency-check.github.io/DependencyCheck/current.txt)$ curl -Ls "https://github.com/dependency-check/DependencyCheck/releases/download/v$VERSION/dependency-check-$VERSION-release.zip" --output dependency-check.zip

On *nix

$ ./bin/dependency-check.sh -h$ ./bin/dependency-check.sh --out . --scan [path to jar files to be scanned]

On Windows

> .\bin\dependency-check.bat -h> .\bin\dependency-check.bat --out . --scan [path to jar files to be scanned]

On Mac withHomebrewNote - homebrew users upgrading from 5.x to 6.0.0 will need to rundependency-check.sh --purge.

$ brew update && brew install dependency-check$ dependency-check -h$ dependency-check --out . --scan [path to jar files to be scanned]

Maven Plugin

More detailed instructions can be found on thedependency-check-maven github pages.By default, the plugin is tied to theverify phase (i.e.mvn verify). Alternatively,one can directly invoke the plugin viamvn org.owasp:dependency-check-maven:check.

The dependency-check plugin can be configured using the following:

<project>    <build>        <plugins>            ...            <plugin>              <groupId>org.owasp</groupId>              <artifactId>dependency-check-maven</artifactId>              <executions>                  <execution>                      <goals>                          <goal>check</goal>                      </goals>                  </execution>              </executions>            </plugin>            ...        </plugins>        ...    </build>    ...</project>

Gradle Plugin

For instructions on the use of the Gradle Plugin, please see thedependency-check-gradle github page.

Ant Task

For instructions on the use of the Ant Task, please see thedependency-check-ant github page.

Development Prerequisites

For installation to pass, you must have the following components installed:

  • Java:java -version 11.0
  • Maven:mvn -version 3.6.3 and higher

Tests cases require:

Development Usage

The following instructions outline how to compile and use the current snapshot. While every intention is to maintain a stable snapshot it is recommendedthat the release versions listed above be used.

The repository has some large files due to test resources. The team has tried to clean up the history as much as possible.However, it is recommended that you perform a shallow clone to save yourself time:

git clone --depth 1 https://github.com/dependency-check/DependencyCheck.git

On *nix

$ mvn -s settings.xml install$ ./cli/target/release/bin/dependency-check.sh -h$ ./cli/target/release/bin/dependency-check.sh --out . --scan ./src/test/resources

On Windows

> mvn -s settings.xml install> .\cli\target\release\bin\dependency-check.bat -h> .\cli\target\release\bin\dependency-check.bat --out . --scan ./src/test/resources

Then load the resulting 'dependency-check-report.html' into your favorite browser.

Building without running tests

To speed up your turnaround cycle times, you can also compile without running the tests each time:
mvn -s settings.xml install -DskipTests=true

Please remember to at least run the tests once before opening the PR. :)

IntelliJ Idea

To be able to debug your tests in IntelliJ Idea, you can introduce a maven configuration that executes your test and enables debugging with breakpoints etc.
Basically, you do what´s described inhttps://www.jetbrains.com/help/idea/work-with-tests-in-maven.html#run_single_test and set theforkCount to 0, otherwise debugging won´t work.

Step by step:

  • Run -> Edit Configurations
  • + (Add new configuration) -> Maven
  • Give the Configuration a name, e.g.Run tests
  • Choose working directory, e.g.core
  • Incommand line, enter-DforkCount=0 -f pom.xml -s ../settings.xml test
  • PressOK
  • Run -> Debug, then choose the newly created run configuration

IntelliJ will now execute the test run for thecore subproject with enabled debugging. Breakpoints set anywhere in code should work.

Only test one function or one class

If you would like to speed up your turnaround cycle times, you can also just test one function or one test class.
This works by adding-Dtest=MyTestClass or-Dtest=MyTestClass#myTestFunction to the run configuration. The complete command line in the run configuration then would be:

-Dtest=MyTestClass#myTestFunction -DforkCount=0 -f pom.xml -s ../settings.xml test

Docker

In the following example it is assumed that the source to be checked is in the current working directory and the reports will be written to$(pwd)/odc-reports. Persistent data and cache directories are used, allowing you to destroy the container after running.

For Linux:

#!/bin/shDC_VERSION="latest"DC_DIRECTORY=$HOME/OWASP-Dependency-CheckDC_PROJECT="dependency-check scan:$(pwd)"DATA_DIRECTORY="$DC_DIRECTORY/data"CACHE_DIRECTORY="$DC_DIRECTORY/data/cache"if [!-d"$DATA_DIRECTORY" ];thenecho"Initially creating persistent directory:$DATA_DIRECTORY"    mkdir -p"$DATA_DIRECTORY"fiif [!-d"$CACHE_DIRECTORY" ];thenecho"Initially creating persistent directory:$CACHE_DIRECTORY"    mkdir -p"$CACHE_DIRECTORY"fi# Make sure we are using the latest versiondocker pull owasp/dependency-check:$DC_VERSIONdocker run --rm \    -e user=$USER \    -u$(id -u${USER}):$(id -g${USER}) \    --volume$(pwd):/src:z \    --volume"$DATA_DIRECTORY":/usr/share/dependency-check/data:z \    --volume$(pwd)/odc-reports:/report:z \    owasp/dependency-check:$DC_VERSION \    --scan /src \    --format"ALL" \    --project"$DC_PROJECT" \    --out /report# Use suppression like this: (where /src == $pwd)# --suppression "/src/security/dependency-check-suppression.xml"

For Windows:

@echooffsetDC_VERSION="latest"setDC_DIRECTORY=%USERPROFILE%\OWASP-Dependency-CheckSETDC_PROJECT="dependency-check scan:%CD%"setDATA_DIRECTORY="%DC_DIRECTORY%\data"setCACHE_DIRECTORY="%DC_DIRECTORY%\data\cache"IFNOTEXIST%DATA_DIRECTORY% (echo Initially creating persistent directory:%DATA_DIRECTORY%mkdir%DATA_DIRECTORY%)IFNOTEXIST%CACHE_DIRECTORY% (echo Initially creating persistent directory:%CACHE_DIRECTORY%mkdir%CACHE_DIRECTORY%)rem Make sure we are using the latest versiondocker pull owasp/dependency-check:%DC_VERSION%docker run --rm^    --volume%CD%:/src^    --volume%DATA_DIRECTORY%:/usr/share/dependency-check/data^    --volume%CD%/odc-reports:/report^    owasp/dependency-check:%DC_VERSION%^    --scan /src^    --format"ALL"^    --project"%DC_PROJECT%"^    --out /reportrem Use suppression like this: (where /src == %CD%)rem --suppression "/src/security/dependency-check-suppression.xml"

Building From Source

To build dependency-check (using Java 11) run the command:

mvn -s settings.xml install

Running dependency-check on dependency-check

Dependency-check references several vulnerable dependencies that are never usedexcept as test resources. All of these optional test dependencies are included inthetest-dependencies profile. To run dependency-check against itself simpleexclude thetest-dependencies profile:

mvn org.owasp:dependency-check-maven:aggregate -P-test-dependencies -DskipProvidedScope=true

Building the documentation

The documentation on thegithub pages is generated from this repository:

mvn -s settings.xml site site:stage

Once done, point your browser to./target/staging/index.html.

Building The Docker Image

To build dependency-check docker image run the command:

mvn -s settings.xml install./build-docker.sh

License

Permission to modify and redistribute is granted under the terms of the Apache 2.0 license. See theLICENSE.txt file for the full license.

Dependency-Check makes use of several other open source libraries. Please see theNOTICE.txt file for more information.

This product uses the NVD API but is not endorsed or certified by the NVD.

Copyright (c) 2012-2025 Jeremy Long. All Rights Reserved.

About

OWASP dependency-check is a software composition analysis utility that detects publicly disclosed vulnerabilities in application dependencies.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors304


[8]ページ先頭

©2009-2025 Movatter.jp