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

Published
Length
3 min read

Luis Felipe Dias

All posts

Running gerrit and iis together lets Windows teams host Git code reviews behind a web server. IIS takes incoming web traffic and sends it to the Gerrit backend service. This setup helps teams use existing Windows domain accounts for code review logins. It also lets system admins manage TLS certificates in one central Windows tool. Teams get fast Git reviews while keeping standard Windows server rules in place. How login and data flow between gerrit and iis In this setup, IIS sits at the netwo

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 gerrit and iis together lets Windows teams host Git code reviews behind a web server. IIS takes incoming web traffic and sends it to the Gerrit backend service. This setup helps teams use existing Windows domain accounts for code review logins. It also lets system admins manage TLS certificates in one central Windows tool. Teams get fast Git reviews while keeping standard Windows server rules in place.

How login and data flow between gerrit and iis

In this setup, IIS sits at the network edge and handles user requests. A developer opens the code review web page or pushes code over HTTP. IIS checks the TLS certificate and reads the incoming web request headers first. If the team uses Windows login, IIS checks the user identity against Active Directory. After that check passes, IIS forwards the clean request to the local Gerrit service.

Gerrit runs as a Java service on the same host or a nearby server. It trusts the user header that IIS sends over the local network link. Gerrit then matches that user name to its own internal group and role list. The role decides if the user can read code, vote on changes, or merge branches. All Git data and review comments flow back through IIS to the developer.

This split design keeps web traffic rules separate from Git repo rules. Windows admins manage web ports, firewall rules, and certificates inside IIS as usual. At the same time, Git admins control branch rules and code review scores inside Gerrit. Both tools do what they do best without stepping on each other.

Common failure modes and how to scope roles

Many teams hit trouble when headers get changed between the two servers. IIS often rewrites URL paths or drops custom headers before forwarding the web request. When that happens, Gerrit sees a broken path and returns a login error page. Admins must set up IIS URL rewrite rules to pass the raw URL straight through. They also need to allow long request paths for deep Git repo names.

Another big risk comes from open local ports and shared service accounts. If the backend port on Gerrit keeps the session active to the whole network, anyone can spoof headers. A bad actor could send a fake user header directly to Gerrit and bypass IIS. To fix this, bind Gerrit to the local loopback address or restrict the firewall port. Only the IIS host should have network rights to talk to the Gerrit web port.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Shared build accounts also create huge blind spots in your audit logs. Teams often create one broad admin token for build scripts and server tasks. When a script merges bad code, the logs do not show who triggered the run. Instead, give each build job a distinct account with read or vote rights on one project. Scope every role to the smallest set of branches needed for the task.

Keeping logs and secrets safe across both servers

Good audit trails require matching logs from both the web server and the Git server. IIS logs show the client IP address, request time, and web status code. Gerrit logs show the exact Git command, branch name, and review score change. Admins should send both log streams to one central log store for easy search. Make sure both servers use the same time clock so log events line up.

Developers also put sensitive data into code comments or test files by mistake. Data masking tools can rewrite emails, phone numbers, card numbers, and national IDs in results. This step stops raw personal data from spreading across test logs and review pages. Keep database keys and server passwords out of Git repos at all times.

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

Why does Gerrit show a login loop behind IIS?

A login loop happens when IIS strips the user header or rewrites the base URL. Check that IIS passes the exact auth header name that Gerrit expects to read. Also make sure the canonical web URL in Gerrit matches the public IIS web address.

Can developers still use SSH with Gerrit when IIS is in front?

Yes, IIS only handles HTTP and HTTPS web traffic for the browser and Git client. Gerrit runs its own built-in SSH server on a separate network port. Developers can push and pull code over SSH directly if the firewall allows that port.

How do we stop users from bypassing IIS to reach Gerrit?

Set Gerrit to listen only on localhost if both tools run on the same machine. If they run on separate hosts, use Windows Firewall rules to block the Gerrit port. Only allow traffic coming from the exact IP address of the IIS server.

The query runs. The emails stay hidden.