The Simplest Way to Make Fortigate and Mercurial Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing fortigate and mercurial lets your team guard private code servers behind strict network rules. The firewall filters traffic while the version control system tracks every code change. Many engineering teams keep older or massive code repos on private servers. They use a perimeter firewall to block outside threats from reaching these hosts. Developers then log in over a virtual private network to push or pull code. When you set up both tools well, code moves fast and stays safe. How for

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.

Pairing fortigate and mercurial lets your team guard private code servers behind strict network rules. The firewall filters traffic while the version control system tracks every code change.

Many engineering teams keep older or massive code repos on private servers. They use a perimeter firewall to block outside threats from reaching these hosts. Developers then log in over a virtual private network to push or pull code. When you set up both tools well, code moves fast and stays safe.

How fortigate and mercurial handle logins and data flow

A developer starts a code push or pull from their local machine. That network packet hits the firewall at the edge of the private network first. The firewall checks the user identity and the source address against its rule list. If the user passes the check, the firewall opens a path to the repo host.

Once the network path opens, the version control server runs its own login check. Teams often use secure shell keys or web passwords for this second step. The code server reads the user role to see if they can write changes. Then the two machines trade compressed file bundles over the open network tunnel.

Both tools write log entries during this code transfer. The firewall logs the network source, the destination port, and the byte count. The version control host logs the user name, the branch, and the commit hash. Security teams must read both logs to see the full story of one push.

Common failure modes and how to scope roles

The biggest risk in this setup is the use of shared service keys. Build servers and developers often share one master key to reach the code host. If that key leaks, an attacker can read or change all your source code. Your logs will only show the shared account name, not the real person.

Broad firewall rules create another major weak spot for engineering teams. Admins sometimes open the whole internal subnet so they can fix connection drops fast. This rule lets any person on the network reach the version control server. A bad actor on the network can then scan the code host for bugs.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, tie every firewall rule to a single user group. Give each developer their own login key on the version control server. Set up your build servers with read-only keys when they only need to pull code. Check your repo permissions every month and delete keys for people who left.

Keeping audit logs and secrets safe across your team

Developers sometimes put test data or database keys inside their code files by mistake. Once someone pushes a secret to a repo, it lives in the history forever. Every person who clones that repo gets a copy of that live key. You should scan commits for secrets before the server accepts the push.

You also need a clear way to match network logs with code logs. Make sure both systems use the exact same user names from your directory service. Keep your system clocks in sync across the firewall and the repo server. When timestamps and names match, you can trace any bad change in minutes.

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

Should we use SSH or HTTPS for Mercurial behind a Fortigate firewall?

Both protocols work well when you set up your firewall rules right. HTTPS lets the firewall inspect web traffic, while SSH works well with user keys.

How do we stop developers from sharing one repository login key?

Link your version control server to your main company directory for user logins. Delete all shared keys and give each person and build tool a unique role.

Why do large code clones drop when passing through the firewall?

Firewalls sometimes cut long network sessions or block big data streams during deep scans. Check your session timeout settings and adjust the rule for your code host.

The query runs. The emails stay hidden.