Feature Requests
New / Open / Unreviewed

Generic TCP Forwarding over the Existing Agent WebSocket

Summary:

Add a generic TCP forwarding capability to PatchMon that allows local TCP services running on an agent to securely reach predefined server-side services through the existing PatchMon WebSocket connection.

The feature should act as a transparent TCP transport layer, without understanding or inspecting the application protocol.

A first implementation (V1) should intentionally remain simple:

  • no UI
  • file-based configuration on the agent
  • environment-based configuration on the server
  • no arbitrary destination chosen by the agent
  • only predefined logical services exposed by the server
  • opaque TCP byte forwarding

This feature would make PatchMon useful for many monitoring and management protocols while keeping a very small security surface.

Motivation :

Many monitoring agents and infrastructure tools initiate outbound TCP connections to central services.

In environments protected by firewalls or NAT, opening inbound ports is often undesirable or impossible.

PatchMon already maintains a secure WebSocket connection between the agent and the server. This connection could also transport arbitrary TCP streams, allowing local applications to communicate with centrally exposed services without requiring additional firewall rules.

Rather than implementing protocol-specific integrations, PatchMon could provide a generic TCP transport reusable for multiple use cases.

Potential examples include:

  • Zabbix active agent
  • proprietary monitoring agents
  • custom TCP applications

1 Comment

Posting anonymously

benasse·8 days ago

Proposed Design

Agent configuration

Example:

tcp_forwards:
- name: zabbix-active
listen: 127.0.0.1:10051
remote_service: zabbix-proxy
enabled: true
max_connections: 32
idle_timeout_seconds: 300

Responsibilities:

  • start one TCP listener per configured forward
  • only allow loopback listeners by default
  • accept local TCP connections
  • create one session per connection
  • transport TCP bytes through the existing WebSocket
  • cleanly close sessions on disconnect, timeout or errors

Server configuration

Example:

{
"zabbix-proxy": {
"target": "zabbix-proxy.internal:10051",
"allowed_agents": ["*"],
"max_connections_per_agent": 64,
"connect_timeout_seconds": 10,
"idle_timeout_seconds": 300
}
}

Responsibilities:

  • resolve logical service names
  • reject unknown services
  • validate agent authorization
  • establish outbound TCP connections
  • relay TCP traffic in both directions
  • enforce connection limits and idle timeouts

Posting anonymously