DocsTopology & DependenciesDependency Mapping

Dependency Mapping

How AsPeekIt detects, classifies, stores and expires the relationships between your infrastructure assets.


How Dependencies Are Detected

Collectors record dependencies while they discover assets, and each one stores how it was found in discovery_method. Some examples from the code:

  • Agent: applications and containers run_on their host (agent_process_match, agent_docker, confidence 1.0); outgoing connections of the host to the address of a known asset become dependencies (agent_connection_tracking, confidence 0.9), typed from the remote port (for example a database port gives database) and otherwise network
  • Kubernetes: owner references, label selectors of services, volume bindings, service accounts and secret references
  • Cloud collectors: VPC/VNet and subnet placement, security group assignment, load balancer target groups and frontend IPs, private links, CDN and Front Door origins, VPN tunnels
  • VMware vSphere: inventory hierarchy, runtime placement and VM configuration
  • Network: SNMP LLDP and CDP neighbours
  • Monitoring and tracing: Zabbix triggers and the Grafana Tempo service graph
  • AI inference (llm): proposals with a lower confidence that never overwrite a dependency found by a collector

Note: A dependency of an asset on itself is never stored, and type aliases are normalised (http and grpc become api, cache and sql become database, queue becomes messaging, …).

Agent Connections

The agent reports the TCP connections of its host. Connections whose remote address belongs to an active asset of any discovery zone become dependencies from the host to that asset, with the remote port, the protocol and, in the metadata, the service name, the process name and whether the target is in another zone.

  • The agent leaves out the sockets of its own process and of its child processes (for example the Trivy image scanner): its reports, commands and image scans to the platform are not dependencies of the host
  • Connection-tracked dependencies expire: the hourly expire-connection-dependencies task deactivates those not seen again for DEPENDENCY_CONNECTION_TTL_HOURS (default 24). Long-lived connections are seen again at every report and stay active; transient ones (one session on an ephemeral port, a one-off client) leave the map. A value of 0 or less disables the expiry
  • An expired dependency that is seen again is reactivated by the next agent report
  • Declared relationships (Kubernetes, cloud, vSphere, runs_on, …) never expire this way

Dependency Types

Every dependency has one of the following types. The type determines the edge colour in the topology graph and which relations business services follow (runs_on and depends_on).

  • network: TCP/UDP network connection between two assets
  • database: Application connecting to a database instance
  • api: HTTP/REST/gRPC API call between services
  • messaging: Connection through a message broker or event bus
  • runs_on: A process, container, or service running on a host or cluster
  • contains: Hierarchical containment (e.g., a namespace contains pods, a VNet contains subnets)
  • load_balances: A load balancer distributing traffic to one or more backends
  • depends_on: A generic dependency when a more specific type cannot be determined
  • managed_by: An asset managed by a control plane or management service
  • storage: An asset using a storage resource such as a disk, volume, or object store
  • auth: Authentication or authorization dependency (e.g., service to identity provider)
  • monitored_by: A monitoring or observability system collecting data from an asset
  • traced_by: A distributed tracing system collecting traces from an asset
  • unknown: The dependency was detected but could not be classified

Dependency Data Model

Each dependency record contains these fields:

  • source: the asset that initiates or owns the dependency
  • target: the asset being depended on
  • dependency_type: one of the types listed above
  • port: optional port number of the connection (e.g., 5432 for PostgreSQL)
  • protocol: optional protocol (e.g., tcp, udp)
  • endpoint: optional endpoint or URL
  • confidence: a number between 0 and 1 set by the collector that found it
  • is_active: whether the dependency is currently valid; inactive dependencies are not drawn in the topology
  • last_seen: the last time a discovery reported it
  • discovered_by and discovery_method: the collector and the method that found it
  • attributes: extra metadata (for agent connections: service, process name, cross-environment flag)
  • is_bidirectional and traffic_direction: optional flow information, stored and returned by the API
{
  "source": "agent-host:7f3c…",
  "target": "azure:sql:orders-db",
  "dependency_type": "database",
  "port": 1433,
  "protocol": "tcp",
  "confidence": 0.9,
  "is_active": true,
  "discovery_method": "agent_connection_tracking"
}

Uniqueness Constraint

Dependencies are unique on (source, target, type, port), with an empty port counting as one value. The same two assets can therefore be linked more than once if the type or the port differs, for example a "network" dependency on port 443 and a "database" dependency on port 5432. When a discovery reports an existing (source, target, type, port) the record is updated instead of duplicated.

Cross-Environment Dependencies

Dependencies can span discovery zones: an agent host connecting to the address of an asset discovered by a cloud collector, a Kubernetes cluster linked to its cloud resource, a service seen in traces. Address matching looks up the remote IP among the active assets of every zone. Assets that several zones report as the same machine are merged (see Asset Deduplication), and the dependencies of every zone then point to the merged asset.

Note: A connection to an address that AsPeekIt does not know yet creates no dependency: it appears once the target is discovered.

Confidence Scoring

Confidence is set by each detection method rather than computed from multiple signals: declared relationships (runs_on of agent processes and containers, Kubernetes and cloud references) are usually 1.0 or 0.95, observed agent connections 0.9, heuristic and inferred links lower. Low-trust sources such as AI inference never overwrite the confidence or the discoverer of a dependency found by a collector. The asset detail page colours confidence green at 80% and above, yellow from 50% to 79% and red below 50%.

Stale Dependencies

Besides the connection expiry, a daily task marks inactive every discovered dependency not seen for DEPENDENCY_STALE_DAYS (default 7); dependencies created by hand or through the API are left alone. Another daily task deletes the inactive dependencies whose last sighting is older than 7 days. Dependencies of inactive assets are not drawn in the topology.