Skip to content

contra-zzz-stsecurity/contrast-bamboo-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This plugin adds functionality to Bamboo so that you can configure profiles for connecting to TeamServer and verify builds against vulnerability thresholds.

Installing the Plugin

The first step is to build the plugin. To begin, clone the plugin from our Github repository.

git clone https://github.com/Contrast-Security-OSS/contrast-bamboo-plugin.git
cd contrast-bamboo-plugin
mvn package

This builds the contrast-bamboo-plugin-#.#.#-SNAPSHOT.jar and the a .obr file. They can both be found within the contrast-bamboo-plugin/target directory of the cloned project.

Once you have built the plugin, you can upload it to your Bamboo instance. Begin by selecting the Add-Ons option from the top left settings menu.

Bamboo Upload Add On

Then select the Upload add-on link.

Bamboo Add On Option

You should now be prompted to upload a file. Select contrast-bamboo-plugin-#.#.#-SNAPSHOT.obr.

After uploading the plugin, you should see it appear under User Installed Add-Ons.

Bamboo Successfully Added Add On

Creating a TeamServer profile

To use the plugin, you should first configure a TeamServer profile. To do this, select the TeamServer Profiles button under Add-Ons within the Bamboo Administration dashboard.

Bamboo Get To Configuration Settings

You'll then be brought to the Profile Configuration page. Select the New Profile button to see fields for adding a profile.

Fill out the form fields according to their labels. If you are a SaaS customer you do not need to enter a TeamServer URL. Once you have filled out all the fields, select the Test Connection button to verify that your settings are correct.

Bamboo Configuration Success

Vulnerability Thresholds

The plugin can be added as a task to build jobs to check for vulnerability conditions that you configure. This checks TeamServer for the number of vulnerabilities in the applications as well as types of vulnerabilities.

Configuring vulnerability thresholds

To add a task to a build job, you must either create a new plan or use an existing build plan. For the purpose of these instructions, you'll walk through creating a new build plan.

Select the Create a New Build Plan button.

Bamboo Create a New Build Plan

You'll now be prompted to give the build plan a project name, plan name and link to the repository host. The project key and plan key is auto-generated.

Bamboo Create a New Build Plan

Once you create the plan, add a task to the build process by clicking the Add Task button.

Bamboo Add Contrast Task

A dialog will appear. Find the Contrast CI for Assess task and select it.

Bamboo Add Contrast Task

The task configuration screen relies on a TeamServer Profile, which you configured in the previous steps, a server name, and an application name. The server name that you enter should correspond to a server name on TeamServer. The application name must be on the server that you defined.

The next part of the task configuration is defining conditions for when to fail a build. This involves entering three pieces of data:

  • Threshold Count: the minimum number of findings required to fail the build.
  • Threshold Severity: the minimum severity at which to count a finding towards the threshold count.
  • Threshold Vulnerability Type: the type of finding required to count a finding towards a threshold count.

Note: Using the Any option means that any severity or vulnerability type is counted towards the max threshold count.

You can configure multiple conditions for each task by selecting the Add New Threshold Condition button.

Bamboo Configuring the Task

The last step is to enable the build plan by selecting the checkbox in the bottom left.

Bamboo Enable Build Plan

Running the build

To run your build for the first time, you'll need to select the Run button and then in the dropdown select the Run Plan option.

Once the build is finished, you can see if it passed or failed. To view the Contrast task details, look at the logs of the job to which the task is attached. In the following example, this is the default job. As you can see in the logs, the task only found two vulnerabilities that met your conditions, therefore the job passes.

Bamboo Success Logs

You can also see charts of data from the task by clicking the Contrast Report tab. This presents the past 10 builds and charts the severities over build numbers, as well as the vulnerability types of build numbers.

Bamboo Severity Chart

Bamboo Vulnerability Chart

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 78.2%
  • JavaScript 11.7%
  • FreeMarker 10.1%