This quickstart explains how to set up the Black Duck Security Scan Pipe for Bitbucket to run a pipeline that integrates with Coverity to run a full scan and Pull Request scan. Pull Request review comments are only created for new issues created that are detected on the feature branch but not the target branch.
The full scan will be triggered by push and merge events on specified branches. Conversely, the Pull Request scan will be triggered by push events to Pull Requests that target those branches. Any new security issues introduced by a Pull Request will be added as review comments. After the scan completes, appropriate security reports and diagnostic logs will be exported as build artifacts.
Prerequisites
- The following reading is recommended before starting this quickstart:
- Coverity credentials.
- A Bitbucket Access Token is required to allow the pipeline to inject Pull Request review comments.
- For security reasons, it is advisable not to store credentials and access tokens directly in the pipeline. The recommended approach is to use Bitbucket variables with the
securedoption checked. - The following Black Duck Security Scan Pipe parameters are required to enable injecting review comments into Pull Requests. These have been included in the quickstart example:Important: Pull Request comments will not be injected if these parameters and the required prerequisites are not correctly configured.
Parameter Description Example BRIDGE_COVERITY_CONNECT_URLURL for Coverity Server $COVERITY_URLBRIDGE_COVERITY_CONNECT_USER_NAMECoverity Connect user name $COVERITY_USERBRIDGE_COVERITY_CONNECT_USER_PASSWORDCoverity Connect user password COVERITY_PASSPHRASEBRIDGE_COVERITY_PRCOMMENT_ENABLEDWhen true, this enables PR comments."true"BRIDGE_BITBUCKET_API_TOKENA Bitbucket Access Token. Required to inject review comments and upload SARIF reports. $BITBUCKET_REPO_ACCESS_TOKEN - Add the following variables and secured variables at the repository level () or workspace level ():
Variable Type Description Example COVERITY_URLVariable Coverity Server URL https://coverity.blackduck.comCOVERITY_USERSecured Variable Coverity Username USER_NAMECOVERITY_PASSPHRASESecured Variable Coverity Passphrase PASSPHRASEBITBUCKET_REPO_ACCESS_TOKENSecured Variable A Bitbucket Access Token. Required to inject Pull Request comments. REPLACE_WITH_BITBUCKET_ACCESS_TOKENNote: The Black Duck Security Scan Pipe integrates with Coverity via Bridge CLI. Additional scan configuration options not available through the pipe parameter set can be specified by defining relevant Bridge CLI environment variables within the workflow job.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
Troubleshooting and support
BRIDGE_COVERITY_LOCAL parameter should be uncommented in the quickstart code example.BRIDGE_COVERITY_LOCAL parameter to true enables the full analysis at the client. Subsequently, the scan and analysis will be performed locally by the workflow. For further details relating to the different Coverity deployment models supported, please refer to Coverity Deployment Architecture.