The Infisical Gateway requires outbound network connectivity to establish secure SSH reverse tunnels with relay servers. This page outlines the required ports, protocols, and firewall configurations needed for optimal gateway usage.

Network Architecture

The gateway uses SSH reverse tunnels to establish secure connections with end-to-end encryption:
  1. Gateway connects outbound to Relay Servers using SSH over TCP
  2. Infisical platform establishes mTLS connections with gateways for application traffic
  3. Relay Servers route the doubly-encrypted traffic (mTLS payload within SSH tunnels) between the platform and gateways
  4. Double encryption ensures relay servers cannot access application data - only the platform and gateway can decrypt traffic

Required Network Connectivity

Outbound Connections (Required)

The gateway requires the following outbound connectivity:
ProtocolDestinationPortsPurpose
TCPRelay Servers2222SSH reverse tunnel establishment
TCPapp.infisical.com / eu.infisical.com443API communication and certificate requests

Relay Server Connectivity

For Instance Relays (Infisical Cloud): Your firewall must allow outbound connectivity to Infisical-managed relay servers. For Organization Relays: Your firewall must allow outbound connectivity to your own relay server IP addresses or hostnames. For Self-hosted Instance Relays: Your firewall must allow outbound connectivity to relay servers configured by your instance administrator.
Infisical provides multiple managed relay servers with static IP addresses. You can whitelist these IPs ahead of time based on which relay server you choose to connect to. Firewall requirements: Allow outbound TCP connections to the desired relay server IP on port 2222.

Protocol Details

SSH over TCP

The gateway uses SSH reverse tunnels for primary communication:
  • Port 2222: SSH connection to relay servers
  • Built-in features: Automatic reconnection, certificate-based authentication, encrypted tunneling
  • Encryption: SSH with certificate-based authentication and key exchange

Firewall Configuration for SSH

The gateway uses standard SSH over TCP, making firewall configuration straightforward.

TCP Connection Handling

SSH connections over TCP are stateful and handled seamlessly by all modern firewalls:
  • Established connections are automatically tracked
  • Return traffic is allowed for established outbound connections
  • No special configuration needed for connection tracking
  • Standard SSH protocol that enterprise firewalls handle well

Simplified Firewall Rules

Since SSH uses TCP, you only need simple outbound rules:
  1. Allow outbound TCP to relay servers (IP addresses or hostnames) on port 2222
  2. Allow outbound HTTPS to Infisical API endpoints on port 443
  3. No inbound rules required - all connections are outbound only

Common Network Scenarios

Corporate Firewalls

For corporate environments with strict egress filtering:
  1. Allow outbound TCP to relay servers (IP addresses or hostnames) on port 2222
  2. Allow outbound HTTPS to the Infisical API server on port 443
  3. No inbound rules required - all connections are outbound only
  4. Standard TCP rules - simple and straightforward configuration

Cloud Environments (AWS/GCP/Azure)

Configure security groups to allow:
  • Outbound TCP to relay servers (IP addresses or hostnames) on port 2222
  • Outbound HTTPS to app.infisical.com/eu.infisical.com on port 443
  • No inbound rules required - SSH reverse tunnels are outbound only

Frequently Asked Questions