The Simplest Way to Make Bitbucket and Kuma Work Like They Should
Teams pair bitbucket and kuma to ship service mesh rules from code repos. Bitbucket stores the traffic specs and runs the build jobs that update Kuma. This workflow turns mesh changes into normal code reviews. Engineers propose routing or security changes in a pull request. Once a peer approves the change, a pipeline job sends the update to the control plane. How bitbucket and kuma share identity and traffic data Bitbucket holds the source files that define how services talk to each other. T
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 kuma to ship service mesh rules from code repos. Bitbucket stores the traffic specs and runs the build jobs that update Kuma.
This workflow turns mesh changes into normal code reviews. Engineers propose routing or security changes in a pull request. Once a peer approves the change, a pipeline job sends the update to the control plane.
How bitbucket and kuma share identity and traffic data
Bitbucket holds the source files that define how services talk to each other. These files cover traffic routing, mutual TLS, fault injection, and timeout rules. When a developer merges a branch, a pipeline runner starts a deployment job.
That runner must log in to the Kuma control plane to apply changes. Teams set up a dedicated token or secret inside the repo store. The runner reads this secret during the build and sends it to the control plane API.
The control plane checks the token and accepts the new mesh specs. Next, the control plane pushes the updated rules out to every data plane sidecar. Services in the mesh then follow the new traffic rules right away.
Common failure modes in pipeline to mesh setups
Many teams start with a single admin token shared across all repos. This setup creates a big risk if a build log leaks the secret. Anyone with that token can alter traffic rules across every zone and mesh.
Broad network access is another common problem in these setups. Teams often open the control plane API to the public internet for cloud runners. This exposes the mesh control plane to outside attacks and brute force attempts.
End-to-End Encryption + Bitbucket Pipelines Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged changes also hurt teams during an outage. When ten pipelines share one service account, audit logs show the same user for every change. Operators cannot tell which commit or engineer broke a routing rule.
Scoping roles and network paths between systems
To fix these issues, scope tokens to specific meshes and actions. Give each repo a token that only writes to its own mesh space. A frontend app repo should never change backend database mesh rules.
Keep the control plane off the public internet whenever you can. Run self-hosted pipeline runners inside the same private network as your mesh control plane. This keeps all control traffic on internal network paths.
Enforce branch checks before any pipeline job can talk to the control plane. Require at least one peer review and a passing syntax check on every pull request. Lock down deployment secrets so only protected branches can read and use them.
Rotate pipeline tokens on a regular schedule to limit exposure. Store secrets in dedicated secret stores rather than plain pipeline variables. Tag every deployment request with the git commit hash and author name for clear logs.
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
How should Bitbucket runners talk to a private Kuma control plane?
Run self-hosted runners inside your private network or virtual private cloud. This lets the build job reach the control plane without opening public firewall ports.
What is the safest way to handle mesh admin tokens in pipelines?
Avoid using global admin tokens in your build jobs. Create scoped tokens that only allow write actions on a single mesh segment, and rotate them often.
How do we roll back a bad mesh rule pushed from a pipeline?
Revert the git commit in your repo and merge the revert pull request. The pipeline will run again and push the previous working state to the control plane.
Related guides
In this post