Skip to content

Commit c8414be

Browse files
committed
adds another query example to the README
1 parent d0c81ab commit c8414be

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ This performs the same, but restricts the query to start at nodes of type Pod /
7272
MATCH p = SHORTEST 1 (src)-[r {attack_path: 1}]->+(crb:ClusterRoleBinding)-[:GRANTS_PERMISSION {attack_path: 1}]->(cr:ClusterRole {name: "cluster-admin"}) WHERE (src:ServiceAccount OR src:Pod or src:User or src:Group) RETURN p
7373
```
7474

75+
Using the old `shortestPath` syntax:
76+
77+
```cypher
78+
MATCH (crb:ClusterRoleBinding)-[r:GRANTS_PERMISSION {attack_path: 1}]->(cr:ClusterRole {name: 'cluster-admin'})
79+
WITH crb, cr, r
80+
MATCH (src) WHERE src:ServiceAccount OR src:Pod OR src:User or src:Group
81+
WITH src, crb, cr, r
82+
UNWIND src as s
83+
MATCH p=shortestPath((s)-[*]->(crb))
84+
WHERE all(r in relationships(p) where r.attack_path is not null)
85+
RETURN p, cr, r
86+
```
87+
7588
## Acknowledgements
7689

7790
- [BloodHound](https://github.com/BloodHoundAD/BloodHound) - The original project showing the power of graph databases for security

0 commit comments

Comments
 (0)