Skip to main content

Overview

ZeroPath connects to a self-hosted Bitbucket Server / Data Center instance with an HTTP access token. No app or Atlassian Connect registration is needed on the Bitbucket side. Once connected, ZeroPath lists the repositories the token can see and sets up webhooks where it has permission. With automatic scanning enabled, it can scan default-branch pushes and pull requests, post build statuses, and comment on changed lines. A connection has one of two scopes:
  • All accessible projects — one connection for the whole instance. ZeroPath discovers every repository the token can read, across all projects, and you import from all of them at once.
  • One project — the connection is limited to a single project key. Connect several projects as separate connections.
Bitbucket Cloud uses the same dialog with a workspace access token or OAuth; see the quickstart for the Cloud steps.
ZeroPath reaches the instance over HTTPS on port 443 at a bare hostname, for example bitbucket.example.com. A non-standard port (including Data Center’s default 7990), a context path such as https://host/bitbucket, or plain HTTP is not supported; front the instance with a standard HTTPS hostname if yours differs.

Prerequisites

  • A ZeroPath organization where you can create VCS installations and repositories.
  • A Bitbucket Data Center instance reachable from ZeroPath over HTTPS, and able to reach ZeroPath in return to deliver webhooks. A firewall that only allows the outbound direction leaves the connection looking healthy while no push or pull request event ever arrives.
  • An HTTP access token:
    • For All accessible projects, a user HTTP access token (create it from a dedicated service account under Manage account → HTTP access tokens). ZeroPath sees exactly what that user can read.
    • For One project, a project-scoped HTTP access token (Project → Settings → HTTP access tokens) or a user token.
    • The token needs Repository read/write and Pull request permissions for scanning and remediation, and Project admin wherever ZeroPath should create webhooks automatically. Repositories in projects where the token lacks admin still import and scan on demand, but their webhooks are reported as failed and no push or pull request scan is triggered for them.

Connect the instance

1

Open Bitbucket setup

In ZeroPath, open Repositories, click Add repository, select the Bitbucket tab and choose Use an Access Token (Add or Update Access Token once a Bitbucket connection exists).
2

Enter the domain

Enter the instance hostname, for example bitbucket.example.com — no scheme, port, or path.
3

Choose the scope

