Black Duck Security Scan Plugin for Jenkins supports the following job types:
- Multibranch pipeline
- Freestyle
- Pipeline
Note: Multibranch and pipeline job types support both scripted and declarative syntax.
After completing the steps in this section, you will have a working pipeline job:
- Install a branch source plugin (multibranch only).
- Install the Black Duck Security Scan Plugin for Jenkins.
- Configure the SCM Server in Jenkins.
- Configure global settings in the Jenkins UI.
- Configure a job in Jenkins:
Install the branch source plugin
You will need to manually install the specific branch source plugin on your Jenkins instance.
Note: For a multibranch pipeline job, if you do not have a branch source plugin installed on your Jenkins instance, it will throw an error during the job execution.
To install the appropriate branch source plugin for Jenkins:
- Navigate to Manage Jenkins and choose plugins.
- Click the Available Plugins tab.
- Check the box next to your Branch Source Plugin:
- Bitbucket Branch Source Plugin
- GitHub Branch Source Plugin
- GitLab Branch Source Plugin
Note: If the plugin is already installed on your system, it will not be listed on the Available tab. - Select Download now and install after restart (located near the bottom of the plugin list) to install the plug-in after the next Jenkins restart.
- Restart Jenkins and navigate to Manage Jenkins > Plugins > Installed to verify that the plugin has been successfully installed.
Install the Black Duck Security Scan Plugin for Jenkins
To install the Black Duck Security Scan Plugin for Jenkins:
- Navigate to Manage Jenkins and then choose plugins.
- Click the Available Plugins tab.
- Select the checkbox next to Black Duck Security Scan plugin.Note: If the plugin is already installed on your system, you will not see it listed on the Available tab.
- Near the bottom of the plugin list, select Download now and install after restart to install the plugin after the next Jenkins restart.
- After restarting Jenkins, confirm that the plug-in is successfully installed by navigating to Manage Jenkins, then Plugins, then Installed. Verify that Black Duck Security Scan appears in the list.
Configure the SCM server in Jenkins
To configure Jenkins to integrate with a Source Code Management (SCM) server:
- Navigate to Dashboard.
- Choose Manage Jenkins, and then choose System.
- Follow the instructions below relevant to the Source Code Management (SCM) platform:
GitHub
- Go to the GitHub section. Click the Add GitHub Server button and select the GitHub server from the drop down menu.
- Configure the following settings for the GitHub server:
- Name
- API URL
- Click the checkmark to select Manage hooks.
- Select the credentials from the dropdown. If credentials have not been configured:
- Click the Add dropdown menu.
- Select Kind > Username with password.
- Provide a GitHub username and in the password field provide an access token.
- Scroll to the bottom of the page, then click Apply and Save.
GitLab
- Go to the GitLab Servers section. Click the Add GitLab Server button and select the GitLab Server option from the dropdown menu.
- Configure the following settings for the GitLab server:
- Display Name
- Server URL
- Click the checkmark to select Manage Web Hooks.
- Select the credentials from the dropdown. If credentials have not been configured:
- Click the Add dropdown menu.
- Select Kind > Username with password.
- Provide a GitLab username and in the password field provide an access token.
- Scroll to the bottom of the page, then click Apply and Save.
Bitbucket
- Go to the Bitbucket Endpoints section. Click the Add button and select the Bitbucket Server option from the dropdown menu.
- Configure the following settings (in Jenkins) for Bitbucket server:
- Name
- Server URL
- Server Version (for the Bitbucket instance)
- Click the checkmark to select Manage hooks. (Leave the other two boxes checked)
- Select the credentials from the dropdown. If credentials have not been configured:
- Click the Add dropdown menu.
- Select Kind > Username with password.
- Provide a Bitbucket username and in the password field provide an access token.
- In the Webhook implementation to use dropdown menu, select Plugin.
- Scroll to the bottom of the page, then click Apply and Save.
Configure global settings in the UI
Settings that are configured globally can be used in multiple pipelines. Any settings that all your pipelines will have in common should be set here, so that they only have to be set once. When one pipeline requires that an individual setting be different, you can set it in the jenkinsfile for that pipeline.
To configure global settings for the plugin:
- Navigate to Dashboard, select Manage Jenkins, then select System.
- Scroll down to the Black Duck Security Scan section and complete fields in that form for each product that you want to use.
Note:
- "Username with password" and "Secret Text" are the only credential types supported.
- The credentials specified here will be used if no other credentials are provided in the Jenkinsfile.