> ## Documentation Index
> Fetch the complete documentation index at: https://specterops-feat-poc-api-playground.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenGraph Graph Theory

> Attack Graph Model Design Requirements and Examples

<img noZoom src="https://mintcdn.com/specterops-feat-poc-api-playground/5XJ7p5p7xL9ZwxE2/assets/enterprise-AND-community-edition-pill-tag.svg?fit=max&auto=format&n=5XJ7p5p7xL9ZwxE2&q=85&s=79b8dea14cb2266671c0a2f64f4b9caa" alt="Applies to BloodHound Enterprise and CE" width="482" height="45" data-path="assets/enterprise-AND-community-edition-pill-tag.svg" />

# Introduction

For several years, one of the biggest pain-points with contributing to BloodHound has been in getting nodes and edges ingested and correctly displayed in the GUI. BloodHound OpenGraph changes that. Now it is easy for anyone to add nodes and edges into BloodHound through the easy-to-use `/file-upload/` endpoint.

However, while the process of adding nodes and edges to the product is greatly simplified, the product will not function as expected without a well-designed attack graph model. This document seeks to educate users on attack graph model design theory, best-practices, and requirements.

An attack graph is a tool - a powerful force multiplier when wielded correctly, a frustrating and confusing hazard when not. This document aims to equip you with the knowledge and skills necessary to effectively wield this tool.

<Info>
  At this time, OpenGraph nodes and edges are not supported in the Search or Pathfinding tab, so the Cypher tab **must** be used to query the data manually.
</Info>

# Basic Attack Graph Vocabulary and Design Theory

