The Simplest Way to Make Fortigate and Gogs Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

You pair fortigate and gogs to protect self-hosted Git code behind a strict network firewall. The firewall filters incoming traffic while the Git server hosts private code for your team. This setup lets developers push and pull code without exposing the Git host to everyone. Network admins set clear rules on who can reach the server and when. Both tools run well on small servers and do not need heavy hardware. When you link them well, your team gets fast Git speed and strong network safety. H

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.

You pair fortigate and gogs to protect self-hosted Git code behind a strict network firewall. The firewall filters incoming traffic while the Git server hosts private code for your team.

This setup lets developers push and pull code without exposing the Git host to everyone. Network admins set clear rules on who can reach the server and when. Both tools run well on small servers and do not need heavy hardware. When you link them well, your team gets fast Git speed and strong network safety.

How fortigate and gogs handle user log in and data flow

Every Git push or pull starts at the edge of your network. A developer sends code over HTTPS or SSH toward the internal Git server. The firewall sits at the edge and checks the source address and port first. If the network rule allows the packet, the firewall forwards it to the Git host.

Once traffic hits the Git server, the app asks the user to log in. Users can log in with a local password, an SSH key, or an identity group. You can link both the firewall and the Git server to the same central directory. This means one team group controls both the network path and the code role.

Data flows back to the developer along the same guarded path. The firewall inspects the stream for bad packets and blocks floods of fake requests. The Git server reads from its local disk and sends the requested code commits. Both tools write an event to their local logs when the transfer finishes.

Common failure modes and how to scope roles

Many teams make the mistake of opening wide firewall ports to the whole internet. An open SSH port invites bots to guess passwords on your Git server all day. Instead, require users to join a private network tunnel before they reach the Git host. Then set the firewall rule to allow traffic only from that internal tunnel subnet.

Shared service accounts also create big blind spots during a security review. Teams often put one static Git token into five different build scripts. When a script breaks or leaks code, the log only shows the shared bot name. Give each build worker its own service account with read-only permissions on one repo.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Broad admin roles inside the Git app cause trouble when people change jobs. If ten people have full admin rights, anyone can delete a main code branch. Give most developers standard write roles and require pull requests on main branches. Keep full admin roles limited to two or three owners who run the host.

Unlogged database queries and missing network logs also hurt your team during an audit. The Git server stores user metadata and issues inside a backing database. If an admin edits that database by hand, the Git app log misses the change. Always log both firewall flow events and database queries in one central log store.

Managing network paths for build workers and webhooks

Your Git server often needs to send webhook alerts to external build tools. If the firewall blocks all outbound calls, your build scripts will never start. Create a narrow outbound rule that only allows the Git host to reach your build server. Block the Git host from reaching any other internal subnets or database ports.

Build workers also need a clean path back into the Git server to pull code. Put your build workers in their own network zone with a dedicated firewall rule. This stops a broken build container from scanning the rest of your office network. Check these network rules every quarter and delete paths for old build servers.

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

Should I expose my Gogs SSH port through the Fortigate firewall?

No, do not open the SSH port to the public web. Require developers to log in through a private network tunnel first, then allow SSH only from that subnet.

How do I stop bots from guessing passwords on the Git login page?

Keep the web login page behind your private firewall rules so public bots cannot reach it. You should also turn on multi-factor login for every user account.

How should build servers pull code across the firewall?

Place build workers in a separate network zone with a strict firewall rule to the Git host. Give each worker a scoped deploy key with read-only permissions.

The query runs. The emails stay hidden.