The Simplest Way to Make Gerrit and Windows Server 2019 Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair gerrit and windows server 2019 to run code reviews on existing enterprise hosts. This setup lets developers push changes while admins manage permissions through Windows directory groups. Many groups already run Windows hosts for internal tools and file storage. Running your Git review system on the same host saves money and time. Still, making a Java review app behave on a Windows host takes careful planning. You must handle background services, file paths, and directory logins with

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.

Teams pair gerrit and windows server 2019 to run code reviews on existing enterprise hosts. This setup lets developers push changes while admins manage permissions through Windows directory groups.

Many groups already run Windows hosts for internal tools and file storage. Running your Git review system on the same host saves money and time. Still, making a Java review app behave on a Windows host takes careful planning. You must handle background services, file paths, and directory logins with care.

How logins and data flow in gerrit and windows server 2019

Gerrit runs on the Java Virtual Machine on top of the Windows host. Users send Git changes over SSH or HTTPS to the review service. The app then checks the user login against Active Directory over LDAP. Once the user logs in, the app reads group memberships from the directory.

Those directory groups map to review roles inside the code review tool. A developer role can push new patch sets and vote on code quality. A maintainer role can approve changes and merge them into the main branch. The Windows host writes all Git objects and review records to local NTFS disks.

For background execution, admins wrap the Java process as a Windows service. This step makes the review app start on boot without a human login. The service account needs read and write rights on the repo folder. It should not have full admin rights on the entire Windows machine.

Common failure modes and how to scope roles

Shared service accounts cause the biggest problems in this setup. Teams often run the review service under a domain admin account by mistake. If an attacker finds a bug in the app, they own the whole domain. Instead, create a dedicated local or domain account with narrow folder rights.

Broad network tokens and permanent SSH keys also create huge risks. Developers generate static SSH keys and leave them on old laptops. Build servers often use shared tokens that have write rights to every repo. If one build node gets compromised, every project in the company faces tampering.

Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

File system locking on Windows creates another frequent failure mode. Antivirus tools on Windows often scan Git pack files during a push. This scan locks the files and causes Git pushes or merges to fail. Admins must exclude the Git data folder from real-time file scans.

Unlogged admin actions also hurt security audits on Windows hosts. When three admins share one remote desktop login, logs show no clear owner. You cannot tell who changed a repo rule or edited the host settings. Give each admin a separate user account and log every command they run.

Scoping network paths and build server permissions

Good network rules keep the review server safe from outside attacks. Place the Windows host inside a private subnet behind a load balancer. Only open the specific ports needed for web traffic and SSH pushes. Block direct network traffic from user laptops to the database port.

Build runners also need tight permission scopes inside the review tool. Create a separate bot account for each build pipeline you run. Grant that bot read rights only on the repos it needs to test. Allow the bot to post test scores without giving it merge rights.

Review your Active Directory group mappings every quarter to remove old users. When someone leaves the team, disable their directory account right away. Keep your Java runtime and Windows security patches current every month.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can Gerrit use Active Directory on Windows Server 2019 for logins?

Yes, the review tool connects to Active Directory through the standard LDAP protocol. This lets users log in with their normal Windows passwords and maps groups to roles.

Why do Git pushes fail with file lock errors on Windows?

Windows background scanners and antivirus tools often lock new Git pack files during writes. Excluding the repo data folder from active scans fixes most file lock errors.

How should we run the Java review app in the background?

Register the Java process as a native Windows service using a dedicated low-privilege account. Set the service to start on boot so code reviews stay online after reboots.

The query runs. The emails stay hidden.