As an alternative to the Black Duck Security Scan Pipe, the Bridge CLI can be downloaded and directly executed in a Bitbucket pipeline. It has equivalent functionality, but includes an additional step to download the Bridge CLI from blackduck-repo.
To discover more about the Black Duck Security Scan Pipe and what it can do, take a look at the overview page.
Prerequisites
-
The following reading is recommended before starting this quickstart:
- A Bitbucket Access Token is required to allow the pipeline to inject Pull Request review comments.
- For security reasons, it is advisable to use Bitbucket variables with the
securedoption checked to store credentials and access tokens. - Add the following variables and secured variables at the repository level ( or ):
Variable Type Description Example BRIDGE_BITBUCKET_API_TOKENSecured Variable Bitbucket Access Token YOUR_ACCESS_TOKENBRIDGE_POLARIS_SERVERURLVariable Polaris Server URL https://poc.polaris.blackduck.com BRIDGE_POLARIS_ACCESSTOKENSecured Variable Polaris Access Token. Use either a user access token (created in the Polaris UI) or a service account token here. YOUR_TOKENBRIDGECLI_LINUX64Variable Bridge CLI Download URL https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge/binaries/bridge-cli-bundle/latest/bridge-cli-bundle-linux64.zip - The following Bridge CLI parameters are required to inject Pull Request comments:
Parameter Description Value polaris.prComment.enabledEnable PR comments truebitbucket.project.repository.pull.numberID of PR with source code to scan $BITBUCKET_PR_ID -
Polaris 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.), Coverity must be configured with build and clean commands to capture and analyze the build. If using a compiled language, add the following additional variables to specify the build and clean commands appropriate for the target language:
Variable Type Description Example BRIDGE_COVERITY_BUILD_COMMANDVariable Build command for compiled languages mvn -B -DskipTests packageBRIDGE_COVERITY_CLEAN_COMMANDVariable Clean command for compiled languages mvn -B cleanSee Using Bridge With Compiled Languages and the Coverity section in Client Scan Tools for an overview of the various alternative methods available for configuring Bridge CLI to integrate with Coverity to capture and analyze the build for compiled languages.
Instructions
Troubleshooting and support
Automatic application creation will fail for users with a parallel subscription. To create the application manually before running the pipeline, consult Create An Application in Polaris.