The Simplest Way to Make AWS App Mesh and Mercurial Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Running aws app mesh and mercurial together routes source control traffic through a service mesh. This setup lets build runners pull code over encrypted, monitored network paths. Many engineering teams run legacy codebases inside private cloud networks. These teams often host Mercurial servers on virtual machines or containers. Build agents and deployment jobs must pull code from these servers every day. Putting your version control server inside a service mesh adds clear network rules. You con

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.

Running aws app mesh and mercurial together routes source control traffic through a service mesh. This setup lets build runners pull code over encrypted, monitored network paths.

Many engineering teams run legacy codebases inside private cloud networks. These teams often host Mercurial servers on virtual machines or containers. Build agents and deployment jobs must pull code from these servers every day. Putting your version control server inside a service mesh adds clear network rules. You control which build services can reach the repo host. You also get clear logs for every network call between your services.

How aws app mesh and mercurial handle identity and traffic

Mercurial moves code changes between peers using web requests or secure shell sessions. When you add a service mesh, sidecar containers sit next to your apps. Every pull or push from a build runner goes through the local sidecar first.

The sidecar checks where the traffic wants to go. It then sends the request to the sidecar sitting next to the Mercurial server. Both sidecars can use mutual TLS to check each other's service identity. This step happens before the request ever hits the version control process.

Once the network call lands on the server, Mercurial checks the user key. Build systems often use an SSH key or a basic web token here. Cloud roles manage the mesh rules, while local keys manage the repo rights. Keeping these two layers separate helps teams track both machine and user actions.

Common failure modes and how to scope network paths

The biggest risk in this setup is using one shared service account everywhere. Teams often give all build runners the same broad SSH key for pulls. When a bad push happens, the server logs only show the shared account name. You cannot tell which person or job made the change.

Long-lived tokens also create a high risk if a build machine gets breached. An attacker can take that static token and clone every repo on the server. Network rules alone will not stop them if the compromised runner has mesh permissions.

AWS IAM Policies + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Another common bug comes from strict timeout rules on the mesh sidecars. Pulling a huge repo with years of history takes a lot of time. If the mesh drops slow requests by default, large clones will fail halfway through. You must tune the route timeouts for the paths that carry code clones.

To fix access sprawl, scope your mesh routes to specific build worker roles. Only allow your deployment tools to talk to the Mercurial virtual node. Give read-only keys to test runners, and keep write keys for release jobs. Rotate all repo keys often and log every user session at the host level. You should also mask sensitive data like emails or card numbers in log outputs. Masking rewrites matched fields in results so raw PII stays out of plain view.

Keeping repo changes and service mesh rules in sync

Some teams store their mesh route files right inside a Mercurial repo. When a developer pushes a change, a pipeline updates the cloud mesh settings. This workflow ties your code history directly to your live network state.

Make sure the deployment worker uses a tight cloud role for this task. That role should only update mesh routes for its own team space. Never let a single repo pipeline change network rules for the whole company. Keep human reviews required for any commit that opens a new network path.

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

Can the service mesh route SSH traffic for Mercurial clones?

Yes, you can set up TCP routes in the mesh to carry SSH traffic. Still, web traffic over HTTPS gives you better mesh metrics and simpler TLS setup.

Why do large Mercurial pulls fail when running through a sidecar?

Sidecars often have short default idle timeouts that cut off big file transfers. Raise the route timeout on the virtual router that handles your repo server traffic.

How do we stop build agents from pushing to protected branches?

The service mesh only controls which machines can talk over the network. Use server-side hooks in Mercurial to check user keys and block bad branch pushes.

The query runs. The emails stay hidden.