Hanzo
PlatformHanzo KMSPlatformSecret Scanning

Bitbucket Secret Scanning

Learn how to configure secret scanning for Bitbucket.

Prerequisites

Create a Bitbucket Data Source in Hanzo KMS

  1. Navigate to your Secret Scanning Project's Dashboard and click the Add Data Source button. Secret Scanning Dashboard

  2. Select the Bitbucket option.

Select Bitbucket

  1. Configure which workspace and repositories you would like to scan. Then click Next. Data Source Configuration

    • Bitbucket Connection - the connection that has access to the repositories you want to scan.
    • Workspace - the Bitbucket workspace to scan secrets in.
    • Scan Repositories - select which repositories you would like to scan.
      • All Repositories - Hanzo KMS will scan all repositories associated with your connection.
      • Select Repositories - Hanzo KMS will scan the selected repositories.
    • Auto-Scan Enabled - whether Hanzo KMS should automatically perform a scan when a push is made to configured repositories.
  2. Give your data source a name and description (optional). Then click Next. Data Source Details

    • Name - the name of the data source. Must be slug-friendly.
    • Description (optional) - a description of this data source.
  3. Review your data source, then click Create Data Source. Data Source Review

  4. Your Bitbucket Data Source is now available and will begin a full scan if Auto-Scan is enabled. Data Source Created

  5. You can view repositories and scan results by clicking on your data source. Data Source Page

  6. In addition, you can review any findings from the Findings Page. Findings Page

To create a Bitbucket Data Source, make an API request to the Create Bitbucket Data Source API endpoint.

Sample request

curl --request POST \
--url https://us.kms.hanzo.ai/api/v2/secret-scanning/data-sources/bitbucket \
--header 'Content-Type: application/json' \
--data '{
    "name": "my-bitbucket-source",
    "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "description": "my bitbucket data source",
    "connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "isAutoScanEnabled": true,
    "config": {
        "workspaceSlug": "my-workspace",
        "includeRepos": ["*"]
    }
}'

Sample response

{
    "dataSource": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "externalId": "1234567890",
        "name": "my-bitbucket-source",
        "description": "my bitbucket data source",
        "isAutoScanEnabled": true,
        "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z",
        "type": "bitbucket",
        "connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "connection": {
            "app": "bitbucket",
            "name": "my-bitbucket-app",
            "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        },
        "config": {
            "workspaceSlug": "my-workspace",
            "includeRepos": ["*"]
        }
    }
}

How is this guide?

Last updated on

On this page