The Simplest Way to Make Bitbucket and Zerto Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair bitbucket and zerto to automate disaster recovery tests from code pipelines. When developers push code to Bitbucket, pipelines trigger Zerto to snapshot or move workloads. This workflow links daily software releases with backup checks. Teams do not need to run manual recovery tests before a big deployment. Instead, the build pipeline talks to the recovery API and checks system readiness. How bitbucket and zerto share keys and data Bitbucket holds your source code and runs build pi

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams pair bitbucket and zerto to automate disaster recovery tests from code pipelines. When developers push code to Bitbucket, pipelines trigger Zerto to snapshot or move workloads.

This workflow links daily software releases with backup checks. Teams do not need to run manual recovery tests before a big deployment. Instead, the build pipeline talks to the recovery API and checks system readiness.

How bitbucket and zerto share keys and data

Bitbucket holds your source code and runs build pipelines on runners. Zerto manages virtual machine replication and recovery across your data centers or cloud sites. To work together, the build runner must send web requests to the recovery manager.

First, the pipeline reads a stored secret from the repo settings. The runner sends this secret to the recovery API to get a session token. Once logged in, the pipeline can read recovery groups or start a test failover.

Data flows in both directions during a pipeline run. The runner sends a request to start a backup task or check replication status. The recovery manager sends back status updates, task IDs, and alert summaries. The pipeline reads this reply and decides whether to continue the code deployment.

Common failure modes and how to scope roles

Many teams use one shared admin account for all pipeline tasks. This shared key often has full control over every virtual machine and backup group. If a developer leaks this key in a build log, attackers can delete backups.

Broad tokens also make auditing very hard for security teams. When a failover starts by mistake, logs only show the shared service user. You cannot see which developer or branch triggered the recovery event.

End-to-End Encryption + Bitbucket Pipelines Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged API calls create another blind spot during outages. Build logs in the code host may expire or lack full request details. Meanwhile, the recovery tool only logs basic event results without pipeline context.

To fix this, create a narrow role for your build runners. Only grant permissions to read status or run test failovers on specific test groups. Never give the pipeline role rights to stop replication or wipe production disks.

You should also lock down the network path between the two systems. Cloud build runners use wide IP ranges that change all the time. Run a local self-hosted runner inside your private network for recovery tasks. Then, set firewall rules so the recovery API only accepts calls from that runner.

Testing disaster recovery plans in build pipelines

Once you scope your roles and network paths, you can automate recovery drills. Store your recovery plans as code files inside your version control repo. When an engineer updates a system setup, they update the recovery script too.

A pull request can trigger a non-disruptive failover test in an isolated network bubble. The pipeline starts the recovery test, waits for the app to boot, and checks health. After the health check passes, the pipeline tells the recovery tool to clean up. This keeps your recovery plans tested and ready for real outages.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

How does a Bitbucket pipeline talk to a private Zerto server?

Use a self-hosted runner inside your private network for these jobs. The local runner pulls jobs from the cloud and calls the local recovery API.

What permissions should the pipeline service account have?

Give the account permission to read status and run test failovers only. Do not grant rights to delete protection groups or run live production failovers.

How can teams stop keys from leaking in build logs?

Store all credentials as masked variables in your repo settings. Make sure your pipeline scripts never print raw session tokens to the console output.

The query runs. The emails stay hidden.