Graphs are [well-understood](https://en.wikipedia.org/wiki/Graph_%28discrete_mathematics%29), well-studied mathematical constructs. You can find thousands of guides, tools, and academic papers that make use of graphs. This document will not replace a proper education or time spent working with graphs. But in this section we will touch on the most fundamental aspects of a graph you must understand in order to effectively get BloodHound to work with your nodes and edges.

Every graph is constructed from two fundamental components: vertices (nodes) and edges (relationships):

<img noZoom src="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-1.png?fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=d299e61fd101349ead8a6227b262aa1d" alt="Node1 -- Edge1 --> Node2" data-og-width="1012" width="1012" data-og-height="508" height="508" data-path="assets/og-bp-1.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-1.png?w=280&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=07cb2a79d937b90a6be9ac1ac3cd8c1f 280w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-1.png?w=560&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=00948c4e555b076b3bf3a218eb2e1858 560w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-1.png?w=840&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=09f338ea95006988a3aa9b4012687134 840w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-1.png?w=1100&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=be8813a21cbd72e2caa6e25434773070 1100w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-1.png?w=1650&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=0572fb2a5f1a1b4855c8ee544bc055ab 1650w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-1.png?w=2500&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=97c997a1dc57aa050dd14d5793309692 2500w" />

The above graph has two nodes and one edge. The edge is **directed**. The source node of the edge is “Node 1”. The destination node of the edge is “Node 2”.

**Every** edge in a BloodHound attack graph is **directed**, and is **one-way**. There are no bi-directional (“two-way”) edges in a BloodHound graph.

In a BloodHound attack graph, the direction of the **edge** must match the direction of **access** or **attack**. Let’s look at an example with Active Directory group memberships.

In the BloodHound attack graph, we model Active Directory security group memberships like this:

<img noZoom src="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-2.png?fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=ef0b1296f27cd1f8d029b1f089c9783f" alt="User -- MemberOf --> Group" data-og-width="1024" width="1024" data-og-height="432" height="432" data-path="assets/og-bp-2.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-2.png?w=280&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=bf890c988f21db803bc27c4d70806592 280w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-2.png?w=560&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=a022be8543907922a72b932fdd4674c4 560w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-2.png?w=840&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=d220b8fa9e8f17080683ca33a8a1df22 840w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-2.png?w=1100&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=44be1892765d59b3335681518833b0bf 1100w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-2.png?w=1650&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=752ddc6f0b24a688cec387476827fd0e 1650w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-2.png?w=2500&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=98db517ddd359f638c17eb7d5735585e 2500w" />

Think about the direction of the edge. Now think for a moment and try to figure out why we don’t model AD security group memberships like this instead:

<img noZoom src="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-3.png?fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=aae6af2b9685c5aa1bb1efcff59535d1" alt="Group -- HasMember --> User" data-og-width="1018" width="1018" data-og-height="424" height="424" data-path="assets/og-bp-3.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-3.png?w=280&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=7c16d06c19f396656b0df61822dcfd34 280w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-3.png?w=560&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=da81c19af75a26b245df472edf26d9b0 560w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-3.png?w=840&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=562a7a527399d96402c5c47c296ce736 840w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-3.png?w=1100&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=eeae674b6b3596e3f615bca229e7be54 1100w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-3.png?w=1650&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=fa1e8d9c67d55b2774d2ea9495dab275 1650w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-3.png?w=2500&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=33acda0a42cadd4f2bcde5c2a998db10 2500w" />

This seems perfectly reasonable at first glance, does it not? But remember that we are constructing an **attack graph** in order to discover **attack paths**. Edge directionality must serve attack path discovery.

The direction of the edge going from the group to the user does not expose any attack path. Just because a user is a member of a group does not mean the group has any “control” of the user. But when the direction of the edge is from the user to the group, that DOES serve attack path discovery.

Why? Because in Windows and Active Directory, members of security groups gain the privileges held by those groups. Let’s extend the model a bit to make this easier to see:

<img noZoom src="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-4.png?fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=4e63726820bee6346842632cd575be83" alt="User -- MemberOf -> Group -- GenericAll --> Domain" data-og-width="1582" width="1582" data-og-height="414" height="414" data-path="assets/og-bp-4.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-4.png?w=280&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=48f6df44f2271ef6b577220b9baffb15 280w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-4.png?w=560&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=29527daa014b7f1cbdef46465e72c95a 560w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-4.png?w=840&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=48fb6848ed2b488a0835470ff8207e39 840w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-4.png?w=1100&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=512216c8decc798511bbe09c73929f9a 1100w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-4.png?w=1650&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=d81f18f9ac66b3006620a38ef9539b60 1650w, https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-4.png?w=2500&fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=69b2a4d679c4a13cc2f161a2f61905e4 2500w" />

The user is a member of a group, and the group has full control of the domain. When the user authenticates to Active Directory, their Kerberos ticket will include the SID of the group. When the user uses that ticket to perform some action against the domain object, the security reference monitor will inspect the ticket, see the group SID, and grant the user all the permissions against the domain that the group has.

**In reality the process is much more involved than this, but work with me here, people.**

The above diagram shows a **path** connecting two **non-adjacent** nodes. **Adjacent** nodes are those that are connected together by an edge. In the above diagram, the adjacent nodes are:

1. “User” and “Group” via the “MemberOf” edge

2. “Group” and “Domain” via the “GenericAll” edge

The “User” and “Domain” nodes are non-adjacent, yet there is a **path** connecting the “User” node to the “Domain” node.

When designing your attack graph model, you **must** be aware of the **patterns** that will emerge from your design. There are many examples out there of people who want to make a contribution to the BloodHound graph who do not seem to be aware of this. Instead of proposing nodes/edges that create multi-node patterns, they propose nodes/edges that result **only** in one-to-one patterns:

<img noZoom src="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-5.png?fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=d3ae0b3d1509f6e2b2a9899eb09ae50d" alt="Badly connected nodes" width="1012" height="772" data-path="assets/og-bp-5.png" />

In the above graph there are two patterns:

1. From the red (top left) to the pink (top right) node

2. From the blue (bottom left) to the green (bottom right) node

What’s wrong with this design?

Think of the graph as a map of **one-way streets**. In the above graph we have two one-way streets. But this map kinda sucks, doesn’t it? You can only start in two places and you can only go to two places. You can’t go from the red (top left) node to the blue (bottom left) node because there is no **path** connecting those nodes.

This is a much better map:

<img noZoom src="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-6.png?fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=802d4948b444f2aaea23bfad5f224043" alt="Well connected nodes" width="1002" height="770" data-path="assets/og-bp-6.png" />

Now is there a **path** from the red (top left) node to the blue (bottom left) node? Yes! It goes **through** the green (bottom right) node!

The difference in the two graphs is the level of **connectedness**, or how well-linked the nodes are to one another.

Let’s belabor the point a little more to make it even more clear. The top model would be analogous to having a node represent both a **person** and the **address** where they live, with the edge representing the fact that they live at that address:

<img noZoom src="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-7.png?fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=44e8fc601df7e9939dab41fab1c5ee56" alt="Badly connected nodes" width="980" height="808" data-path="assets/og-bp-7.png" />

While the bottom graph would be analogous to having the nodes represent the **addresses** and the edges represent **streets**:

<img noZoom src="https://mintcdn.com/specterops-feat-poc-api-playground/PP9njN_Qt9eWOT3E/assets/og-bp-8.png?fit=max&auto=format&n=PP9njN_Qt9eWOT3E&q=85&s=9b49a525805b3f8b46c298a94526e1ef" alt="Well connected nodes" width="1004" height="826" data-path="assets/og-bp-8.png" />

It should be obvious that for the sake of **pathfinding**, the **second** model is the **only** model that will work.

**This is actually how Google Maps works under the hood – it is a graph where locations are nodes and streets are edges.**

<Note>
  This article is adapted from [Andy Robbins](https://www.linkedin.com/in/robbinsandy/)’ blog post, “[Attack Graph Model Design Requirements and Examples](https://specterops.io/blog/2025/08/01/attack-graph-model-design-requirements-and-examples/),” which goes beyond what’s described here.
</Note>
