As an alternative to the Black Duck Security Scan Action, the Bridge CLI can be downloaded and directly executed in a GitHub Actions workflow. It has all the functionality of the action, 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 workflow. 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 Action (recommended) can be used for workflows instead of Bridge CLI by following the quickstart guide. The plugin has equivalent functionality and handles the Bridge CLI download and execution automatically.
To discover more about the GitHub Action 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 a GitHub repository.
- 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.
- A GitHub Personal Access Token. The default
secrets.GITHUB_TOKENis recommended to allow the pipeline to inject Pull Request review comments and raise fix Pull Requests. - For security reasons, it is advisable to use GitHub Secrets and Variables to store credentials and access tokens.
- Add the following variables and secrets at the repository or organization level ()
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 parameters are required to inject Pull Request comments and raise fix Pull Requests:
Parameter Description Value Scan type blackducksca.fixpr.enabledRaise Fix PRs trueFull blackducksca.automation.prcommentEnable PR comments truePR github.repository.pull.numberID of PR to scan ${{ github.event.number }} - Use the optional environment variables below to configure Bridge to report external repository issues. The environment variables can be uncommented in the workflow file example below.
Environment variable Description Example BRIDGE_BLACKDUCKSCA_EXTERNALISSUES_CREATEEnable or disable creation of external issues in GitHub from scan findings. Set to trueto enable. For more information, see External issues.trueorfalseBRIDGE_BLACKDUCKSCA_EXTERNALISSUES_SEVERITIESComma-separated list of severities for which external issues should be created. Default: Critical, HighCritical, High, Medium,LowBRIDGE_BLACKDUCKSCA_EXTERNALISSUES_MAXCOUNTSet the maximum number number of issues that can be created. Default: 1020BRIDGE_BLACKDUCKSCA_EXTERNALISSUES_GROUPSCAISSUESSet to trueto group SCA issues by vulnerabilities of a component-version pair when creating repository issues. Set tofalseto create separate issues for each vulnerability. Default:true.true