Skip to main content

Shim to easily install OWASP dependency-check-cli into Python projects

Project description

Overview

dependency-check scans application dependencies and checks whether they contain any published vulnerabilities (based on the NIST NVD). It runs in the JVM, so you need some form of java available in your PATH. The script should work on Linux, Mac OSX and Windows, but right now is only tested on Linux.

Usage

After installation, you’ll have the dependency-check command available that, on first use, will automatically download and install the OWASP release archive once for all projects. It’ll then redirect any calls to that installation, meaning the downloaded NVD data is shared amongst projects.

dependency-check --disableAssembly -s . -o build --project "$(python ./setup.py --name)" \
    && xdg-open build/dependency-check-report.html

Please see the DependencyCheck site for more configuration and usage details.

To install from PyPI, add dependency-check to your dev-requirements.txt or a similar file. For more installation options, see the next section.

To just get the dependency-check CLI tool installed into your home, independent of any project, you can use the pip script installer or pip install --user dependency-check.

Installation Demo

Customization

Using environment variables, you can change the version and download location of the release archive, and the directory for the local installation.

Variable

Default

DEPENDENCY_CHECK_VERSION

5.2.4

DEPENDENCY_CHECK_URL

https://bintray.com/artifact/download/jeremy-long/owasp/dependency-check-{version}-release.zip

DEPENDENCY_CHECK_HOME

~/.local/dependency-check

DEPENDENCY_CHECK_NVD_URL

Use NIST NVD URLs

To update to a new version of the OWASP software, delete ~/.local/dependency-check/bin/, set DEPENDENCY_CHECK_VERSION to the new version number, and call dependency-check.

The variable DEPENDENCY_CHECK_NVD_URL can be used to point to a local copy of the various NVD feeds, in a flat hierarchy with compressed JSON files.

export DEPENDENCY_CHECK_NVD_URL='https://repo.local/nvd/nvdcve-1.0-%d.json.gz

If you set this, the options --cveUrlBase and --cveUrlModified will be added to each call. Note that the %d representing the year is replaced by modified for the latter.

Remove the ~/.local/dependency-check/data/ directory to force a full data reload.

Installation

dependency-check can be installed via pip install dependency-check as usual, see releases for an overview of available versions. To get a bleeding-edge version from source, use these commands:

repo="jhermann/dependency-check-py"
pip install -r "https://raw.githubusercontent.com/$repo/master/requirements.txt"
pip install -U -e "git+https://github.com/$repo.git#egg=dependency-check"

As a developer, to create a working directory for this project, call these commands:

git clone "https://github.com/jhermann/dependency-check-py.git"
cd "dependency-check-py"
. .env --yes --develop
invoke build check

You might also need to follow some setup procedures to make the necessary basic commands available on Linux, Mac OS X, and Windows.

Other Python Security Tools

  • openstack/bandit – Security linter designed to find common security issues in Python code, by static AST analysis.

  • pyupio/safety – Safety checks your installed dependencies for known security vulnerabilities.

    • pyupio/safety-db – A curated database of security vulnerabilities in Python packages.

  • eliasgranderubio/dagda – Static analysis of known vulnerabilities, trojans, viruses, malware & other malicious threats in Docker images, and runtime monitoring of containers for anomalous activities.

  • anchore/anchore-engine – A service for inspection, analysis and certification of container images, provided as a ready-to-deploy Docker container image.

  • vintasoftware/python-linters-and-code-analysis – Curated list of Python linters and code analysis tools.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dependency-check-0.5.0.zip (137.3 kB view details)

Uploaded Source

Built Distribution

dependency_check-0.5.0-py2.py3-none-any.whl (10.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dependency-check-0.5.0.zip.

File metadata

  • Download URL: dependency-check-0.5.0.zip
  • Upload date:
  • Size: 137.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.5.2

File hashes

Hashes for dependency-check-0.5.0.zip
Algorithm Hash digest
SHA256 e77d834a8eeb2ce8e6660571e918b9de102e23fcc20ff1a2d34ef37d5bd5d879
MD5 a6134e0cfdf125551628bd9c3ce1b22b
BLAKE2b-256 0cb69a1b7c93588044fd4884ade97189d69755dac6e959b6da6366fe3c489435

See more details on using hashes here.

File details

Details for the file dependency_check-0.5.0-py2.py3-none-any.whl.

File metadata

  • Download URL: dependency_check-0.5.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.5.2

File hashes

Hashes for dependency_check-0.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 94dba80b9c39502e9b33f931ffd5cbc183100f10182fa220ce824ffccbed57b3
MD5 8b132b314fb4785f15adb06a96b066cb
BLAKE2b-256 d13b0833c3232ff998aa8982e05e48630ac1c97b94b13c1c491d10cd5eafea1b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page