As an alternative to the Black Duck Security Scan Extension for Azure DevOps, the Bridge CLI can be downloaded and directly executed in an Azure DevOps pipeline. It has all the functionality of the extension, but requires an additional step to download the Bridge CLI.
To use the CLI directly from a pipeline, the correct Bridge CLI Black Duck® SCA parameters must be passed directly inside the pipeline. Furthermore, appropriate access credentials are required to download and use it. Consult the overview page for further details and instructions on use.
Note: The Black Duck Security Scan Extension for Azure DevOps (recommended) can be used for pipelines instead of Bridge CLI by following the quickstart guide. The extension has equivalent functionality and handles the Bridge CLI download and execution automatically.
To discover more about the Black Duck Security Scan Extension and what it can do, take a look at the overview page.
Prerequisites
-
The following reading is recommended before starting this quickstart:
- Admin access to an Azure DevOps project.
- Access to a Black Duck SCA server configured with:
- A Black Duck SCA role that allows creation of authentication tokens.
- A Black Duck SCA API token with Read and Write access. This can be created by navigating to from within Black Duck SCA.
- The built-in Azure DevOps System Access Token is required to allow the pipeline to inject Pull Request review comments. Ensure that Contribute to pull requests , Create branch and Delete or disable repository are set to Allow for the build service user in .
- For security reasons, it is advisable to use Azure DevOps secret variables to store credentials and access tokens. Secret variables can be defined locally within a pipeline or shared between pipelines using a variable group.
- Add the following variables and secrets to a variable group () or directly within a pipeline ():
Variable Type Description Example BLACKDUCK_URLVariable Black Duck SCA Server URL https://blackduck.example.comBLACKDUCK_API_TOKENSecret Black Duck SCA API Token REPLACE_WITH_YOUR_TOKENBRIDGECLI_LINUX64Variable Bridge CLI 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 environment variables are used directly within the pipeline to inject Pull Request comments and raise fix Pull Requests:
Parameter Description Value Scan type BRIDGE_BLACKDUCKSCA_FIXPR_ENABLEDRaise Fix PRs for detected issues trueFull BRIDGE_BLACKDUCKSCA_AUTOMATION_PRCOMMENTEnable PR comments truePR BRIDGE_AZURE_REPOSITORY_PULL_NUMBERID of PR with source code to scan $(System.PullRequest.PullRequestId)