The Simplest Way to Make Active Directory and Mercurial Work Like They Should
Using active directory and mercurial together lets your team control code repo log in rules from one central user list. A developer sends a code push, and the repo server checks their domain group before writing files. This workflow stops teams from keeping separate password files on every code host. When a person joins or leaves the company, one update in the directory changes their code rights everywhere. How active directory and mercurial handle log in and roles Mercurial does not manage
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 active directory and mercurial together lets your team control code repo log in rules from one central user list. A developer sends a code push, and the repo server checks their domain group before writing files.
This workflow stops teams from keeping separate password files on every code host. When a person joins or leaves the company, one update in the directory changes their code rights everywhere.
How active directory and mercurial handle log in and roles
Mercurial does not manage user accounts or passwords on its own. It relies on the host web server or SSH service to check who is logging in.
When a developer runs a pull or push command, the request hits the repo host first. The host talks to the domain controller using LDAP or Kerberos to check the user account.
Once the domain controller says the user is valid, the host checks their group list. The repo server matches those domain groups against its own read and write rules.
For example, a main release repo might allow read actions for all engineering groups. That same repo can limit write actions to a small release team group in the directory.
The data flow stays simple and fast when you set up group checks well. The developer sends code changes, the host checks the directory, and the repo writes the commit.
Common failure modes with shared accounts and wide rules
Many teams hit trouble when they use a single shared service account for build jobs. When ten servers push tags or read code with one account, your logs lose clear user names.
If that shared password leaks, anyone on the network can read or change your source code. Rotating that password also breaks every build job until you update each host by hand.
Active Directory + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Another common issue is giving broad domain groups full write rights across all repos. Over time, people switch teams, but old group memberships stay active on their accounts.
Unlogged queries and silent pushes also hurt security reviews. If the web host only logs network addresses, you cannot tie a bad code push to a person.
To fix this, give every build runner and user a unique account in the directory. Scope each role to the exact repos it needs to read or write, and nothing more.
Scoping network paths and repo permissions for daily work
Start by splitting your repos into clear groups based on risk and team ownership. Map each repo group to a dedicated security group in your domain directory.
Keep your domain controllers and repo servers on private network segments. Only allow the repo host to talk to the directory on the exact ports needed for user checks.
Make sure the bind account that reads the directory only has read rights on user and group trees. Never use a domain admin account to bind your repo host to the directory.
Turn on detailed logs on both the repo web server and the domain controller. Match each repo push or pull event with the exact domain user name and time.
Review group memberships every quarter to clear out stale accounts and old contractors. If you store PII in test files, masking rewrites matched fields like emails or phone numbers in results.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
How does Mercurial check Active Directory passwords?
Mercurial uses the host web server or SSH daemon to check passwords against the domain controller. The host runs an LDAP bind or Kerberos check before allowing any repo command to run.
Can we map domain groups to specific branch permissions?
Yes, server hooks in your repo host can read the user group list from the directory session. The hook checks if the user group matches the allowed list for that target branch before saving commits.
What is the safest way to set up directory lookup accounts?
Create a dedicated domain user with read-only permissions on the user and group containers. Give it a strong password, block interactive log in, and limit which repo hosts can use it.
Related guides
In this post