This quickstart explains how to set up the Black Duck Security Scan Pipe to integrate with a Software Risk Manager project to run a full scan, triggered by push and merge events on specified branches.
Examples are provided for compiled and scripted languages with the option of exporting diagnostic logs as Bitbucket build artifacts.
Important: Please note that scanning Pull Requests, injecting review comments and creating SARIF reports is not currently supported for pipelines that integrate the Black Duck Security Scan Pipe with Software Risk Manager.
Prerequisites
The following reading is recommended before starting this quickstart:
- Access to a Software Risk Manager (SRM) server instance.
- A Software Risk Manager role that allows creation of authentication tokens.
- The following Black Duck Security Scan Pipe parameters are required to enable scanning of default and non-default branches. These have been included in the quickstart example:Important: Scanning will result in an error if these parameters and the required prerequisites are not correctly configured.
Parameter Description Example BRIDGE_SRM_URLSoftware Risk Manager server URL. $BRIDGE_SRM_URLBRIDGE_SRM_APIKEYSoftware Risk Manager API Key to enable integration with Software Risk Manager server. $BRIDGE_SRM_APIKEYBRIDGE_SRM_ASSESSMENT_TYPESScan assessment types, e.g. SASTand/orSCA.SAST,SCABRIDGE_SRM_BRANCH_NAMEBranch name on the SRM server. $BITBUCKET_BRANCHBRIDGE_SRM_BRANCH_PARENTParent branch name on the SRM server. Required for scanning new non default branches. $BRIDGE_SRM_BRANCH_PARENTNote: The Black Duck Security Scan Pipe integrates with Software Risk Manager via Bridge CLI. Additional scan configuration options not available through the template's parameter set can be specified by defining relevant Bridge CLI environment variables within the workflow job. - Add the following variables and secured variables at the repository level () or workspace level ():
Variable Type Description Example BRIDGE_SRM_URLVariable Software Risk Manager Server URL https://srm.blackduck.com$BRIDGE_SRM_APIKEYSecured Variable Software Risk Manager API Key REPLACE_WITH_YOUR_API_KEY - Software Risk Manager uses Coverity to perform SAST assessments. Coverity requires additional configuration for compiled languages. For languages that use a build system (such as C++, Java, etc.), Bridge must be configured with build and clean commands to capture and analyze the build.
- The instructions below use pipeline parameters to specify build and clean commands.
- See Using Bridge with compiled languages for an explanation of the various methods available for configuring Bridge to integrate with Coverity to capture and analyze the build for compiled languages.
Instructions
Follow the steps below to configure the Black Duck Security Scan Pipe to run a full scan:
Troubleshooting and support
If a pipeline error is encountered similar to the example below, then it is likely that the
BRIDGE_SRM_BRANCH_PARENT parameter has not been set.Important: ERROR: Branch "develop" does not exist for the project and "srm.branch.parent" is empty but is required along with "srm.branch.name" for creating the branch.
When scanning new non-default branches, e.g. develop, stage or release, the BRIDGE_SRM_BRANCH_PARENT parameter must be set to the name of the default branch, e.g. main. An example is shown in the Quickstart code example in the Instructions section.