Skip to content

OWASP Dependency-Check Executor

Category: Source Code Analysis Script: owasp_dep_check.py Integration: CLI Faraday Plugin: Raw JSON Website: https://owasp.org/www-project-dependency-check/

Description

Runs OWASP Dependency-Check on a source directory, artifact or Git repository and imports the known-vulnerable dependencies it finds into Faraday. The results appear as software composition analysis (SCA) vulnerabilities on a single host.

Prerequisites

  • OWASP Dependency-Check installed, with dependency-check.sh in the agent's PATH (checked with dependency-check.sh --version), or the DEPCHECK_BINARY variable pointing to it
  • git, if you scan a repository by URL
  • Read access to the code or artifacts, either as a local path or a Git repository
  • Network access for Dependency-Check to update its vulnerability data

Configuration

Environment Variables (Setup)

Variable Required Description
GIT_USERNAME No Username for cloning private repositories over HTTPS (default: oauth2)
GIT_TOKEN No Access token for cloning private repositories over HTTPS
DEPCHECK_BINARY No Command or path used to run Dependency-Check (default: dependency-check.sh)

Execution Arguments

Parameter Type Mandatory Description
DEPCHECK_TARGET string No* Path to scan. When DEPCHECK_GIT_URL is set, it is a subpath inside the cloned repository (e.g., services/api/).
DEPCHECK_SUPPRESSION_FILE string No Path to a Dependency-Check suppressions.xml file, used to silence known false positives
DEPCHECK_GIT_URL string No* Git repository to clone and scan
DEPCHECK_GIT_REF string No Branch or tag to clone (default: the repository's default branch)
DEPCHECK_MIN_SEVERITY string No Minimum severity to import: info, low, medium, high or critical (default: info)

* You must set DEPCHECK_TARGET, DEPCHECK_GIT_URL, or both.

YAML Configuration Example

executors:
  owasp_dep_check:
    repo_executor: owasp_dep_check.py
    max_size: 65536
    varenvs:
      GIT_USERNAME: "<git_username>"
      GIT_TOKEN: "<git_token>"
      DEPCHECK_BINARY: "/opt/dependency-check/bin/dependency-check.sh"
    params:
      DEPCHECK_TARGET:
        mandatory: false
        type: string
        base: string
      DEPCHECK_SUPPRESSION_FILE:
        mandatory: false
        type: string
        base: string
      DEPCHECK_GIT_URL:
        mandatory: false
        type: string
        base: string
      DEPCHECK_GIT_REF:
        mandatory: false
        type: string
        base: string
      DEPCHECK_MIN_SEVERITY:
        mandatory: false
        type: string
        base: string

How It Works

  1. If DEPCHECK_GIT_URL is set, makes a shallow clone of the repository (at DEPCHECK_GIT_REF, if given) into a temporary directory. For HTTPS URLs it authenticates with GIT_USERNAME/GIT_TOKEN.
  2. Runs dependency-check.sh --scan <target> --format JSON, adding --suppression when a suppression file is set
  3. Reads the JSON report and creates one vulnerability per dependency and vulnerability pair, named [SCA] <CVE> in <dependency>
  4. Maps severity from Dependency-Check's rating, or from the CVSS score when the rating is missing, and drops findings below DEPCHECK_MIN_SEVERITY
  5. Sends the result to Faraday and deletes the temporary report and clone

Notes

  • The executor creates a single host per run. Its IP is 0.0.0.0 and its hostname is the project name from the report, or the name of the scanned folder, because dependency findings belong to code rather than IP addresses.
  • Vulnerabilities are always created as open. References include CWE IDs, advisory links and the dependency's package URL, and CVE IDs are filled in when the advisory is a CVE.
  • DEPCHECK_TARGET must point inside the cloned repository. Paths that escape it (e.g., ../) are rejected.
  • The scan is stopped after one hour.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor. Use DEPCHECK_MIN_SEVERITY to filter by severity.