Skip to content

feat: gateway v2#12

Merged
sheensantoscapadngan merged 38 commits into
mainfrom
feat/gateway-v2
Sep 10, 2025
Merged

feat: gateway v2#12
sheensantoscapadngan merged 38 commits into
mainfrom
feat/gateway-v2

Conversation

@sheensantoscapadngan
Copy link
Copy Markdown
Member

@sheensantoscapadngan sheensantoscapadngan commented Aug 29, 2025

Description 📣

This PR adds support for the CLI commands to launch the gateway v2 components

Related PR:
Infisical/infisical#4462

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

@sheensantoscapadngan sheensantoscapadngan marked this pull request as ready for review September 3, 2025 12:48
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR introduces the foundational scaffolding for Gateway v2, a new secure networking architecture that enables Infisical to manage secrets across distributed environments through proxy/gateway infrastructure. The implementation adds several key components:

New Proxy Package (packages/proxy/proxy.go): Implements a secure proxy server that acts as an intermediary between clients and gateways. It features certificate-based authentication, SSH tunneling for gateway connections, TLS for client connections, and automatic certificate renewal. The proxy validates SSH certificates with gateway authorization and handles bidirectional TCP forwarding with proper connection management.

Gateway v2 Package (packages/gateway-v2/): Creates the client-side gateway component that connects to proxies through secure SSH tunnels wrapped with mTLS. It includes specialized HTTP proxy functionality for Kubernetes environments, supporting service account token injection and certificate-based routing using custom OID extensions. The gateway handles multiple forwarding modes (HTTP, TCP, PING) and includes heartbeat monitoring.

API Extensions (packages/api/): Adds four new API endpoints to support v2 functionality: CallGatewayHeartBeatV2, CallRegisterInstanceProxy, CallRegisterProxy, and CallRegisterGateway. The corresponding model structures define PKI certificates and SSH key management for secure communication between components.

CLI Integration (packages/cmd/network.go): Introduces new network commands under infisical network proxy and infisical network gateway with systemd service integration for production deployments. The implementation includes token refresh mechanisms, graceful shutdown handling, and support for both 'instance' and 'org' authentication modes.

This architecture enables secure secret management across network boundaries, supporting air-gapped environments and Kubernetes integration where the proxy acts as a bridge between Infisical services and client applications.

Confidence score: 2/5

  • This PR contains multiple critical security vulnerabilities that could lead to unauthorized access and data exposure
  • Score reflects serious concerns with DNS manipulation attacks, information disclosure through logging, and inadequate input validation across multiple security-critical components
  • Pay close attention to packages/gateway-v2/gateway.go, packages/proxy/proxy.go, and packages/gateway-v2/connection.go for security issues

8 files reviewed, 10 comments

Edit Code Review Bot Settings | Greptile

Comment thread packages/proxy/proxy.go Outdated
Comment thread packages/api/api.go Outdated
Comment thread packages/gateway-v2/constants.go Outdated
Comment thread packages/cmd/network.go Outdated
Comment thread packages/cmd/network.go Outdated
Comment thread packages/gateway-v2/connection.go
Comment thread packages/gateway-v2/gateway.go Outdated
Comment thread packages/gateway-v2/gateway.go
Comment thread packages/gateway-v2/gateway.go Outdated
Comment thread packages/gateway-v2/gateway.go Outdated
@sheensantoscapadngan sheensantoscapadngan changed the title WIP feat: gateway v2 scaffolding feat: gateway v2 Sep 3, 2025
Comment thread packages/proxy/proxy.go
Comment thread packages/cmd/network.go Outdated
@sheensantoscapadngan sheensantoscapadngan merged commit cc399aa into main Sep 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants