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

Published
Length
3 min read

Luis Felipe Dias

All posts

Using fido2 and gerrit together gives your team hardware-backed logins for every code review. Developers tap a security key to log in and push code over SSH. Gerrit holds your source code and tracks every change before it merges. Standard passwords and plain SSH keys leave those code repos open to theft. Hardware keys stop attackers from stealing login secrets from developer laptops. This guide explains how both tools work together to guard your code. How fido2 and gerrit handle logins and pe

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 fido2 and gerrit together gives your team hardware-backed logins for every code review. Developers tap a security key to log in and push code over SSH.

Gerrit holds your source code and tracks every change before it merges. Standard passwords and plain SSH keys leave those code repos open to theft. Hardware keys stop attackers from stealing login secrets from developer laptops. This guide explains how both tools work together to guard your code.

How fido2 and gerrit handle logins and permissions

The workflow between fido2 and gerrit covers both web sessions and Git commands. A developer opens the Gerrit web app to read and score code changes. For the web app, Gerrit often trusts an external identity provider for logins. The identity provider checks the FIDO2 hardware key through the browser using WebAuthn. Once the key tap succeeds, the provider sends a signed user assertion to Gerrit.

Gerrit reads the user group data from that assertion and maps it to project roles. Those roles control who can read branches, vote on changes, or submit code. Developers also interact with Gerrit from the command line when they fetch or push commits. OpenSSH supports FIDO2 keys directly, so users can link their SSH keys to hardware tokens.

The developer generates a hardware-backed SSH key pair and uploads the public part to Gerrit. The private half stays locked inside the physical token or points to a hardware handle. When the developer runs a Git push, Gerrit asks the local SSH client for proof. The SSH client pauses and waits for the user to touch the physical security key. The key signs the login challenge, and Gerrit checks the signature against the public key. After that check passes, Gerrit accepts the Git commits and creates a new review change.

Common failure modes and how to scope access

Teams often struggle when they mix human hardware keys with automated build bots. Build tools cannot touch a physical key, so teams fall back to shared service accounts. Those shared accounts often keep broad passwords or static SSH keys that never expire. If an attacker steals a static bot key, they can read or alter source code. Another common risk comes from leaving old, plain SSH keys active on user profiles. If Gerrit still accepts standard keys, an attacker can bypass the hardware token completely.

You can fix these gaps by separating human accounts from machine accounts in Gerrit. Set up your identity provider so all human web logins require a FIDO2 hardware tap. Configure the Gerrit SSH server to only accept hardware-backed key types for human developer groups. Remove old static SSH keys from user profiles and block HTTP password generation for humans. For build bots, create separate accounts with narrow project roles that only read specific branches.

FIDO2 / WebAuthn + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Lock down network paths so bot accounts can only log in from known build server addresses. Check Gerrit audit logs often to track every login, role change, and branch push. Good log checks help you spot unused keys and remove them before someone abuses them.

Managing daily developer keys and recovery

Hardware keys can break or get lost during travel, which stops developers from pushing code. You should ask every developer to register two physical keys on their account from day one. One key stays at their desk, while the backup key stays in a safe place. If a developer loses a primary key, an admin must revoke that public key right away.

Clear rules for key registration keep the whole team moving fast while staying safe. Admins should never hand out temporary password bypasses without checking the user's identity over video. Keep temporary bypass periods short, and force a new hardware key check as soon as possible.

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 developers use FIDO2 keys for both Gerrit web logins and Git SSH pushes?

Yes, developers can use the same physical token for both web logins and SSH commands. An identity provider handles the web check, while OpenSSH handles the Git command check.

How do automated build pipelines work when Gerrit requires hardware keys?

Build servers use dedicated non-human accounts that belong to a separate group in Gerrit. Admins restrict those bot accounts to strict network ranges and give them read-only branch roles.

What happens if a developer loses their FIDO2 security key?

An admin deletes the lost public key from the user profile in Gerrit and the identity system. The developer then logs in with a registered backup key to add a replacement token.

The query runs. The emails stay hidden.