The Simplest Way to Make Bitbucket and Cohesity Work Like They Should
Teams pair bitbucket and cohesity to protect source code and automate data snapshots during builds. Bitbucket stores git repos and runs build steps, while Cohesity backs up those repos and test data. This setup helps teams recover lost code or spin up clean test data fast. When a build runs, a pipeline step can call Cohesity to snapshot or clone data. In the other direction, Cohesity can pull repo data from Bitbucket on a set schedule. Both workflows need strict keys, clear roles, and clean net
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 cohesity to protect source code and automate data snapshots during builds. Bitbucket stores git repos and runs build steps, while Cohesity backs up those repos and test data.
This setup helps teams recover lost code or spin up clean test data fast. When a build runs, a pipeline step can call Cohesity to snapshot or clone data. In the other direction, Cohesity can pull repo data from Bitbucket on a set schedule. Both workflows need strict keys, clear roles, and clean network paths to stay safe.
How bitbucket and cohesity share keys and data
Data moves between these two tools in two main ways during daily work. First, the backup platform reads git repos and metadata from your code host over HTTPS. Second, build pipelines send web calls to the backup cluster to trigger data clones.
Each path needs its own login method and role scope to stay secure. When the backup system reads repos, it uses a dedicated token or key from Bitbucket. That key only needs read permissions on the specific projects you want to protect. It should never have write permissions or admin rights over the code host.
When a build pipeline calls Cohesity, the flow goes the other way. The build runner holds an API key or user credential for the backup cluster. The runner sends a request to create a fresh data clone for testing. Once the test ends, another pipeline step tells the cluster to remove that clone.
Sensitive data can live inside those test clones and backup snapshots. Masking rewrites matched fields like emails, phone numbers, card numbers, and national IDs in results. This step keeps test runs safe when teams use clones of real data.
Common failure modes and how to scope roles
Many teams start by using one shared admin account to link both tools. This shortcut creates a big risk if a build script leaks that shared key. Anyone with that key could delete backups or change source code across all projects. Long-lived tokens stored in repo variables also create trouble when staff members leave the team.
End-to-End Encryption + Bitbucket Pipelines Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Another common problem is a lack of clear audit logs for automated calls. When ten pipelines share one backup user, you cannot tell which build deleted a snapshot. All actions look the same inside the cluster log files. Unscoped network paths also let any runner reach the backup management plane without limits.
To fix these issues, create separate service accounts for each project and workflow. Give the backup reader role read-only rights on the exact repos it backs up. Give each build pipeline a narrow role on the backup cluster. That role should only manage clones for one specific app or test space.
Rotate keys on a set schedule and check your logs every week. Lock down network rules so only known build runners can reach the backup API. Keep backup traffic on private network routes whenever your setup allows it. Short token lifetimes and tight role scopes stop small mistakes from becoming major outages.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Why do teams link a code host with a backup platform?
Teams link them to back up git repos and automate test data clones during builds. This protects source code from accidental deletion and gives pipelines fresh test data on demand.
What permissions does Cohesity need inside Bitbucket?
The backup tool only needs read access to the repos and metadata it protects. Never grant write access or workspace admin roles to a backup reader account.
How can we secure backup API keys used in build pipelines?
Store keys in secret variables, scope roles to single apps, and rotate keys often. Use separate accounts for each pipeline so your logs show which build made each call.
Related guides
In this post