---
title: "Attack paths and the security graph"
description: "How TRUSTIVAN builds a security graph from exposure, vulnerabilities, identities (NHI included) and credentials, how to explore it, and how paths are scored."
---

A finding list ranks problems one at a time. An attacker does not: they chain
an internet-facing load balancer, a vulnerable library in the workload behind
it, the service account that workload runs as, and the cluster-admin binding
that account holds. TRUSTIVAN builds that chain from what it already records
and shows it as an **attack path**, ranked by how likely and how damaging it is.

Open **AppSec → Attack paths** in the dashboard, or call
`GET /api/v1/attack-paths` (see [the API](#api)).

## What the graph is built from

The security graph is built per organization from data TRUSTIVAN already
collects. Nothing extra is installed. Each node and edge comes from a recorded
fact, never from a guess:

| Edge | From → to | Evidence |
|---|---|---|
| `exposes` | Internet → workload | The running-image index from a connected [cluster](/configuration/cloud-and-kubernetes) or [cloud account](/configuration/cloud-posture): a public `LoadBalancer` Service, an Ingress backend, a public function URL |
| `exposes` | Internet → data store | A collected storage bucket with public access, or a database marked publicly accessible |
| `runs` | Workload → image | The cluster's pod templates, or a running build matched to a scanned image ([code to cloud](/configuration/code-to-cloud)) |
| `uses_identity` | Workload → service account | The pod's service account (`default` when none is set). The hop is surest (1.0) when the `k8s.workload.token-automounted` check confirms the token is mounted, 0.8 otherwise |
| `assumes` | Service account → cloud identity | An IRSA role, GKE workload identity or Azure workload identity bound to the account |
| `grants` | Service account → cluster-admin | The `k8s.workload.cluster-admin-identity` check fired on the workload |
| `grants` | Cloud identity → cloud administrator | The collected role carries an `Allow *` on `*` policy (or allows every action) |
| `holds` | Workload → credential | A [secret](/configuration/scanning) found in the image it runs, or the `k8s.container.credential-in-env` check |
| `escapes_to` | Workload → container host | Privileged, `hostPID`, a `hostPath` mount or the container runtime socket |
| `exposes` | Internet → NHI identity | NHI Security recorded an active exposure of one of the identity's credentials (a repository, CI log, image, ticket or chat) |
| `uses_identity` | Workload → NHI identity | NHI Security saw the workload authenticate as the identity |
| `assumes` | NHI identity ↔ its principal | The cloud role or user, or the Kubernetes service account, the identity is (both ways: holding its credential is acting as the principal, and reaching the principal reaches what NHI Security recorded on it) |
| `assumes` | NHI identity → cloud identity | NHI Security recorded a permission that lets it assume the role |
| `grants` | NHI identity → cloud administrator | NHI Security recorded a permission that allows every action in the account |

A **foothold** is an internet-exposed workload with something an attacker can
exploit: an open vulnerability in an image it runs that is critical or high, in
the CISA KEV catalogue, or above 10% EPSS; or a critical or high
[runtime detection](/configuration/runtime-sensor) in the last seven days.
Suppressed and resolved findings are not footholds. A non-human identity whose
credential leaked is a foothold too: the leaked material is the exploit.

### Non-human identities from NHI Security

[NHI Security](/nhi-security/overview) keeps its own inventory on its own
database. It publishes an organization's identities to the graph with
`PUT /api/v1/security-graph/nhi-identities` (the organization is the caller's
credential's; nothing in the body names one), and each publication replaces the
last. Each identity becomes an **NHI identity** node, with the edges in the
table above, so a path can enter through a leaked CI key and assume a role, or
pass from an exposed workload through an over-privileged identity to a cloud
administrator. A leak's hop is 0.9, because NHI Security records where material
was found, not whether that place is public; its exploitability is NHI
Security's confidence that the material is a live credential: 1.0 confirmed,
0.7 probable, 0.4 possible. A publication carries where a credential leaked,
never the credential.

NHI Security sends the publication itself after every synchronization that
collected anything, for an NHI tenant federated with your organization, once an
NHI Security admin stores an API key of the organization holding `scans:create`
under the credential handle `security-graph-publisher` (field `token`; **Store a
credential** on the connector form, or `POST /nhi/api/v1/connectors/credential`).
The request names your organization in `X-Expected-Organization`, and a key of
any other organization is refused with `409`, so a key stored in the wrong
tenant publishes nothing. An identity's principal is its AWS IAM ARN or, for a
Kubernetes service account, `k8s:<cluster uid>/<namespace>/<name>`; its
assumable roles come from permissions that allow `sts:AssumeRole` on a named
role, the accounts it administers from a wildcard permission over every action,
and the workloads that use it from NHI Security's graph. A Kubernetes connector
needs its cluster's `kube-system` namespace UID in the **Cluster UID** setting
for its accounts and workloads to join the same nodes as a
[cluster collection](/configuration/cloud-and-kubernetes); without it they are
sent with no Kubernetes key. Each attempt is in NHI Security's audit trail as
`security_graph.published`.

A path starts at the internet, enters through a foothold (or reaches a public
data store directly), follows identity and credential edges, and ends at a
**target**: cluster-admin, a cloud administrator, a public data store, the
nodes under a container, or a credential.

## How a path is scored

```text
score = round(100 × exploitability × exposure × blast radius)
```

| Factor | 0 to 1 | What it is |
|---|---|---|
| Exploitability | the foothold's best weakness | For a leaked NHI credential, NHI Security's confidence (1.0, 0.7 or 0.4). For a vulnerability, half its severity (CVSS / 10, or the band's midpoint) and half its threat (1 when CISA lists it as exploited, otherwise its EPSS probability). Scaled by 0.6 for a development-only dependency and 0.7 for a package the entrypoint cannot load, as the [risk score](/concepts/risk-scoring) is. A runtime detection is 0.8. A public data store needs no exploit: 1.0 |
| Exposure | entry × every hop | How surely each hop can be taken: 1.0 for a public entry, an assumed role or a granted binding; 0.8 for a service account whose token was not confirmed mounted; 0.9 for reading a credential, escaping to the host or reaching a leaked NHI credential |
| Blast radius | the target | Cluster-admin and a cloud administrator 1.0 (a role that allows every action but not on every resource, 0.9), a public database 0.9, a public bucket 0.8, the container host 0.7, a credential 0.6 |

Every hop of a path carries its factors and the reason for each, in words, so
the score can be recomputed by hand. A cloud administrator's reason also counts
the buckets, databases and secrets its account holds.

Paths are **deduplicated**: when several routes join the same entry to the same
target, the best is kept and the others are counted as `alternatives`.

### Findings carry the paths they sit on

A finding a path depends on is ranked up in the backlog: the risk score's
`attack_path` factor multiplies it by up to 1.25, by the best path's score, and
names that path. The path is scored from the finding's CVSS, KEV and EPSS and
never from its risk score, so the two cannot feed each other. The finding page
and the asset page show **On N attack paths** with links to each.

## When the graph is built

The worker rebuilds an organization's graph within a minute or two of each
scan, each cluster or cloud collection and each triage change, and every six
hours regardless (so a runtime detection ageing out of its seven-day window is
dropped). A rebuild replaces the whole graph, and a path that survives keeps its
ID and the date it was first seen. A failed build keeps the previous graph and
is retried.

Measured on an organization with 100,000 findings over 2,000 images and 2,000
workloads (500 exposed): one rebuild reads about 37,000 qualifying findings and
produces around 6,000 nodes, 6,600 edges and 580 paths. The rebuild is held to
a performance budget in CI (`BenchmarkAttackPathRebuildAtScale`).

## Explore the graph

**AppSec → Attack paths → Explore the graph** opens the security graph
explorer. Find a node by name or key (the most connected nodes are listed to
start from), then see everything within one to three edges of it: what reaches
it on the left, what it leads to on the right, arrows in the direction an
attacker moves. Every node opens its own neighbourhood, so a path can be checked
hop by hop. The legend is also the filter: untick a node or edge kind to hide
it. The panel beside the graph shows the node's facts, the weaknesses that make
it a foothold (linked to their findings), its blast radius when it is a target,
and links to its asset, the paths through it and, for an NHI identity, its page
in NHI Security. On a phone, or with **List**, the same neighbourhood is two
lists, each edge with its reason.

Each step of an attack path, and the attack paths card on a finding or asset
page, links into the explorer.

## Limits

These are deliberate, and each is a reason a real path may be missing:

- **No resource-level permissions.** TRUSTIVAN does not evaluate which
  bucket a role can read. A cloud identity reaches a target only when it is an
  administrator; its blast radius counts what its account holds.
- **Cloud identities come from workload bindings.** A Lambda function's or a
  virtual machine's role is not collected, so a path through one is not drawn.
- **NHI identities are only as current as the last publication.** NHI Security
  publishes after each synchronization, and only once a key is stored for it; a
  failed publication (the host down, the key refused) is retried by the next
  synchronization, not before. Assumable roles are read from AWS permissions
  only, and NHI Security's effective-access analysis beyond assumable roles and
  wildcard permissions is not carried over.
- **Kubernetes RBAC is read through checks.** Cluster-admin is known per
  workload (the check that fired), not from a full RBAC graph.
- **Search bounds.** A path has at most six edges, at most 1,000 paths are kept
  (highest score first), and a search stops after two million edge visits. The
  list says when a bound cut it short.

## API

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/attack-paths` | `findings:read` | Paths, highest score first; filter by `min_score`, `target_kind`, `asset_id`, `finding_id`; `limit` (1 to 200) and `offset`; `graph` reports the last build and its inputs |
| `GET` | `/attack-paths/{id}` | `findings:read` | One path with every hop explained and the findings it depends on |
| `GET` | `/assets/{id}/security-graph` | `findings:read` | The graph within `depth` (1 to 3) edges of an asset, at most 200 nodes |
| `GET` | `/security-graph/nodes` | `findings:read` | Nodes whose label or key contains `q`, optionally of one `kind`, most connected first; `limit` 1 to 50 |
| `GET` | `/security-graph/neighbourhood` | `findings:read` | The graph within `depth` (1 to 3) edges of the node named by `key`, at most 200 nodes |
| `PUT` | `/security-graph/nhi-identities` | `scans:create` | NHI Security's identities for the caller's organization, replacing the last publication; at most 20,000 |

The [MCP server](/integrations/mcp-server) has `list_attack_paths`,
`get_attack_path` and `explore_security_graph`.
