GitHub Ports

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up github ports, open the configured port for HTTPS and the configured port for SSH. If the configured port is blocked, route SSH traffic over the configured port to push and pull code. Network teams often open these ports across whole subnets so developers can work fast. Still, broad firewall rules and wide user roles let anyone on the network run risky commands. Teams need clear port rules paired with tight access checks to keep code and systems safe. How github ports work for cloud a

GitHub Actions Security: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

To set up github ports, open the configured port for HTTPS and the configured port for SSH. If the configured port is blocked, route SSH traffic over the configured port to push and pull code. Network teams often open these ports across whole subnets so developers can work fast. Still, broad firewall rules and wide user roles let anyone on the network run risky commands. Teams need clear port rules paired with tight access checks to keep code and systems safe.

How github ports work for cloud and self-hosted servers

Every git action moves over a specific network port between the user machine and the server. The configured port handles web browser traffic, API calls, and git clone or push actions over HTTPS. The configured port handles standard SSH connections when developers use SSH keys to check their identity. Some strict office or cloud networks block the configured port to stop bad actors from moving sideways. In those networks, engineers can tell their SSH client to talk to the SSH host on the configured port. This trick keeps SSH key checks working while sending packets through standard web firewall rules.

Self-hosted enterprise servers need extra ports open for management, mail, and high availability replication. Admins use a dedicated management port over HTTPS to set up the server and check health. Separate ports handle plain web requests that redirect to secure links, plus mail ports for alerts. When teams run backup nodes, they also open cluster ports so databases and git data stay synced. Keeping these admin and sync ports closed to normal users prevents tampering with core server settings.

What firewall rules solve and what they leave open

Network port rules control which machines can reach the git server or its admin panel. Blocking admin ports from public networks stops outside attackers from probing setup screens or sync tools. Restricting outbound ports on build servers also stops rogue scripts from sending stolen code to outside hosts. Together with SSH keys and personal tokens, port rules verify where traffic starts and who logs in.

Still, a firewall rule only checks the network address and port before the session begins. Once a user or build runner connects over the configured port or 443, the port keeps the session active. Standard port rules and broad repo roles do not inspect individual git actions or API requests in flight. A valid token on an open port can delete branches, pull private data, or alter build pipelines. Static keys stored on laptops or build servers also stay valid until someone revokes them by hand. If a token leaks, anyone who can reach the configured port can act as that developer. Teams also lack detailed logs when many automated jobs share one service key over the same port.

Best practices for locking down git network traffic

Start by separating user traffic ports from server admin ports at the network boundary. Let developer machines and build runners reach only the configured port and the configured port on git hosts. Restrict management ports to a small set of admin addresses on a private management network. Turn off legacy unencrypted git protocol ports so every clone and push uses strong encryption.

GitHub Actions Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Next, pair port limits with short-lived credentials and narrow repo roles for both humans and bots. Replace long-lived personal tokens and static SSH keys with short sessions tied to your identity provider. Give automated build jobs read-only access by default, and require extra checks before write actions run. Review outbound traffic logs on build nodes to spot odd connections on unexpected ports right away.

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

Which port should I open if my firewall blocks the configured port?

You can route SSH git traffic over the configured port to bypass blocks on the configured port. Point your SSH client to the alternate SSH hostname on the configured port so pushes still use SSH keys.

Do build runners need inbound ports open to talk to git servers?

Self-hosted build runners only need outbound access on the configured port to poll jobs and fetch code. You do not need to open inbound firewall ports on your runner machines for normal builds.

Why should teams block the legacy git protocol port?

The legacy git protocol port sends data without encryption or user identity checks on the wire. Blocking that port forces all traffic onto the configured port or the configured port where encryption and login checks apply.

Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.