The Simplest Way to Make Bitbucket and Tcp Proxies Work Like They Should
Teams use bitbucket and tcp proxies to move code into private networks in a safe way. This setup lets build jobs reach locked servers and databases without opening public firewall ports. Code stays in your cloud repo while your main servers stay behind a private wall. Build runners send traffic through a tight network path to finish their work. You get fast builds without putting your core data on the public web. How bitbucket and tcp proxies handle traffic and roles A build job starts when
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 use bitbucket and tcp proxies to move code into private networks in a safe way. This setup lets build jobs reach locked servers and databases without opening public firewall ports.
Code stays in your cloud repo while your main servers stay behind a private wall. Build runners send traffic through a tight network path to finish their work. You get fast builds without putting your core data on the public web.
How bitbucket and tcp proxies handle traffic and roles
A build job starts when a developer pushes code to a repo branch. The job needs to talk to a private server or database to run tests. It cannot reach that private network over the open internet.
A network relay sits at the edge of your private cloud space. The build runner sends its raw network packets to this outer edge host. The host checks the incoming IP address and port rules before forwarding packets.
Each system handles a different part of the login check. Your code platform checks who pushed the code and which branch can run jobs. It holds the build keys in its private project storage.
The network relay checks where the traffic comes from and where it goes. The final target server still checks the database password or SSH key itself. Data flows through the tunnel as raw bytes from start to finish.
Common network failure modes and how to scope roles
Many teams put one shared admin key into their global repo settings. Every build job in the company then uses that same high-level login. If one test branch leaks that key, an attacker gets full control.
Broad IP rules also create big holes in your network wall. Cloud build runners change their public IP addresses all the time. Teams often open large IP ranges so their build jobs do not fail.
End-to-End Encryption + Bitbucket Pipelines Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Anyone running jobs on that shared cloud range can then reach your port. Raw network relays also struggle to log what happens inside the tunnel. They see bytes move, but they do not see which SQL query ran.
You can fix this by giving each repo branch its own narrow role. Create a separate database user or server role for each deployment stage. Let test branches read test data, and let main branches run updates.
Lock down network paths so each runner only reaches the exact host it needs. Use self-hosted runners inside your private network for high-risk production tasks. Turn on target server logs so you have a record of every command.
Keeping sensitive data safe during build and test runs
Build jobs often run database changes or pull test data from live systems. If a job prints output to the build log, private data can leak. Anyone who can read the repo build log might see real user facts.
Keep real customer data out of your build and test databases when possible. If a workflow reads live tables, use data masking on the output stream. Data masking rewrites matched fields like emails, phone numbers, card numbers, and national IDs.
Rotate your repo keys on a set schedule so old keys cannot work. Remove unused network forwarding rules as soon as an old app shuts down. Small, clean rules make it easy for your team to spot strange traffic.
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 cloud build runners fail to reach private TCP ports?
Cloud runners use shared IP pools that change on almost every run. Strict firewalls block them unless you use static IPs or a private runner.
Should we share one SSH key across all repo pipelines?
No, shared keys make it hard to track who ran a specific job. Give each repo and deployment stage its own unique key with narrow permissions.
Do raw TCP relays inspect database queries inside the traffic?
Standard Layer 4 relays only forward packets based on IP address and port. You must enable query logging on the database itself to see exact commands.
Related guides
In this post