As an alternative to the Black Duck Security Scan Template, the Bridge CLI can be downloaded and directly executed in a GitLab pipeline. This guide provides a ready-to-use pipeline and step-by-step instructions for integrating SRM scanning into your build process.
To discover more about the Black Duck Security Scan Template and what it can do, take a look at the overview page.
Prerequisites
- The following reading is recommended before starting this quickstart:
- For security reasons, it is advisable to use GitLab CI/CD variables to store credentials and access tokens.
- Add the following variables and secrets in your GitLab project or group settings:
Variable Type Description Example SRM_URLProject Variable SRM server URL https://srm.example.comSRM_APIKEYProject Variable (masked / secret) SRM API key YOUR_APIKEYBRIDGECLI_LINUX64Project Variable Bridge CLI download URL for Linux https://repo.blackduck.com/artifactory/bds-integrations-release/com/blackduck/integration/bridge/binaries/bridge-cli-bundle/latest/bridge-cli-bundle-linux64.zip
- The instructions below use the Bridge
COVERITY_BUILD_COMMANDandCOVERITY_CLEAN_COMMANDenvironment variables to specify the build and clean commands. - See Using Bridge with compiled languages and the Coverity section in Client scan tool parameters for an overview of the various methods available for configuring Bridge CLI to integrate with Coverity to capture and analyze the build for compiled languages.
Instructions
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.
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.
For further troubleshooting, enable optional log archiving by uncommenting the bridge-logs artifacts section in the YAML file.