Add gMSA Cypher queries for BloodHound CE#49
Conversation
Add four queries for enumerating and analyzing Group Managed Service Accounts (gMSAs) and ReadGMSAPassword relationships: - All gMSAs: List all gMSA accounts - All ReadGMSAPassword relationships: Show all ReadGMSAPassword edges - Principals with ReadGMSAPassword: Reader and target pairs - Effective gMSA password readers through group membership: Nested group traversal
|
Hi @chryzsh, thanks for wanting to add more gMSA visibility! I suggest we change them to these. What do you think? First, relying on the
Second, a query that captures the same as the three queries:
|
|
For the first one, this looks like a solid suggestion. I still think it would be convenient to have a "table" type query that just lists all of them, but I understand if you want to keep the queries focus on path finding. Second, good suggestion to consolidate the three queries into one. I'm fine with you making these changes yourself before merging, lest you want me to do it. |
|
Cool. I'll add the queries in an upcoming larger addition. I'll keep this PR open for now. |
|
@chryzsh I just realized that I had planned on creating a similar query, which filters out Tier Zero source principals too (as they can compromise anything anyway). Please do let me know if you have feedback to it: |
|
This looks like a good evolution of the query, especially filtering out Tier Zero principles (like I did in my other PR). Adding Generic* edges in p1 is probably a good idea. It seems like the p2 path (transitive via group membership?) only checks for ReadGMSAPassword, not the write-based edges (GenericAll, etc.). Maybe someone could also have transitive GenericWrite over a gMSA through group membership? Or are direct group-to-gMSA write permissions less common? Also, will adding all those edge types to p2 would make the query heavier? |


Add four queries for enumerating and analyzing Group Managed Service Accounts (gMSAs) and ReadGMSAPassword relationships: