Skip to main content

Bitbucket

Overview

Visualize and analyze Bitbucket resources, including repositories, pipelines, branches, and pull requests. Monitor resource visibility, governance, and secure access management. Automate workflows and track code quality across repositories and pipelines. Identify and mitigate vulnerabilities to ensure the integrity and security of your Bitbucket environment.

Configurations

ConfigurationDescription
Blueprint Account NameA human-readable name for your account that will be used to identify this account across the application.
Workspace Access TokenBitbucket Workspace Access Token with the necessary permissions.
Workspace NameWorkspace Identifier. You can quickly identify your workspace ID by checking the URL (https://bitbucket.org/<workspace_id>) you use to access your workspace.
Data Crawl FrequencyThe frequency at which Kscope will crawl the account for resources.
Event Crawl FrequencyThe frequency at which Kscope will crawl the account for events.
Resource SelectionSelectively include or exclude certain resources, such as repositories, based on their type.

Permissions

The Bitbucket blueprint requires an App Password which you can create by clicking here. Please ensure that you give the app password a descriptive name and select the required permissions listed below.

Required Permissions:

Data Crawl

  • repository:read
  • project:read
  • account:read

Secret Scan

  • repository:read

Remediation

  • repository:read
  • repository:write
  • pullrequest:read
  • pullrequest:write

Permission Details:

PermissionWhy it's needed
account:readAccess basic account information and user details
repository:readRead repository content, metadata, branches, and pull requests
repository:writeCreate branches and push commits for remediation pull requests
project:readAccess project information and organization structure
pullrequest:readRead pull request information
pullrequest:writeCreate pull requests for remediation actions

For more information about Bitbucket permissions, refer to the official documentation: Bitbucket Permissions Documentation

Remediation

The Bitbucket blueprint supports automated remediation through pull request creation. This provides a human-in-the-loop workflow where changes are proposed via PRs that must be reviewed and merged manually.

Supported Remediation Types

TypeDescription
fix-secretsRemove hardcoded secrets and replace with environment variable references
update-dependencyUpdate package versions in dependency files to address vulnerabilities
add-security-policyAdd security policy files (SECURITY.md, CODEOWNERS, etc.)

How It Works

  1. Detection: Kscope identifies security issues during data crawls (hardcoded secrets, vulnerable dependencies, missing policies)
  2. Remediation Request: A remediation action is triggered with the appropriate fix
  3. Pull Request Creation: The system creates a branch and opens a pull request with the proposed changes
  4. Human Review: A team member reviews the PR to verify the changes are correct
  5. Merge: The PR is merged to apply the fix

Security Considerations

  • All changes go through Pull Requests - no direct commits to protected branches
  • Full audit trail through Git history
  • Changes can be easily reverted if needed
  • Human approval required before any changes are applied

SBOM Generation

The Bitbucket blueprint includes SBOM (Software Bill of Materials) generation for repositories. This provides comprehensive vulnerability scanning and dependency analysis for source code and applications.

For information about supported languages and package managers for SBOM generation, see: SBOM

Schema Model

ResourcesSource EntityNormalized EntityDescription
BitbucketbitbucketServiceBitbucket Service
Workspacebitbucket.workspace.WorkspaceWorkspaceBitbucket Workspace
Projectbitbucket.project.ProjectProjectBitbucket Project
Projectsbitbucket.project.ProjectsProjectBitbucket Projects
Userbitbucket.user.UserUserBitbucket User
Usersbitbucket.user.UsersUserBitbucket Users
Repositorybitbucket.repository.RepositoryRepositoryBitbucket Repository
Repositoriesbitbucket.repository.RepositoriesRepositoryBitbucket Repositories
Pipelinebitbucket.repository.PipelinePipelineBitbucket Pipeline
Statebitbucket.repository.StateStateBitbucket State
Resultbitbucket.repository.ResultResultBitbucket Result
Targetbitbucket.repository.TargetTargetBitbucket Target
PipelineStepbitbucket.repository.PipelineStepPipelineStepBitbucket Pipeline Step
Commandbitbucket.repository.CommandCommandBitbucket Command
Findingsca.secretscan.FindingVulnerabilitysecret detected by gitleak