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

Published
Length
3 min read

Luis Felipe Dias

All posts

Using bitbucket and kubler together lets teams store code and run Kubernetes clusters. You push code changes to a repo, and pipelines deploy updates to your clusters. Teams often struggle when they link source control with cluster management tools. Long-lived keys sit in build runners, and shared admin accounts hide who ran what. A clear design fixes these problems and keeps your daily workflow fast. How bitbucket and kubler share keys and data Bitbucket holds your app code, cluster configs,

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.

Using bitbucket and kubler together lets teams store code and run Kubernetes clusters. You push code changes to a repo, and pipelines deploy updates to your clusters.

Teams often struggle when they link source control with cluster management tools. Long-lived keys sit in build runners, and shared admin accounts hide who ran what. A clear design fixes these problems and keeps your daily workflow fast.

How bitbucket and kubler share keys and data

Bitbucket holds your app code, cluster configs, and build rules in Git repos. Kubler sets up and manages the Kubernetes clusters where those apps will run. To link them, the build runner needs a way to log in.

In a standard flow, a developer merges a pull request into the main branch. This merge starts a build job inside the pipeline runner right away. The runner reads the repo files and builds a new container image.

Next, the runner must tell the cluster to pull and run that image. The runner uses a cluster key or token stored in the repo variables. It sends the new app specs to the cluster control plane over the network.

The cluster checks the key and checks the role tied to that account. If the role allows updates, the cluster starts the new app pods. Data flows in one direction from the repo runner to the cluster API.

The biggest risk in this setup is a shared cluster admin token. Teams often create one big key so every build job works right away. If that key leaks from a build log, an attacker owns the whole cluster.

Broad network rules create another big weak spot for your team. Cloud runners use wide IP ranges that change from one minute to the next. Opening your cluster API to the whole web invites constant outside attacks.

Unlogged changes also hurt teams when an app breaks on a Friday night. When ten repos share one bot account, the cluster log shows one user. You cannot tell which pipeline or developer broke the live app.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, give each repo its own service account and role. Scope each role so it can only write to one single namespace. Never give a build runner full admin rights over the whole cluster.

Use private runners inside your own network when you can set them up. A private runner talks to the cluster over local network paths. This setup lets you close the public port on the cluster control plane.

Designing clean role scopes for daily deploys

Start by splitting your app code from your cluster setup files. Keep app code in one repo and cluster rules in another repo. This split stops an app build from changing core cluster settings by mistake.

Map each branch type to a matching target namespace in your cluster. Feature branches should only hold keys that write to test or staging spots. Only the main release branch should hold keys for your live production pods.

Rotate the keys stored in your build settings on a set calendar schedule. When a team member leaves, swap out any static tokens they could read. Short token life spans limit the damage if a build log exposes a secret.

Check your cluster audit logs every week to spot failed login tries. Failed logins from a runner mean a broken script or a bad key. Fixing these small errors early keeps your deploy pipeline ready for real work.

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 should we store cluster keys in our repo settings?

Store cluster keys as masked deployment variables tied to specific target stages. Scope production keys to protected branches so random pull requests cannot read them.

Should our build runner have full cluster admin rights?

No, a build runner should never hold full admin rights on a cluster. Create a dedicated role that only updates pods and services in one namespace.

How can we keep our cluster API off the public web?

Run self-hosted build workers inside the same private network as your cluster. This lets your workers deploy code over internal network paths without public ports.

The query runs. The emails stay hidden.