Skip to content

Commit b87d159

Browse files
committed
Add support for nested groups
1 parent 4d023a1 commit b87d159

File tree

2 files changed

+8
-30
lines changed

2 files changed

+8
-30
lines changed

categories/01-entra-users-groups.json

+6-28
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"queryList": [
1616
{
1717
"final": true,
18-
"query": "MATCH (entra_roles_t0) WHERE (entra_roles_t0.displayname =~ '(?i)_VAR_all-entra-roles-in-t0') MATCH p = (:AZUser)-[:AZHasRole|AZMemberOf*1..2]->(entra_roles_t0) RETURN p",
18+
"query": "MATCH (entra_roles_t0) WHERE (entra_roles_t0.displayname =~ '(?i)_VAR_all-entra-roles-in-t0') MATCH p = (:AZUser)-[:AZHasRole|AZMemberOf*1..5]->(entra_roles_t0) RETURN p",
1919
"allowCollapse": true
2020
}
2121
]
@@ -26,7 +26,7 @@
2626
"queryList": [
2727
{
2828
"final": true,
29-
"query": "MATCH (entra_roles_t1) WHERE (entra_roles_t1.displayname =~ '(?i)_VAR_all-entra-roles-in-t1') MATCH p = (:AZUser)-[:AZHasRole|AZMemberOf*1..2]->(entra_roles_t1) RETURN p",
29+
"query": "MATCH (entra_roles_t1) WHERE (entra_roles_t1.displayname =~ '(?i)_VAR_all-entra-roles-in-t1') MATCH p = (:AZUser)-[:AZHasRole|AZMemberOf*1..5]->(entra_roles_t1) RETURN p",
3030
"allowCollapse": true
3131
}
3232
]
@@ -37,7 +37,7 @@
3737
"queryList": [
3838
{
3939
"final": true,
40-
"query": "MATCH (entra_roles_t0) WHERE (entra_roles_t0.displayname =~ '(?i)_VAR_all-entra-roles-in-t0') MATCH p = (:AZGroup)-[:AZHasRole|AZMemberOf*1..2]->(entra_roles_t0) RETURN p",
40+
"query": "MATCH (entra_roles_t0) WHERE (entra_roles_t0.displayname =~ '(?i)_VAR_all-entra-roles-in-t0') MATCH p = (:AZGroup)-[:AZHasRole|AZMemberOf*1..5]->(entra_roles_t0) RETURN p",
4141
"allowCollapse": true
4242
}
4343
]
@@ -48,29 +48,7 @@
4848
"queryList": [
4949
{
5050
"final": true,
51-
"query": "MATCH (entra_roles_t1) WHERE (entra_roles_t1.displayname =~ '(?i)_VAR_all-entra-roles-in-t1') MATCH p = (:AZGroup)-[:AZHasRole|AZMemberOf*1..2]->(entra_roles_t1) RETURN p",
52-
"allowCollapse": true
53-
}
54-
]
55-
}
56-
{
57-
"name": "Find all dynamic groups with an active Tier-0 Entra role",
58-
"category": "Entra ID - Users & Groups",
59-
"queryList": [
60-
{
61-
"final": true,
62-
"query": "MATCH (entra_roles_t0) WHERE (entra_roles_t0.displayname =~ '(?i)_VAR_all-entra-roles-in-t0') MATCH p = (:AZGroup {isassignabletorole: True})-[:AZHasRole|AZMemberOf*1..2]->(entra_roles_t0) RETURN p",
63-
"allowCollapse": true
64-
}
65-
]
66-
}
67-
{
68-
"name": "Find all dynamic groups with an active Tier-1 Entra role",
69-
"category": "Entra ID - Users & Groups",
70-
"queryList": [
71-
{
72-
"final": true,
73-
"query": "MATCH (entra_roles_t1) WHERE (entra_roles_t1.displayname =~ '(?i)_VAR_all-entra-roles-in-t1') MATCH p = (:AZGroup {isassignabletorole: True})-[:AZHasRole|AZMemberOf*1..2]->(entra_roles_t1) RETURN p",
51+
"query": "MATCH (entra_roles_t1) WHERE (entra_roles_t1.displayname =~ '(?i)_VAR_all-entra-roles-in-t1') MATCH p = (:AZGroup)-[:AZHasRole|AZMemberOf*1..5]->(entra_roles_t1) RETURN p",
7452
"allowCollapse": true
7553
}
7654
]
@@ -88,11 +66,11 @@
8866
}
8967
{
9068
"name": "Find all shortest paths to Tier-0 Entra roles",
91-
"category": "Entra ID - Paths",
69+
"category": "Entra ID - Users & Groups",
9270
"queryList": [
9371
{
9472
"final": true,
95-
"query": "MATCH (all_principals_excluding_builtin) WHERE (all_principals_excluding_builtin:_VAR_all-security-principals-excluding-built-in) MATCH (entra_roles_t0) WHERE (entra_roles_t0.displayname =~ '(?i)_VAR_all-entra-roles-in-t0') MATCH p = allShortestPaths((all_principals_excluding_builtin)-[r*1..]->(entra_roles_t0))",
73+
"query": "MATCH (all_principals_excluding_builtin) WHERE (all_principals_excluding_builtin:_VAR_all-security-principals-excluding-built-in) MATCH (entra_roles_t0) WHERE (entra_roles_t0.displayname =~ '(?i)_VAR_all-entra-roles-in-t0') MATCH p = allShortestPaths((all_principals_excluding_builtin)-[r*1..]->(entra_roles_t0)) RETURN p",
9674
"allowCollapse": true
9775
}
9876
]

categories/03-hybrid-users-groups.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"queryList": [
1616
{
1717
"final": true,
18-
"query": "MATCH (onprem_user) WHERE (onprem_user.onpremisesyncenabled = true) MATCH (entra_roles_t0) WHERE (entra_roles_t0.displayname =~ '(?i)_VAR_all-entra-roles-in-t0') MATCH p = (onprem_user)-[:AZHasRole|AZMemberOf*1..2]->(entra_roles_t0) RETURN p",
18+
"query": "MATCH (onprem_user) WHERE (onprem_user.onpremisesyncenabled = true) MATCH (entra_roles_t0) WHERE (entra_roles_t0.displayname =~ '(?i)_VAR_all-entra-roles-in-t0') MATCH p = (onprem_user)-[:AZHasRole|AZMemberOf*1..5]->(entra_roles_t0) RETURN p",
1919
"allowCollapse": true
2020
}
2121
]
@@ -26,7 +26,7 @@
2626
"queryList": [
2727
{
2828
"final": true,
29-
"query": "MATCH (onprem_user) WHERE (onprem_user.onpremisesyncenabled = true) MATCH (entra_roles_t1) WHERE (entra_roles_t0.displayname =~ '(?i)_VAR_all-entra-roles-in-t1') MATCH p = (onprem_user)-[:AZHasRole|AZMemberOf*1..2]->(entra_roles_t1) RETURN p",
29+
"query": "MATCH (onprem_user) WHERE (onprem_user.onpremisesyncenabled = true) MATCH (entra_roles_t1) WHERE (entra_roles_t0.displayname =~ '(?i)_VAR_all-entra-roles-in-t1') MATCH p = (onprem_user)-[:AZHasRole|AZMemberOf*1..5]->(entra_roles_t1) RETURN p",
3030
"allowCollapse": true
3131
}
3232
]

0 commit comments

Comments
 (0)