Skip to content

Black Duck Coverity (Coverity Connect, stream-scoped) Executor

Category: Software Composition Analysis Script: blackduck_coverity.py Integration: REST API Faraday Plugin: Raw JSON Website: https://www.blackduck.com/coverity.html

Description

Imports static analysis defects from a Black Duck Coverity Connect stream into Faraday. Each merged defect (CID) becomes a vulnerability on a host that represents the stream.

Prerequisites

  • A Black Duck Coverity Connect instance with a stream that has been analyzed
  • A Coverity Connect user with permission to read the stream's issues

Configuration

Environment Variables (Setup)

Variable Required Description
COVERITY_HOST Yes Base URL of your Coverity Connect instance (e.g., https://cov.corp.example.com)
COVERITY_USER Yes Coverity Connect username
COVERITY_PASSWORD Yes Password for COVERITY_USER

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

Execution Arguments

Parameter Type Mandatory Description
COVERITY_STREAM string Yes Coverity Connect stream name (one stream per build configuration, branch or pipeline)
COVERITY_CHECKER string No Comma-separated Coverity checker names to import (e.g., NULL_RETURNS,SIGN_EXTENSION,RESOURCE_LEAK, case-sensitive). Default: every checker in the stream.

YAML Configuration Example

executors:
  blackduck_coverity:
    repo_executor: blackduck_coverity.py
    max_size: 65536
    varenvs:
      COVERITY_HOST: "https://cov.corp.example.com"
      COVERITY_USER: "<coverity_user>"
      COVERITY_PASSWORD: "<coverity_password>"
    params:
      COVERITY_STREAM:
        mandatory: true
        type: string
        base: string
      COVERITY_CHECKER:
        mandatory: false
        type: string
        base: string

How It Works

  1. Authenticates every request with HTTP Basic (COVERITY_USER / COVERITY_PASSWORD)
  2. Resolves the stream metadata from GET /api/v2/streams?name=<COVERITY_STREAM> (used only for the host description)
  3. Lists the merged defects (CIDs) from GET /api/v2/issues, 100 per page, filtered by COVERITY_STREAM and COVERITY_CHECKER when set
  4. For each defect, reads GET /api/v2/issues/{cid} for the full event trail and remediation text, unless the list response already had them
  5. Maps each defect to a Faraday vulnerability:
    • Name: [SAST], the checker name and the sub-category
    • Severity: Coverity's impact (High/Medium/Low/Audit), or a CVSS score when present
    • Status: Fixed/Resolved/Dismissed become closed, an analyst classification of False Positive/Intentional or an Ignore action becomes risk-accepted, everything else is open
    • Details: file and line, function, merge key, CID, occurrence count and the event trail

Notes

  • The whole stream becomes one host with the synthetic IP 0.0.0.0 and the stream name as hostname, because SAST findings belong to source code rather than IP addresses.
  • One run imports a single stream. Run the executor again for other streams.
  • TLS certificates are not verified.
  • The run stops if the credentials are rejected (HTTP 401).
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor.