The Simplest Way to Make Gerrit and SAML Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing gerrit and saml lets your team log in to code review with one identity. This setup links your central user store to your Git review server. Engineers do not need separate passwords for web reviews. Your identity provider checks who the user is and sends a signed message. Gerrit reads this message and opens the user session right away. When someone leaves the company, you disable one account to stop web logins. How gerrit and saml handle user login and roles When a developer opens the

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 gerrit and saml lets your team log in to code review with one identity. This setup links your central user store to your Git review server.

Engineers do not need separate passwords for web reviews. Your identity provider checks who the user is and sends a signed message. Gerrit reads this message and opens the user session right away. When someone leaves the company, you disable one account to stop web logins.

How gerrit and saml handle user login and roles

When a developer opens the review web page, the server asks for proof of identity. The browser sends the user to your SAML identity provider. The user logs in there and passes a multi-factor check. Then the identity provider sends a signed XML claim back to the review server.

Gerrit checks the digital signature on that message using a trusted public key. Next, it reads user details like full name, email address, and group names. An external auth plugin maps those group names to local project roles. This flow keeps group choices inside your central identity tool.

Team leads do not have to edit project access lists by hand for each person. Instead, they add a user to a group in the identity provider. On the next login, the review tool updates the user roles to match. This cuts down manual work and reduces human error during team changes.

Common failure modes in code review login setups

Many teams struggle when they mix web login with command line Git tasks. SAML handles browser sessions well, but Git clients still use SSH keys or HTTP tokens. If a user leaves, revoking SAML stops web login right away. Still, old SSH keys or long-lived HTTP tokens might still work for pushing code.

Shared bot accounts create another big risk for engineering teams. Teams often make one shared account for build scripts with wide admin rights. If that token leaks, an attacker can approve and merge bad code. Also, shared accounts make audit logs hard to read during an incident.

SAML 2.0 + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Clock drift between servers is another common cause of login failures. SAML messages have strict start and end times measured in seconds. If your review host clock drifts, valid login attempts will fail. Every server must sync time with a trusted network clock service.

Scoping roles and network paths for safer reviews

Start by scoping every group role to the smallest set of rights needed. Give most developers read and push-for-review rights on their active repos only. Reserve direct merge and branch creation rights for a small lead group. Never grant server admin rights through a broad default group.

Set short lifetimes for both web sessions and command line tokens. Force users to log in again each work day to refresh their group claims. For build bots, scope each account to one repo and one task. Log every login event, role change, and repo action in a central log store.

Lock down network paths between your users, the review server, and the identity provider. Only allow encrypted HTTPS traffic to reach the web login endpoints. Block direct database ports from the open office network. Review your active SSH keys and HTTP tokens every month to remove unused credentials.

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

Does SAML replace SSH keys for Git push commands?

No, SAML only covers browser logins to the web interface. Developers still use SSH keys or HTTP tokens for command line Git actions. You must manage and expire those keys alongside your web login rules.

Why do user group changes not show up right away?

The review server reads group claims only when the user logs in via SAML. If a user already has an open web session, old roles stay active. The user must log out and log back in to load the new groups.

What happens when the SAML signing certificate expires?

All web logins will fail as soon as the signing key expires. You must load the new public key from your identity provider before expiration. Test key rotation in a staging setup first to avoid locking out your team.

The query runs. The emails stay hidden.