Last active
September 30, 2024 10:15
-
-
Save martinsohn/3f6122c7486ca3ffcaa444772f1a35f2 to your computer and use it in GitHub Desktop.
Generate Cypher from AzurePrivilegedIAM Tier Zero
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Roles = IRM "https://github.com/Cloud-Architekt/AzurePrivilegedIAM/raw/main/Classification/Classification_EntraIdDirectoryRoles.json" | |
$T0RolesIDs = ($Roles | ? {$_.Classification.EAMTierLevelTagValue -eq 0}).RoleId -join "','" | |
$Cypher = "// From 'AzurePrivilegedIAM'. Generated $(Get-Date -F yyyy-MM-dd)`nMATCH (n:AZBase) WHERE n.templateid IN ['$T0RolesIDs'] AND NOT coalesce(n.system_tags, '') CONTAINS 'admin_tier_0' = true RETURN n" | |
$Cypher | Set-Clipboard | |
↓ GENERATES CYPHER ↓ | |
// From 'AzurePrivilegedIAM'. Generated 2024-03-13 | |
MATCH (n:AZBase) WHERE n.templateid IN ['9b895d92-2cd3-44c7-9d02-a6ac2d5ea5c3','58a13ea3-c632-46ae-9ee0-9c0d43cd7f3d','ffd52fa5-98dc-465c-991d-fc073eb59f8f','8424c6f0-a189-499e-bbd0-26c1753c96d4','1d336d2c-4ae8-42ef-9711-b3604ce3fc2c','5b784334-f94b-471a-a387-e7219fc49ca2','c4e39bd9-1100-46d3-8c65-fb160da0071f','25a516ed-2fa0-40ea-a2d0-12923a21473a','0526716b-113d-4c15-b2c8-68e3c22b9f80','aaf43236-0c0d-4d5f-883a-6955382ac081','3edaf663-341e-4475-9f94-5c398ef6c070','b0f54661-2d74-4c50-afa3-1ec803f12efe','892c5842-a9a6-463a-8041-72aa08ca3cf6','158c047a-c907-4556-b7ef-446551a6b5f7','7698a772-787b-4ac8-901f-60d6b08affd2','e6d1a23a-da11-4be4-9570-befc86d067a7','b1be1c3e-b65d-4f19-8427-f6fa0d97feb9','2b499bcd-da44-4968-8aec-78e1674fa64d','d29b2b05-8046-44ba-8758-1e26182fcf32','9360feb5-f418-4baa-8175-e2a00bac4301','8329153b-31d0-4727-b945-745eb3bc5f31','dd13091a-6207-4fc0-82ba-3641e056ab95','6e591065-9bad-43ed-90f3-e9424366d2f0','0f971eea-41eb-4569-a71e-57bb8a3eff1e','be2f45a1-457d-42af-a067-6ec1fa63bc45','62e90394-69f5-4237-9190-012177145e10','f2ef992c-3afb-46b9-b7cf-a126ee74c451','ac434307-12b9-4fa1-a708-88bf58caabc1','fdd7a751-b60b-444a-984c-02652fe8fa1c','729827e3-9c14-49f7-bb1b-9608f156bbb8','8ac3fc64-6eca-42ea-9e69-59f4c7b60eb2','45d8d3c5-c802-45c6-b32a-1d70b5e1e86e','3a2c62db-5318-420d-8d74-23affee5d9d5','b5a8dcf3-09d5-43a9-a639-8e29ef291470','744ec460-397e-42ad-a462-8b3f9747a02c','4d6ac14f-3453-41d0-bef9-a3e0c569773a','59d46f88-662b-457b-bceb-5c3809e5908f','92ed04bf-c94a-4b82-9729-b799a7a4c178','4ba39ca4-527c-499a-b93d-d9b492c50246','e00e864a-17c5-4a4b-9c06-f5b95a8d5bd8','966707d0-3269-4727-9be2-8c3a10f19b9d','af78dc32-cf4d-46f9-ba4e-4428526346b5','7be44c8a-adaf-4e2a-84d6-ab2649e08a13','e8611ab8-c189-46e8-94e1-60213ab1f814','194ae4cb-b126-40b2-bd5b-6091b380977d','5f2222b1-57c3-48ba-8ad5-d4759f1fde6f','5d6b6bb7-de71-4623-b4af-96380a352509','69091246-20e8-4a56-aa4d-066075b2a7a8','fe930be7-5e62-47db-91af-98c3a49a38b1','11451d60-acb2-45eb-a7d6-43d0f0125c13','32696413-001a-46ae-978c-ce0f6b3620d2'] AND NOT coalesce(n.system_tags, '') CONTAINS 'admin_tier_0' = true RETURN n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mentioned in https://twitter.com/martinsohndk/status/1768065960148136277