Skip to content

Infrastructure Gateways

An infrastructure gateway is a single entry point that mediates access to internal services. Rather than exposing multiple services directly, all traffic flows through the gateway, which handles authentication, authorization, and logging centrally.

Each service manages its own security:

Problems:

  • Each service must implement authentication
  • Access policies may be inconsistent
  • Audit logging is fragmented
  • Attack surface is larger

All access flows through a single point:

Benefits:

  • Single authentication implementation
  • Consistent access policies
  • Unified audit logging
  • Reduced attack surface

A well-designed gateway handles:

ResponsibilityDescription
AuthenticationVerify user identity
AuthorizationCheck permissions for each request
Rate LimitingPrevent abuse and DoS
LoggingRecord all access for audit
Request RoutingDirect requests to appropriate services
Protocol TranslationConvert between protocols if needed
TLS TerminationHandle encryption at the edge

Manages access to APIs, typically for web and mobile applications:

Mobile App → API Gateway → Microservices
Web App → ↗

Focus: Developer experience, rate limiting, API versioning

Protects internal web applications:

User → IAP → Internal Apps
Identity Provider

Focus: User authentication, single sign-on

Secures access to infrastructure tools and APIs:

Admin → Infrastructure Gateway → Cloud APIs
DevOps → → Container Orchestration
CI/CD → → Database Admin

Focus: RBAC, audit logging, compliance

Rack Gateway is an infrastructure gateway for Convox rack access.

Rack Gateway follows a single-tenant model:

Production Rack:
└── Rack Gateway (Production)
└── Convox API
Staging Rack:
└── Rack Gateway (Staging)
└── Convox API

Each gateway:

  • Serves one rack
  • Has its own database
  • Has its own user base
  • Has its own audit logs

Benefits:

  • Complete isolation between environments
  • Independent policies per rack
  • Separate audit trails
  • Simpler failure domains

The gateway adds security layers:

Layer 1: Network (VPN/Tailscale)
Layer 2: Authentication (OAuth)
Layer 3: Authorization (RBAC)
Layer 4: MFA (step-up)
Layer 5: Audit (logging)
Protected Resource

Each layer must be passed before reaching the resource.

All traffic flows through one point:

Security implications:

  • Easier to monitor all access
  • Policy changes apply universally
  • Single point to audit

The gateway holds the Convox API token; users don’t:

Traditional:
User → Convox Token → Convox API
With Gateway:
User → Session Token → Gateway → Convox Token → Convox API
Token never exposed

Benefits:

  • Convox token never leaves server
  • Users can be revoked without rotating token
  • Token usage is logged per-user

The gateway is a natural enforcement point for zero trust:

Zero Trust PrincipleGateway Implementation
Verify explicitlyEvery request authenticated
Least privilegeRBAC with minimal permissions
Assume breachAll actions logged, MFA required

See Zero Trust Security for more.

MethodUse CaseRack Gateway
OAuth/OIDCInteractive users✅ Google OAuth
API TokensCI/CD, automation✅ Supported
mTLSService-to-serviceNot needed
API KeysSimple automationAPI tokens
ModelComplexityRack Gateway
Allow/Deny listsLow✅ ADMIN_USERS
RBACMedium✅ Primary model
ABACHighFuture consideration

Gateway deployed alongside each service:

Pod:
├── Application Container
└── Gateway Sidecar

Use case: Service mesh (Istio, Linkerd)

Single gateway for all services:

Gateway Cluster → Service A
→ Service B
→ Service C

Use case: Rack Gateway, API gateways

Centralized gateway with service-specific policies:

Central Gateway → Per-Service Gateways → Services

Use case: Large organizations with diverse requirements

Problem: If the gateway goes down, nothing works

Solutions:

  • Run multiple gateway instances (HA)
  • Load balancer with health checks
  • Graceful degradation (read-only mode)

Problem: Services still accessible without gateway

Solutions:

  • Network segmentation (services only reachable from gateway)
  • Service-level authentication (mTLS)
  • Audit for direct access attempts

Problem: Gateway needs credentials for all backend services

Solutions:

  • Centralized secret management (Vault)
  • IAM roles for AWS services
  • Short-lived tokens where possible

Problem: Logging everything creates too much data

Solutions:

  • Structured logging for efficient querying
  • Log aggregation and rotation
  • Sampling for high-volume endpoints
ResourceProtection
Convox APIAll operations authenticated and authorized
App deploymentsDeploy approval workflow
Environment variablesSecret redaction in logs
Exec accessMFA for sensitive operations
Recommended:
Internet → VPN/Tailscale → Rack Gateway → Convox
Optional (with TLS):
Internet → TLS → Rack Gateway → Convox
convox.yml
services:
gateway:
domain: gateway.example.com
port: 8443
resources:
- database
environment:
- RACK_HOST=rack.example.com
- RACK_TOKEN # From Convox resources
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
- ADMIN_USERS=admin@example.com
resources:
database:
type: postgres
  1. Gateways centralize security at a single enforcement point
  2. Single-tenant design provides isolation between environments
  3. Credential isolation keeps sensitive tokens server-side
  4. Zero trust integrates naturally with gateway architecture
  5. High availability is essential—gateways are critical path
  6. Network segmentation prevents gateway bypass