Skip to content

Commit

Permalink
BED-5304 Fix pre-saved queries with coalesce for proper type-checking (
Browse files Browse the repository at this point in the history
…#1079)

* BED-5304 Fix pre-saved queries with coalesce for proper type-checking

* fix: fixup coalesce arg

---------

Co-authored-by: John Hopper <[email protected]>
  • Loading branch information
StephenHinck and zinic authored Jan 15, 2025
1 parent 4a515ef commit 3765722
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/javascript/bh-shared-ui/src/commonSearches.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ export const CommonSearches: CommonSearchType[] = [
},
{
description: 'All Kerberoastable users',
cypher: `MATCH (u:User)\nWHERE u.hasspn=true\nAND u.enabled = true\nAND NOT u.objectid ENDS WITH '-502'\nAND NOT coalesce(u.gmsa, ' ') = true\nAND NOT coalesce(u.msa, ' ') = true\nRETURN u\nLIMIT 100`,
cypher: `MATCH (u:User)\nWHERE u.hasspn=true\nAND u.enabled = true\nAND NOT u.objectid ENDS WITH '-502'\nAND NOT coalesce(u.gmsa, false) = true\nAND NOT coalesce(u.msa, false) = true\nRETURN u\nLIMIT 100`,
},
{
description: 'Kerberoastable users with most admin privileges',
cypher: `MATCH (u:User)\nWHERE u.hasspn = true\n AND u.enabled = true\n AND NOT u.objectid ENDS WITH '-502'\n AND NOT coalesce(u.gmsa, ' ') = true\n AND NOT coalesce(u.msa, ' ') = true\nMATCH (u)-[:MemberOf|AdminTo*1..]->(c:Computer)\nWITH DISTINCT u, COUNT(c) AS adminCount\nRETURN u\nORDER BY adminCount DESC\nLIMIT 100`,
cypher: `MATCH (u:User)\nWHERE u.hasspn = true\n AND u.enabled = true\n AND NOT u.objectid ENDS WITH '-502'\n AND NOT coalesce(u.gmsa, false) = true\n AND NOT coalesce(u.msa, false) = true\nMATCH (u)-[:MemberOf|AdminTo*1..]->(c:Computer)\nWITH DISTINCT u, COUNT(c) AS adminCount\nRETURN u\nORDER BY adminCount DESC\nLIMIT 100`,
},
{
description: 'AS-REP Roastable users (DontReqPreAuth)',
Expand Down Expand Up @@ -252,7 +252,7 @@ export const CommonSearches: CommonSearchType[] = [
},
{
description: 'Nested groups within Tier Zero / High Value',
cypher: `MATCH p=(n:Group)-[:MemberOf*..]->(t:Group)\nWHERE coalesce(t.system_tags,'') CONTAINS ('tier_0')\nAND NOT n.objectid ENDS WITH '-512' // Domain Admins\nAND NOT n.objectid ENDS WITH '-519' // Enterprise Admins\nRETURN p\nLIMIT 1000`,
cypher: `MATCH p=(n:Group)-[:MemberOf*..]->(t:Group)\nWHERE coalesce(t.system_tags, '') CONTAINS ('tier_0')\nAND NOT n.objectid ENDS WITH '-512' // Domain Admins\nAND NOT n.objectid ENDS WITH '-519' // Enterprise Admins\nRETURN p\nLIMIT 1000`,
},
{
description: 'Disabled Tier Zero / High Value principals',
Expand Down

0 comments on commit 3765722

Please sign in to comment.