Relay Overview
Understand how the AsPeekIt Discovery Relay bridges your cloud-hosted platform with private networks, enabling discovery of on-premise Kubernetes clusters, vSphere environments, SNMP devices, and more.
What Is a Discovery Relay?
The AsPeekIt platform runs in the cloud, but many discovery targets — Kubernetes clusters, VMware vSphere hosts, network switches, SNMP devices — reside in private networks that are not reachable from the internet. A Discovery Relay solves this by running inside your private network. It polls the AsPeekIt backend for its assigned environments, executes collectors locally against private targets, and pushes the results back to the platform over HTTPS.
Note: The Relay is different from the Agent. An Agent runs on individual hosts to discover local processes, connections, and certificates. A Relay runs at the environment level — it discovers entire Kubernetes clusters, vSphere data centres, or network segments from within the private network.
Architecture
The relay works on a pull-push model over outbound HTTPS only. It authenticates every request with X-Relay-ID and X-API-Key.
- Config poll: GET /api/v1/relay/config/ returns the full (unmasked) connection configuration of every active discovery zone assigned to the relay, plus the pending jobs of those zones, which the relay claims atomically. The relay polls it every config_poll_interval_minutes (default 60; the backend can override it) and checks for pending jobs every job_poll_interval_seconds (default 30), so a discovery started from the UI starts quickly.
- Discovery execution: the relay runs the collector matching each zone type at the zone interval, at most max_concurrent_jobs at a time, each within job_timeout_minutes.
- Results push: POST /api/v1/relay/results/ with the assets and dependencies of a run; the backend accepts results only for active zones assigned to the relay (403 otherwise). Unseen assets are marked inactive only for a complete result.
- Image scans: for Kubernetes zones with the image scan enabled, the relay scans the pod images with its Trivy client and sends them to POST /api/v1/relay/image-scans/ (see Container Image Scanning).
- Heartbeat: POST /api/v1/relay/heartbeat/ every heartbeat_interval_seconds (default 300) with version, host details and running jobs. The relay is marked stale after RELAY_STALE_AFTER_MINUTES (default 15) and offline after RELAY_OFFLINE_AFTER_MINUTES (default 60) without contact.
Supported Collectors
The relay ships with collectors for the private-network zone types. Each collector is selected from the type of the assigned discovery zone; the relay logs the supported ones at start ("[main] Supported collectors: ..."). Azure and GCP zones are not supported by the relay: their jobs fail with "environment type ... is not supported by relay; configure it for backend-side discovery instead", and the Relays page does not offer agent zones.
- Kubernetes — Discovers namespaces, deployments, statefulsets, daemonsets, pods, services, ingresses, configmaps, PVCs, and nodes using client-go. Each pod lists its containers (init and ephemeral containers excluded) with name, image, image_id, ready and restart_count, with the same field names as the backend Kubernetes collector (without ports); the backend turns them into docker_image components (origin k8s) with the registry digest taken from image_id. Results of older relays, which only send the container count, leave the image components untouched
- Network — Performs TCP port scanning and optional ICMP ping sweeps across CIDR ranges to discover network hosts and open services
- SNMP — Queries SNMP-enabled devices (switches, routers, printers, UPS) using SNMPv2c or SNMPv3 to discover network equipment and interfaces
- VMware vSphere — Connects to vCenter or ESXi hosts via the vSphere API to discover data centres, clusters, hosts, VMs, datastores, and networks
- Prometheus — Queries a Prometheus server to discover monitored targets and their metadata
- Zabbix — Queries the Zabbix JSON-RPC API to import hosts, host groups, and monitored items
- Grafana Tempo — Queries the Tempo API to discover services from distributed traces
Security Model
Relays use their own API keys, separate from user tokens and agent keys. Keys start with idpr_, are stored as SHA-256 hashes and are shown once at creation. Because a relay key unlocks the credentials of the assigned zones, only admins can create relay keys (API Keys in the menu of the relay card) and assign zones to a relay; managers can register, disable and delete relays and revoke keys.
- Bound keys belong to one relay and work only with its relay_id ("API key does not match relay" otherwise). Keys created from the relay card are bound.
- An unbound (bootstrap) key, created through the API without a relay, can register a new relay_id once. After that the relay must use a key bound to it: the backend rejects unbound keys for a relay_id that already exists ("Relay already registered; use its relay-specific API key").
- Keys can have an expiry (expires_at, API) and can be revoked at any time; a disabled relay is refused ("Relay is disabled").
- All communication is outbound HTTPS: no inbound port has to be opened in the private network.
Warning: The relay receives unmasked connection credentials for its assigned zones. Store its API key securely and run it on a trusted host.
Deployment Options
The relay is a single Go binary built from the relay/ directory of the repository (the platform does not serve relay downloads). Three deployment options are provided:
- Linux VM or bare metal: build with make relay-build and run it with the systemd unit of relay/deploy/systemd
- Docker: build the image with make relay-docker (it also ships the Trivy client used by the Kubernetes image scan)
- Kubernetes: the Helm chart in relay/deploy/helm/idp-relay, with a ServiceAccount and a read-only ClusterRole for in-cluster discovery
Quick Start Summary
On the Relays page (Discovery section of the navigation): (1) click Create relay and enter its Relay ID, (2) have an admin create an API key from API Keys in the relay card menu, (3) have an admin choose "Assign discovery zones" in the same menu, (4) install the relay inside the target network with that relay_id and key, (5) start it: it polls its configuration, runs the discoveries and reports the results. Assigned zones switch to relay discovery mode; deleting the relay reverts them to local discovery.
Note: See Relay Installation & Deployment for each deployment method.
