Skip to content

Black Duck SCA (Black Duck Hub) Executor

Category: Software Composition Analysis Script: blackduck_sca.py Integration: REST API Faraday Plugin: Raw JSON Website: https://www.blackduck.com/black-duck-hub.html

Description

Imports Software Composition Analysis (SCA) findings from a Black Duck Hub project version's Bill of Materials (BOM) into Faraday. Each vulnerable component becomes a vulnerability on a host that represents the project version.

Prerequisites

  • A Black Duck Hub instance with a scanned project version
  • A Black Duck API token with permission to read the project, its versions and its BOM

Configuration

Environment Variables (Setup)

Variable Required Description
BD_HOST Yes Base URL of your Black Duck Hub instance (e.g., https://blackduck.corp.example.com)
BD_TOKEN Yes Black Duck Hub API token

These variables are also accepted as execution arguments, so a single run can override them.

Execution Arguments

Parameter Type Mandatory Description
BD_PROJECT_ID string Yes Black Duck Hub project ID (UUID)
BD_VERSION_ID string Yes Project version ID (UUID). Black Duck stores findings per version, so this selects the specific build or release to import.
BD_MIN_SEVERITY string No Optional minimum severity floor (info | low | medium | high | critical). Filters out lower-severity vulnerable-BOM entries client-side after Faraday severity normalisation (handles Black Duck's CRITICAL/HIGH/MEDIUM/LOW enum, UNSPECIFIED/OK/NONE/UNKNOWN buckets, and CVSS base-score fallback). Defaults to info (no filtering).

YAML Configuration Example

executors:
  blackduck_sca:
    repo_executor: blackduck_sca.py
    max_size: 65536
    varenvs:
      BD_HOST: "https://blackduck.corp.example.com"
      BD_TOKEN: "<bd_token>"
    params:
      BD_PROJECT_ID:
        mandatory: true
        type: string
        base: string
      BD_VERSION_ID:
        mandatory: true
        type: string
        base: string
      BD_MIN_SEVERITY:
        mandatory: false
        type: string
        base: string

How It Works

  1. Exchanges BD_TOKEN for a short-lived bearer token with POST /api/tokens/authenticate
  2. Reads the project and version metadata (for the host description), the full component list, and the vulnerable BOM components from GET /api/projects/{id}/versions/{vid}/vulnerable-bom-components, 100 per page
  3. Maps each vulnerable component to a Faraday vulnerability:
    • Name: [SCA], the vulnerability name (CVE or BDSA ID) and the affected component@version
    • Severity: Black Duck's severity, or the CVSS score when the severity is missing
    • Status: PATCHED/REMEDIATION_COMPLETE/MITIGATED become closed, IGNORED/DUPLICATE/false-positive become risk-accepted, everything else is open
    • Details: component origin, license, publish/update dates, CWE and advisory references

Notes

  • The whole project version becomes one host with the synthetic IP 0.0.0.0 and the hostname <project>@<version>, because SCA findings belong to a BOM rather than an IP address.
  • One run imports a single project version. Run the executor again for other versions.
  • TLS certificates are not verified.
  • The run stops if the token exchange or a later request is rejected (HTTP 401).
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor. Use BD_MIN_SEVERITY to filter by severity.