Procy Docs
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeProcy home API GitHub Sign in

Tunnel activity

A tunnel is a public port on the server, guarded only by its ACL (the addresses allowed to use it). Tunnel activity shows who used your tunnels: every connection attempt, from which address, to which device and tunnel, whether the ACL let it in, how long it lasted and how much it carried, and which server took it. It applies to hosted Procy and to self-hosted servers.

What is recorded

The server that holds a tunnel records each attempt to use it:

  • TCP tunnels: one entry per connection.
  • UDP tunnels: one entry per flow, the datagrams from one source address. A flow ends after 2 minutes without datagrams.
  • Tunnels through the browser (RDP, VNC and HTTP through the tunnel proxy): one entry per connection to the proxy, with the real address of the browser.
  • Denied attempts are grouped: all attempts of one address on one tunnel within a minute make one entry, with the number of attempts. A port scan can’t flood the log.

Each entry has:

FieldMeaning
idthe entry’s id
client_id, client_namethe device (client_name is empty when it isn’t known)
tunnel_id, scheme, protocolthe tunnel, its service (ssh, rdp, …) and tcp, udp or proxy
local_port, remotethe tunnel’s public port on the server and its target on the device’s side
node_idthe server that carried it (in a cluster)
source_ip, source_portwhere the connection came from (the port is 0 for grouped denials)
status, reason, attemptsthe outcome and, for a denial or failure, why
started_at, ended_atwhen it started and ended (null while it is open)
bytes_to_device, bytes_to_userwhat it carried each way
stateactive, closed or lost
source_familiarwhether the address signed in to your organization lately

Outcomes

  • allowed: the ACL let the connection in. It may still be open.
  • denied: the tunnel’s ACL turned the address away.
  • failed: the connection was allowed, but the server couldn’t reach the tunnel’s target through the device.

States

  • active: the connection is open, and the server holding it has been running since it started.
  • closed: the connection ended. Denied and failed attempts are always closed: they hold nothing open.
  • lost: the connection was never reported as ended, and the server that held it restarted or went away since. The connection was cut then.

Familiar sources

An address is familiar when someone signed in to your organization’s API or web interface from it in the last 30 days. A connection from an unfamiliar address isn’t wrong by itself (a device admin working from a new network, for example), but it is worth a look, above all when the tunnel has no ACL. Self-hosted servers without Postgres can’t tell, and report null.

Retention

Entries are kept 30 days, like the device connection events, then deleted.

Privacy

Only addresses, ports, counts and timing are recorded. Nothing that passes through a tunnel is read or kept.

In the web interface

Users with the audit log permission find Tunnel activity in the settings, next to the audit log. It shows the last 24 hours (connections, denied attempts, failures, connections active now and unfamiliar sources), the connections per server, and the list of connections with filters by device, tunnel, outcome, state, server and source. Unfamiliar sources and denials stand out.

The Tunnels page and each device’s tunnel list mark tunnels without an ACL as Open to any address. Give such tunnels an ACL (see managing tunnels) unless they really must be reachable from anywhere.

API

Both routes need the audit log permission and return only your organization’s connections. GET /api/v1/status reports "tunnel_activity": true in its capabilities where the server offers them.

List connections

GET /api/v1/tunnel-activity, newest first, takes:

  • filter[client_id], filter[tunnel_id], filter[node_id], filter[source_ip]: exact matches;
  • filter[status]: a comma list of allowed, denied and failed;
  • filter[state]: active, closed or lost;
  • filter[since], filter[until]: RFC 3339 times (the connection’s start);
  • page[limit] (default 50, at most 500) and page[offset].
curl -s -u "$CREDS" "$PROCY/tunnel-activity?filter[status]=denied&page[limit]=20"
{
  "data": [
    {
      "id": "8c1f...", "client_id": "a1b2c3", "client_name": "Office router", "tunnel_id": "1", "node_id": "node-1",
      "protocol": "tcp", "scheme": "ssh", "local_port": 20005, "remote": "127.0.0.1:22",
      "source_ip": "203.0.113.7", "source_port": 0, "status": "denied", "reason": "", "attempts": 12,
      "started_at": "2026-11-28T10:00:00Z", "ended_at": "2026-11-28T10:01:00Z", "state": "closed",
      "bytes_to_device": 0, "bytes_to_user": 0, "source_familiar": false
    }
  ],
  "meta": {"count": 1}
}

Summary

GET /api/v1/tunnel-activity/summary?hours=24 (1 to 720, default 24) counts the connections that started in the period, and those active now:

{
  "data": {
    "since": "2026-11-27T10:00:00Z", "allowed": 40, "denied": 3, "denied_attempts": 57, "failed": 1, "active": 2,
    "distinct_sources": 6, "unfamiliar_sources": 1,
    "by_node": [{"node_id": "node-1", "allowed": 40, "denied": 3, "denied_attempts": 57, "failed": 1}]
  }
}

denied counts entries and denied_attempts the attempts in them. unfamiliar_sources counts the addresses of allowed connections that weren’t familiar (null where the server can’t tell).

Invalid parameters (an unknown status or state, a time that isn’t RFC 3339, a limit or period out of range) are answered with 400 Bad Request.

Operator checks

Platform operators of a cluster find Tunnel security in the operator console. It reads the activity of every organization: totals, per organization and per server, and two isolation checks.

  • Cross-organization sources: allowed connections to one organization’s tunnels from an address that, in the period, signed in to other organizations (or to the operator console) and never to that organization. This can be harmless (a consultant who works for several organizations, a shared office network), but it is how one organization using another’s tunnel would show.
  • Open tunnels: tunnels without an ACL on devices that are online. Anyone on the internet who finds the port can try to use them.

The operator overview lists both when they aren’t zero. The server detail shows a server’s recent tunnel connections, and an organization’s detail its tunnel activity.

The operator API serves the same:

  • GET /api/v1/operator/tunnel-activity takes org, node, client_id, status (a comma list), state, source_ip, limit (default 50, at most 500) and offset. Each entry is as above, with org and org_name.
  • GET /api/v1/operator/tunnel-activity/summary?days=7 (1 to 30): totals, organizations (with activity or open tunnels), servers, cross_org_signals and open_tunnels.
  • GET /api/v1/operator/tunnel-activity/cross-org?days=30 (1 to 30): one entry per organization and address, with the connections, their first and last time, the tunnels and devices used, and the other organizations (other_orgs; the operators show as “Operators”).
  • GET /api/v1/operator/tunnel-activity/open-tunnels: the open tunnels with their organization, device, server, public port and target.

An address counts as an organization’s when one of its members used the API from it: an API session (kept until it expires) or a successful password or OIDC sign-in in the organization’s audit log. Sign-ins of the last 30 days count even after their session is gone; API tokens used without a session are not counted.

Upgrading a cluster

Device processes record their tunnel activity through the database function ingest_tunnel_connections. Run rportd migrate --grant-to <application role> --grant-device-to <device role> after installing this release, as for every release, so the device role may call it. A device process whose role lacks the grant still starts: it logs a warning once and keeps its tunnel activity in its outbox until the grant is given.

A device process of an earlier release refuses to start while its role may execute ingest_tunnel_connections (it allows no SECURITY DEFINER function it doesn’t know). Upgrade the device processes before granting, and to roll one back, revoke it first: REVOKE EXECUTE ON FUNCTION ingest_tunnel_connections(jsonb) FROM <device role>.

To roll a device process back below this release, take the grant back first, because a device process refuses to start when its role may run a database function it doesn’t know:

REVOKE EXECUTE ON FUNCTION ingest_tunnel_connections(jsonb) FROM <device role>;