Skip to content

Coverity Connect Executor

Category: Source Code Analysis Script: coverity.py Integration: REST API (SOAP fallback) Faraday Plugin: Raw JSON Website: https://www.blackduck.com/coverity.html

Description

Imports static analysis defects from a Coverity Connect server into Faraday. Each Coverity project becomes a host and each defect (CID) becomes a vulnerability.

Prerequisites

  • A Coverity Connect server (REST API from version 2020.06, older versions through the SOAP fallback)
  • A Coverity Connect user (username and password) with permission to view the projects and defects to import

Configuration

Environment Variables (Setup)

Variable Required Description
COVERITY_HOST Yes Base URL of Coverity Connect (e.g., https://cov.corp.example.com:8443). https:// is added if you enter a bare hostname.
COVERITY_USER Yes Coverity Connect username
COVERITY_PASSWORD Yes Coverity Connect password

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

Execution Arguments

Parameter Type Mandatory Description
COVERITY_PROJECT string No Name of a single project to import. Leave blank to import all visible projects. With the SOAP fallback, COVERITY_PROJECT or COVERITY_STREAM is needed.
COVERITY_STREAM string No Only import defects of this stream
COVERITY_MIN_SEVERITY string No Minimum severity to import: info, low, medium, high or critical (default: info). Coverity reports its impact as high, medium or low. Unrecognized values fall back to info.

YAML Configuration Example

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

How It Works

  1. Authenticates every request with HTTP Basic using COVERITY_USER and COVERITY_PASSWORD
  2. Lists projects with GET /api/v2/projects (or reads the one in COVERITY_PROJECT)
  3. For each project, reads its defects with GET /api/v2/issues (filtered by stream and impact if set) and fetches the details of each one with GET /api/v2/issues/{cid}
  4. If the projects endpoint returns 404, switches to the SOAP defectservice (/ws/v9/defectservice) used by Coverity Connect 9.x
  5. Creates one vulnerability per defect. Severity comes from Coverity's impact, and classifications such as False Positive or Intentional become risk-accepted, while Fixed and Dismissed defects are closed.

Notes

  • Each project is a host with IP 0.0.0.0 and the project name as hostname, because source code defects do not belong to network addresses.
  • Projects without defects at or above COVERITY_MIN_SEVERITY are skipped.
  • TLS certificate verification is disabled for the API calls.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor. Use COVERITY_MIN_SEVERITY to filter by severity.