> ## Documentation Index
> Fetch the complete documentation index at: https://specterops-bed-6715-managed-id-auth-method.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-bed-6715-managed-id-auth-method/32bGxo1_JbXAaHjs/assets/enterprise-AND-community-edition-pill-tag.svg?fit=max&auto=format&n=32bGxo1_JbXAaHjs&q=85&s=bb5b2bc8331220b968a23923bc289c26" 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.

# 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-bed-6715-managed-id-auth-method/X2lJ9LTmp0uionML/assets/og-bp-1.png?fit=max&auto=format&n=X2lJ9LTmp0uionML&q=85&s=69ba9bee5ce7b672070f8332d90d4b8e" 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-bed-6715-managed-id-auth-method/X2lJ9LTmp0uionML/assets/og-bp-1.png?w=280&fit=max&auto=format&n=X2lJ9LTmp0uionML&q=85&s=bd692187e0ecb15bffc173692e684f3b 280w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/X2lJ9LTmp0uionML/assets/og-bp-1.png?w=560&fit=max&auto=format&n=X2lJ9LTmp0uionML&q=85&s=13a37b0db687a40bc6089eb79c17bfe9 560w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/X2lJ9LTmp0uionML/assets/og-bp-1.png?w=840&fit=max&auto=format&n=X2lJ9LTmp0uionML&q=85&s=39f31fdfbd34294a881ddeec7bfb0e42 840w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/X2lJ9LTmp0uionML/assets/og-bp-1.png?w=1100&fit=max&auto=format&n=X2lJ9LTmp0uionML&q=85&s=a6158af1eea663ebbf775826e87e2698 1100w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/X2lJ9LTmp0uionML/assets/og-bp-1.png?w=1650&fit=max&auto=format&n=X2lJ9LTmp0uionML&q=85&s=e88798b660e6b7202e998f3de53b923c 1650w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/X2lJ9LTmp0uionML/assets/og-bp-1.png?w=2500&fit=max&auto=format&n=X2lJ9LTmp0uionML&q=85&s=0befacdd372874b10ab400bc3d77e591 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-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-2.png?fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=bc723fb289ff8e5705c24641748cb35e" 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-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-2.png?w=280&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=087bd1830a518d7b3dccf8d47d1e06ee 280w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-2.png?w=560&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=99c0b4102d6b2a6cd3511da79cfaa375 560w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-2.png?w=840&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=55a6b326d654fca4c451e1381136b93c 840w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-2.png?w=1100&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=84b484ba67ece86a16bb64648d647729 1100w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-2.png?w=1650&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=600cfd97234175b48cfa5e86af92290c 1650w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-2.png?w=2500&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=14783803c69a05fc5633ecc196762d66 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-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-3.png?fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=7d4cfd9736f907273884274cf4ed848a" 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-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-3.png?w=280&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=01e6841adfeae968cff97eeb448d54b2 280w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-3.png?w=560&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=66f3b2de928f712d36796b98640a784e 560w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-3.png?w=840&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=f524a4f1edca27809e7ffbc40b948a37 840w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-3.png?w=1100&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=503eb266c9284905b4d6a23031c21abc 1100w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-3.png?w=1650&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=f6c2d726ece58f4d0c320604958aac4d 1650w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-3.png?w=2500&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=77cdd693b5432c4acf7eea8961a4811b 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-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-4.png?fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=99b39eb5f27a4aa044994aced46395db" 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-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-4.png?w=280&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=d3d4e4e14966cb7b3496f71f98b5360a 280w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-4.png?w=560&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=64dac3fe786437821260e5cef860d863 560w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-4.png?w=840&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=b3f104618164cc2cde5e32fdb4af4893 840w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-4.png?w=1100&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=7ca1b734a46855b9d97e9bb9a40db298 1100w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-4.png?w=1650&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=180f23c4ec7c5b627c8bf52b9e1a12ca 1650w, https://mintcdn.com/specterops-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-4.png?w=2500&fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=869a60a9d0131b43cc7cf46a3a06dfbc 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-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-5.png?fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=e757e797b24d93dadfcd61362ccd15ca" 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-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-6.png?fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=4bb8b1e1a302b4a482984c9364511a1b" 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-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-7.png?fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=5a6772122aef69bfd20d05556fb3c777" 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-bed-6715-managed-id-auth-method/oaXJy9nIZkpYQWrv/assets/og-bp-8.png?fit=max&auto=format&n=oaXJy9nIZkpYQWrv&q=85&s=66f5c6595f5ae5e2a3959b6fe980ba63" 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.**

<Warning>
  If your graph model does not create paths connecting non-adjacent nodes, you should use a relational database instead. A graph database is the wrong tool for data that only produces one-to-one patterns.
</Warning>

<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>