Pick All accessible projects to connect the whole instance, or One project and enter the project key (the KEY in https://<host>/projects/KEY, not the display name). Project keys are matched case-insensitively.
4

Enter the token

Paste the HTTP access token. ZeroPath validates it against the instance (or the project) immediately and stores it encrypted. Running the dialog again with Update existing rotates a connection’s token in place.

Import repositories

Go to Repositories → Add repository → Bitbucket. The picker lists every unlinked repository visible through your connections, labelled by connection; a repository visible through both a project connection and an instance-wide connection is listed once, under the project connection. Search matches a prefix of the repository name or of the project name (this is how Bitbucket’s listing API filters). For large installations, the picker continues looking for unlinked repositories in the background. You can search while it loads. If you call POST /api/v2/installations/unlinkedBitbucketRepositories, a partial or empty page can still have hasMore: true. Pass nextCursor until hasMore is false. Select repositories individually, or choose Add all accessible Bitbucket repositories to import everything the connections can see in a background job that survives restarts and reports its progress in the dialog: how many repositories were added, skipped or failed, any connection that could not be listed, and any added repository whose webhook could not be created. Each repository is imported on its own, so one failure never undoes the others. Rerunning Add all also repairs webhooks for already-linked repositories, which count as skipped after a successful repair. Repairs that still fail are retried and then included in the failed count. A repository that has no commits yet is imported with its configured default branch and no commit, and picks up a real head on the first push. If Bitbucket reports a missing default branch, ZeroPath uses another branch only when it can verify that exactly one exists. If it finds several branches or cannot complete the branch listing, set the correct default branch in Bitbucket and retry the import. The error may show up to ten branch names. Importing does not start scans; run a full scan or wait for the schedule.

Webhooks

ZeroPath provisions webhooks during import and removes them when a repository or connection is deleted. Deliveries are signed with a per-project secret that ZeroPath generates, so there is nothing to configure on the Bitbucket side.
  • On Bitbucket Data Center 8.8 and newer, ZeroPath creates one project-level webhook per project, shared by every imported repository in that project.
  • On older Data Center releases, which have no project-level webhooks, ZeroPath creates one repository-level webhook per imported repository instead. The events and signing secret are the same, and pull request scanning works identically.
Both kinds subscribe only to the events ZeroPath acts on: repo:refs_changed, pr:opened, pr:modified, pr:from_ref_updated, pr:merged, pr:declined, and pr:comment:added. pr:merged and pr:declined close the loop on patch pull requests ZeroPath opens: a merge marks the patch accepted and resolves the linked finding; a decline marks it denied. Bitbucket pauses a webhook after several consecutive failed deliveries and does not resend the events it skipped while paused. Webhooks created by earlier ZeroPath releases also subscribe to repo:modified, pr:reviewer:updated, and pr:reviewer:approved; ZeroPath accepts those deliveries without acting on them, so they never count as failures. Running Add all accessible Bitbucket repositories again recreates such webhooks with the current event list, including pr:merged and pr:declined. The Test connection button on the webhook in Bitbucket gets a successful response. It only confirms that Bitbucket can reach ZeroPath; nothing is scanned.

Scan

Bitbucket webhooks can trigger a full scan when a qualifying commit reaches the default branch, or a PR scan when a pull request is opened, edited, or receives new commits. Enable the corresponding triggers in scanner settings. Scheduled and on-demand full scans work without these webhooks. When check and comment posting are enabled, ZeroPath posts a build status on the head commit and comments on changed lines.

PR bot commands

Start a new, unedited PR comment with /zeropath (@zeropath and @zeropath-ai also work):
  • /zeropath explain issue 1 — ask the Assistant to explain a tracked finding.
  • /zeropath fp issue 1 because this code is unreachable — mark it false positive.
  • /zeropath rescan — scan the current commit if it has not already been scanned.
  • /zeropath rescan force — request a fresh scan that bypasses the cache.
Replies stay in the comment thread. Explanations require the Assistant to be enabled and replace the initial “Thinking…” reply when ready. With access control enabled, the author needs a linked Bitbucket contributor account and the appropriate ZeroPath repository permissions. Edited and deleted comments never execute commands. Branch modification and check bypass remain unsupported. See Bot Commands for targeting and other triage actions. After upgrading, run Add all accessible Bitbucket repositories again so existing hooks include pr:comment:added. On a self-hosted instance, use a release that includes Bitbucket PR bot support. The build status has the build key ZeroPath Security Scan and is stored on the pull request’s target repository, including for pull requests from forks, so a Required builds merge check for that key blocks merging until the scan passes. It reads In progress while the scan runs, Successful or Failed once the scan reaches a verdict, and Cancelled when the scan is skipped, fails, times out, or is cancelled in ZeroPath (within about a minute of the cancel). Data Center older than 8.0 has no Cancelled state, so there those scans read Failed, with the reason in the build’s description. Build statuses use the repository build-status API, which needs Bitbucket Data Center 7.4 or newer.

Assistant code inspection

In an issue conversation, ask the Assistant to check the affected code on the relevant branch. It uses the existing Bitbucket connection and the conversation’s repository permissions to read files and list directories. You can use the same code inspection tools in MCP. They return the resolved commit so related reads can use the same revision. Bitbucket Data Center supports text files up to 5,000,000 bytes. Use code.listFiles for directories and code.read for individual files. Listings skip submodules. Code search is available for GitHub and GitLab. On a self-hosted instance, use a release that includes Bitbucket Data Center code inspection.

Disconnecting

Deleting a connection removes ZeroPath’s webhooks from Bitbucket first. If a webhook cannot be removed because the token was revoked or no longer has permission, the connection is still deleted and the webhook is reported for manual removal; only a temporary outage keeps the connection around for a retry.

Troubleshooting