Skip to main content

Bitbucket Self-Hosted

Note

It is possible to add the Checkmarx One external IP addresses to the customer FW whitelist - For more information see Checkmarx One External IPs

Overview

Checkmarx One supports Bitbucket integration, enabling automated scanning of your Bitbucket projects whenever the code is updated. Checkmarx One’s Bitbucket integration listens for Bitbucket commit events and uses a webhook to trigger Checkmarx scans when a push, or a pull request occurs. Once a scan is completed, the results can be viewed in Checkmarx One.

In addition, for pull requests, a comment is created in GitHub, which includes a scan summary, list of vulnerabilities and a link to view the scan results in Checkmarx One.

Notice

This integration supports both public and private repos.

The integration is done on a per project basis, with a specific Checkmarx One Project corresponding to a specific Bitbucket repo.

Notice

You can select several repos to create multiple integrations in a bulk action.

Prerequisites

  • The source code for your project is hosted on a Bitbucket repo.

  • You have a Checkmarx One account and have credentials to log in to your account.

  • The Bitbucket user has Admin privileges for this repository, see Bitbucket

To retrieve your Bitbucket Username & Token, perform the following steps:

  1. In your Bitbucket account, click on your user > View Profile

    Bitbucket_View_Profile.png
  2. Retrieve your Username.

    Bitbucket_Username.png
  3. To create a Token, click on your user > Manage account

    Bitbucket_Manage_Account.png
  4. Click on Personal access tokens

    Bitbucket_Personal_Access_Tokens.png
  5. Click on Create a token

    Bitbucket_Create_Token.png

Setting up the Integration and Initiating a Scan

To integrate your self hosted (on-prem) Bitbucket organization with Checkmarx One, perform the following:

  1. In the Applications and Projects home page, click on the Image_937.png button and then select New Project - Code Repository Integration.

    Image_941c.png

    The Import From window opens.

    Image_946.png
  2. Select the Self-hosted → Bitbucket

  3. Configure the following fields:

  4. Click Next

    Bitbucket_SH_Click_Next.png
  5. Select the Bitbucket Organization or Group (for the requested repository) and click Select Organization

    Click Back to return to the Select Service screen

    Note

    • A separate Checkmarx One Project will be created for each repo that you import.

    • There can’t be more than one Checkmarx One Project per repo. Therefore, once a Project has been created for a repo, that repo is greyed out in the Import dialog.

    6427967602.png
  6. In the Repositories Settings screen, perform the following and click Next

    Click Back to return to the Select Repositories screen.

    • Select the scanners for All/Specific repositories.

    • Select which Protected Branches to scan for each Repository.

      Note

      For additional information about Protected Branches see About Protected Branches

    • It is possible to specify the Groups to which you would like to assign the Project.

    • You can also add Tags to the Project. Tags can be added as a simple strings or as key:value pairs

      Bitbucket_Repo_Settings.png
  7. Select which Protected Branches to scan for each Repository and click Next

    Note

    For additional information about Protected Branches see About Protected Branches

    Bitbucket_Select_Branches.png
  8. In the Advanced Options screen it is possible to select Scanning the default branch upon the creation of the Project

    You also must select the default branch for the automatic scan, as Bitbucket doesn't have a default one.

    Click Create Project

    Click Back to return to the Select Branches screen.

    Bitbucket_Advanced_Options.png
  9. The Project is successfully added to the Applications and Projects home page.

    Note

    In order to update the scanners see Imported Project Settings

    6427967620.png

Updating Project Settings

See Imported Project Settings