To integrate a Black Duck Security Scan Extension pipeline with Black Duck® SCA a full scan should be run followed by Pull Request scans. A Pull Request scan discovers new issues on the feature branch which are not on the target branch.
A full scan is triggered by push and merge events on specified branches. Conversely, a Pull Request scan is triggered by push events to Pull Requests that target those branches. New security issues introduced by a Pull Request are added as review comments. After a scan completes, appropriate security reports and diagnostic logs can be exported as build artifacts.
For further details follow the interactive tutorial for integrating Black Duck® SCA with Black Duck Security Scan Extension.
Prerequisites
-
The following reading is recommended before starting this quickstart:
- 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.
- Install the Black Duck Security Scan Extension into the ADO organization.
- An Azure Access Token with sufficient privileges for contributing to Pull Requests to allow the pipeline to inject Pull Request review comments, create Fix Pull Requests and upload SARIF reports.
- For security reasons, it is advisable not to store credentials directly in the pipeline. The recommended approach is to use secured variables.
- The following Black Duck Security Scan Extension parameters are required to enable injecting review comments into Pull Requests and have been included in the quickstart example:Important: Pull Request comments will not be injected if these parameters and the prerequisites are not configured.
Parameter Description Example blackducksca_prcomment_enabledWhen true, this enables Pull Request comments."true"azure_tokenAn Azure access token required to inject review comments. $(System.AccessToken)Note: The Black Duck Security Scan Template integrates with Black Duck® SCA 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 pipeline job. -
Add the following secrets and variables ():
Variable Type Description Example BLACKDUCKSCA_URLVariable Black Duck SCA Server URL https://server.blackduck.com BLACKDUCKSCA_TOKENSecret Black Duck SCA API Token REPLACE_WITH_YOUR_TOKEN